Repository navigation
fix(samsung): restore late-load ksud initialization on restricted Samsung kernels - #9
chloropine wants to merge 1 commit into
Conversation
This fork only exists to validate diabl0w/KernelSU PR diabl0w#9 on the Galaxy S23 Ultra (SM-S918B, android13-5.15). It will not be maintained; the tested APK is linked from the release and the upstream project should be used instead. Co-Authored-By: Claude Code <noreply@anthropic.com>
|
Validated this PR on a Samsung Galaxy S23 Ultra (SM-S918B, One UI 9 / Android 17, All tested flows pass:
Build-side note only: on a Windows checkout ( Tested APK (frozen validation fork, not maintained): This was validated only on the SM-S918B above; other Samsung KMIs were not tested. The fix |
Summary
Restore functional
ksudinitialization on Samsung kernels where the KernelSU module can load successfully but userspace cannot reacquire the driver FD or install/data/adb/ksud.Original failure
DFRoot reported that
ksudstarted and the Manager detected KernelSU in jailbreak/LKM mode, but the Superuser list did not load and executedksudinstances could not obtain the[ksu_driver]FD. After driver recovery, installation stopped at:This is the KernelSU-side failure class described in DFRoot discussion #69.
Fixes
u:object_r:ksu_file:s0label attempt. If and only if the active SELinux policy rejects that context withEINVAL, retain the valid context assigned to the newly copied file by the active policy. Empty orunlabeledcontexts fall back tosystem_file; all other labeling errors remain fatal. The final context is read back and logged. Global SELinux remains Enforcing.Verification
cargo ndk -t arm64-v8a checkcargo ndk -t arm64-v8a clippycargo fmt --checkcargo ndk -t arm64-v8a -P 31 build --releaseandroid13-5.15-20260828, includingcheck_symbolgit diff --checkThe reporter confirmed that the resulting build works on a locked Straight Talk Galaxy A15 5G (
SM-S156V, MT6835, Android 16, kernel5.15.189-android13-8-33641424): the Superuser UI loads and authorized Termux root works. Exactsu -c idoutput was not provided, so no command output is quoted here.Scope and caveats
No bootloader unlock, partition flashing, SELinux disablement, or Knox modification is introduced. Compatibility beyond the reported device and any Knox impact remain unverified.
Thanks to the original KernelSU developers and contributors, diabl0w for the Samsung/DFRoot integration, and the developers who documented Samsung SEPF behavior.