c64d196a10ca3d67e8e3e6a8a2f7753d8c441e61
Since KernelSU Manager can now be built for 32-bit, theres this problematic setup where userspace is 32-bit (armeabi-v7a) and kernel is 64bit (aarch64). On 64-bit kernels with CONFIG_COMPAT=y, 32-bit userspace passes 32-bit pointers. These values are interpreted as 64-bit pointers without proper casting and that results in invalid or near-null memory access. This patch adds proper compat-mode handling with the ff changes: - introduce a dedicated struct (`sepol_compat_data`) using u32 fields - use `compat_ptr()` to safely convert 32-bit user pointers to kernel pointers - adding a runtime `ksu_is_compat` flag to dynamically select between struct layouts This prevents a near-null pointer dereference when handling SELinux policy updates from 32-bit ksud in a 64-bit kernel. Truth table: kernel 32 + ksud 32, struct is u32, no compat_ptr kernel 64 + ksud 32, struct is u32, yes compat_ptr kernel 64 + ksud 64, struct is u64, no compat_ptr Preprocessor check 64BIT=y COMPAT=y: define both structs, select dynamically 64BIT=y COMPAT=n: struct u64 64BIT=n: struct u32 Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
SukiSU Ultra
A kernel-based root solution for Android devices, forked from tiann/KernelSU, and added some interesting changes.
Features
- Kernel-based
suand root access management - Module system based on Magic Mount
- App Profile: Lock up the root power in a cage
- Support non-GKI and GKI 1.0
- KPM Support
- Tweaks to the manager theme and the built-in susfs management tool.
Compatibility Status
-
KernelSU (before v1.0.0) officially supports Android GKI 2.0 devices (kernel 5.10+).
-
Older kernels (4.4+) are also compatible, but the kernel will have to be built manually.
-
With more backports, KernelSU can supports 3.x kernel (3.4-3.18).
-
Currently, only
arm64-v8a,armeabi-v7a (bare)andX86_64(some) are supported.
Installation
Integration
Translation
If you need to submit a translation for the manager, please go to Crowdin.
KPM Support
- Based on KernelPatch, we removed features redundant with KSU and retained only KPM support.
- Work in Progress: Expanding APatch compatibility by integrating additional functions to ensure compatibility across different implementations.
Open-source repository: https://github.com/ShirkNeko/SukiSU_KernelPatch_patch
KPM template: https://github.com/udochina/KPM-Build-Anywhere
Note
- Requires
CONFIG_KPM=y- Non-GKI devices requires
CONFIG_KALLSYMS=yandCONFIG_KALLSYMS_ALL=y- For kernels below
4.19, backporting fromset_memory.hfrom4.19is required.
Troubleshooting
- Device stuck upon manager app uninstallation? Uninstall com.sony.playmemories.mobile
Sponsor
ShirkNeko's sponsorship list
- Ktouls Thanks so much for bringing me support.
- zaoqi123 Thanks for the milk tea.
- wswzgdg Many thanks for supporting this project.
- yspbwx2010 Many thanks.
- DARKWWEE 100 USDT
- Saksham Singla Provide and maintain the website
- OukaroMF Donation of website domain name
License
- The file in the “kernel” directory is under GPL-2.0-only license.
- The images of the files
ic_launcher(?!.*alt.*).*with anime character sticker are copyrighted by 怡子曰曰, the Brand Intellectual Property in the images is owned by 明风 OuO, and the vectorization is done by @MiRinChan. Before using these files, in addition to complying with Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International, you also need to comply with the authorization of the two authors to use these artistic contents. - Except for the files or directories mentioned above, all other parts are under GPL-3.0 or later license.
Credit
- KernelSU: upstream
- MKSU: Magic Mount
- RKSU: support non-GKI
- susfs: An addon root hiding kernel patches and userspace module for KernelSU.
- KernelPatch: KernelPatch is a key part of the APatch implementation of the kernel module
KernelSU's credit
- Kernel-Assisted Superuser: The KernelSU idea.
- Magisk: The powerful root tool.
- genuine: APK v2 signature validation.
- Diamorphine: Some rootkit skills.
Languages
Kotlin
67.1%
C
20%
Rust
11.1%
Shell
0.9%
Makefile
0.4%
Other
0.4%