Conversation
There was a problem hiding this comment.
Pull request overview
Adds an “ADB Root” feature across kernel/userspace/manager to run adbd with elevated privileges, including an install path for the required preload library and a Manager toggle backed by feature persistence.
Changes:
- Introduces kernel feature
KSU_FEATURE_ADB_ROOTwith anexecvehook that injectsLD_PRELOAD/LD_LIBRARY_PATHforadbd. - Extends
ksud installto optionally installlibadbroot.so, and wires the new feature ID into the ksud feature system. - Adds Manager UI/state/repository plumbing plus a native
libadbroot.sobuild and anadbdrestart on toggle.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| userspace/ksud/src/utils.rs | Extends install to copy libadbroot.so (and updates magiskboot handling). |
| userspace/ksud/src/late_load.rs | Updates install call signature. |
| userspace/ksud/src/feature.rs | Adds AdbRoot feature metadata and CLI parsing/listing. |
| userspace/ksud/src/defs.rs | Adds /data/adb/ksu/lib/ and LIBADBROOT_PATH. |
| userspace/ksud/src/cli.rs | Adds --libadbroot to install command and forwards to utils. |
| uapi/feature.h | Adds KSU_FEATURE_ADB_ROOT = 3. |
| manager/app/src/main/res/values/strings.xml | Adds Settings strings for ADB Root. |
| manager/app/src/main/res/values-zh-rCN/strings.xml | Adds zh-CN summary string for ADB Root. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/viewmodel/SettingsViewModel.kt | Loads/persists ADB Root state and adds toggle handler. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/util/KsuCli.kt | Passes --libadbroot during ksud install from Manager. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/settings/SettingsUiState.kt | Adds UI state + action callback for ADB Root. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/settings/SettingsScreen.kt | Wires UI action to ViewModel. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/settings/SettingsMiuix.kt | Adds ADB Root switch to MIUIX settings UI. |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/settings/SettingsMaterial.kt | Adds ADB Root switch to Material settings UI. |
| manager/app/src/main/java/me/weishu/kernelsu/data/repository/SettingsRepositoryImpl.kt | Implements get/set for ADB Root and restarts adbd. |
| manager/app/src/main/java/me/weishu/kernelsu/data/repository/SettingsRepository.kt | Adds ADB Root APIs to repository interface. |
| manager/app/src/main/cpp/CMakeLists.txt | Builds new shared library adbroot (packaged as libadbroot.so). |
| manager/app/src/main/cpp/adbroot.cc | Implements LD_PRELOAD hooks to influence adbd behavior. |
| kernel/selinux/selinux.h | Exposes escape_to_root_for_adb_root(). |
| kernel/selinux/selinux.c | Adds domain transition helper with exec_sid clearing option. |
| kernel/selinux/rules.c | Grants extra socket permissions to KSU domain. |
| kernel/Kbuild | Adds feature/adb_root.o. |
| kernel/hook/syscall_event_bridge.c | Invokes adb_root execve handler for init-context execve. |
| kernel/feature/adb_root.h | Declares adb_root feature interfaces. |
| kernel/feature/adb_root.c | Implements execve env injection + feature get/set handler. |
| kernel/core/init.c | Initializes and exits adb_root feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 27 out of 27 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This reverts commit ff083f438a6a4777800822c51f0c7c8900e0956e.
Adds a kernel-based adb root implementation. This allows commands such as adb pull/push/shell to be executed with root privileges. It can be enabled or disabled using the `ksud feature set adb_root 1/0` command, or controlled via a switch in the manager. Changing the switch in the manager will automatically restart adbd, while the `ksud feature` command will not. When enabled, adbd will automatically run with root privileges. To drop privileges, it is not recommended to use `adb unroot` , instead, the feature should be disabled. Note: only dynamic-linked adbd (i.e. Android 10+) is supported. AlexLiuDev233: Tested was passed in Redmi Note 12 5G (sunstone 5.4.302) Redmi 6 (cereus 4.9.117) OnePlus ONE E1001 (onyx 3.4.113) [cherry-picked from upstream commit tiann/KernelSU@1835fe3] [cherry-picked from upstream commit tiann/KernelSU@70ca135] [cherry-picked from upstream inprogress pull request tiann/KernelSU#3410] [refer from xxksu's commit backslashxx/KernelSU@b92d617] Co-authored-by: AlexLiuDev233 <wzylin11@outlook.com> Co-authored-by: backslashxx <118538522+backslashxx@users.noreply.github.com> Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com> Signed-off-by: AlexLiuDev233 <wzylin11@outlook.com>
Adds a kernel-based adb root implementation. This allows commands such as adb pull/push/shell to be executed with root privileges. It can be enabled or disabled using the `ksud feature set adb_root 1/0` command, or controlled via a switch in the manager. Changing the switch in the manager will automatically restart adbd, while the `ksud feature` command will not. When enabled, adbd will automatically run with root privileges. To drop privileges, it is not recommended to use `adb unroot` , instead, the feature should be disabled. Note: only dynamic-linked adbd (i.e. Android 10+) is supported. AlexLiuDev233: Tested was passed in Redmi Note 12 5G (sunstone 5.4.302) Redmi 6 (cereus 4.9.117) OnePlus ONE E1001 (onyx 3.4.113) [cherry-picked from upstream commit tiann/KernelSU@1835fe3] [cherry-picked from upstream commit tiann/KernelSU@70ca135] [cherry-picked from upstream inprogress pull request tiann/KernelSU#3410] [refer from xxksu's commit backslashxx/KernelSU@b92d617] Co-authored-by: AlexLiuDev233 <wzylin11@outlook.com> Co-authored-by: backslashxx <118538522+backslashxx@users.noreply.github.com> Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com> Signed-off-by: AlexLiuDev233 <wzylin11@outlook.com>
Adds a kernel-based adb root implementation. This allows commands such as adb pull/push/shell to be executed with root privileges. It can be enabled or disabled using the `ksud feature set adb_root 1/0` command, or controlled via a switch in the manager. Changing the switch in the manager will automatically restart adbd, while the `ksud feature` command will not. When enabled, adbd will automatically run with root privileges. To drop privileges, it is not recommended to use `adb unroot` , instead, the feature should be disabled. Note: only dynamic-linked adbd (i.e. Android 10+) is supported. AlexLiuDev233: Tested was passed in Redmi Note 12 5G (sunstone 5.4.302) Redmi 6 (cereus 4.9.117) OnePlus ONE E1001 (onyx 3.4.113) [cherry-picked from upstream commit tiann/KernelSU@1835fe3] [cherry-picked from upstream commit tiann/KernelSU@70ca135] [cherry-picked from upstream commit tiann/KernelSU@71410cc] [refer from xxksu's commit backslashxx/KernelSU@b92d617] Co-authored-by: AlexLiuDev233 <wzylin11@outlook.com> Co-authored-by: backslashxx <118538522+backslashxx@users.noreply.github.com> Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com> Signed-off-by: AlexLiuDev233 <wzylin11@outlook.com>
Adds a kernel-based adb root implementation. This allows commands such as adb pull/push/shell to be executed with root privileges. It can be enabled or disabled using the `ksud feature set adb_root 1/0` command, or controlled via a switch in the manager. Changing the switch in the manager will automatically restart adbd, while the `ksud feature` command will not. When enabled, adbd will automatically run with root privileges. To drop privileges, it is not recommended to use `adb unroot` , instead, the feature should be disabled. Note: only dynamic-linked adbd (i.e. Android 10+) is supported. AlexLiuDev233: Tested was passed in Redmi Note 12 5G (sunstone 5.4.302) Redmi 6 (cereus 4.9.117) OnePlus ONE E1001 (onyx 3.4.113) [cherry-picked from upstream commit tiann/KernelSU@1835fe3] [cherry-picked from upstream commit tiann/KernelSU@70ca135] [cherry-picked from upstream commit tiann/KernelSU@71410cc] [refer from xxksu's commit backslashxx/KernelSU@b92d617] Co-authored-by: AlexLiuDev233 <wzylin11@outlook.com> Co-authored-by: backslashxx <118538522+backslashxx@users.noreply.github.com> Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com> Signed-off-by: AlexLiuDev233 <wzylin11@outlook.com>
Adds a kernel-based adb root implementation. This allows commands such as adb pull/push/shell to be executed with root privileges. It can be enabled or disabled using the `ksud feature set adb_root 1/0` command, or controlled via a switch in the manager. Changing the switch in the manager will automatically restart adbd, while the `ksud feature` command will not. When enabled, adbd will automatically run with root privileges. To drop privileges, it is not recommended to use `adb unroot` , instead, the feature should be disabled. Note: only dynamic-linked adbd (i.e. Android 10+) is supported. AlexLiuDev233: Tested was passed in Redmi Note 12 5G (sunstone 5.4.302) Redmi 6 (cereus 4.9.117) OnePlus ONE E1001 (onyx 3.4.113) [cherry-picked from upstream commit tiann/KernelSU@1835fe3] [cherry-picked from upstream commit tiann/KernelSU@70ca135] [cherry-picked from upstream commit tiann/KernelSU@71410cc] [refer from xxksu's commit backslashxx/KernelSU@b92d617] Co-authored-by: AlexLiuDev233 <wzylin11@outlook.com> Co-authored-by: backslashxx <118538522+backslashxx@users.noreply.github.com> Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com> Signed-off-by: AlexLiuDev233 <wzylin11@outlook.com>
81b42954dadda kernel: Replace GFP_ATOMIC flags in throne tracker 6d47cf8db9265 kernel: Fix OOB read caused by missing null terminator (tiann/KernelSU#3413) ae631ffbc1e8e kernel: implement ksu_toolkit support c9272c57bd644 manager: adb_root: load our ksurc if possible 42418d3ab6419 kernel: infra: shim is_compat_syscall 12b523147a356 manager: don't play animation when SwipeToDismissBox reset 11e5ca6008e5c manager: make Snackbar don't share across every page, make Snackbar can be dismieed by swipe 71c618a4618b3 manager: stop show hook type when manager is not valid, stop show hook type in susfs version c6b6bf5f74aa0 manager: bump minimal supported kernel version to 34795 79fc35b913e4f manager: use Icons.Filled.Adb for adb root feature icon ea35b7172b985 manager: cleanup 2ee60a980d4d2 manager: disable adb root switch widget when kernel not support this feature 34e60f2270f45 ksud: fix late_load's type error 5a89f36776e4f userspace: improve module loading and ksud CLI (tiann/KernelSU#3406) a53b0d29a97e0 manager: throw out these comment garbage 291e691a820ea ksud: fix late-load mode can't reopen manager after EoP 315143cd9bd3d kernel: Fix building sulog on kernel 6.1 & x86_64 (tiann/KernelSU#3401) 32347a008d812 manager: show seccomp status on Home screen (tiann/KernelSU#3372) 4a216d78b5400 syscall_hook: Fix building on kernel 6.6 and below (tiann/KernelSU#3383) ea6d38c114359 kernel: remove asm/memory.h include in adb_root.c 759d6545dc0a5 kernel: Don't advertise webview zygote in umount list (tiann/KernelSU#3389) 0403aa98bc803 kernel, ksud, manager: adb root (tiann/KernelSU#3382) 1007dda3d1351 manager: fix webui ime insets a1411e960f93a fix: add CORS header to ksu://icon/ responses to allow programmatic image loading (#3402) fdc27ed136221 ksud: add manager package name option to some commands b290252f80b62 kernel: add sulog for ioctl grant root fc9a2372609f6 kernel: fix build for armv7l, 4.9+ kernel e75005fde4765 manager: add sulog screen 70dc59494f1ca ksud: format 422374fe1669b kernel: mark more functions as init/exit functions (tiann/KernelSU#3380) 935335d05ad19 ksud: remove ksud before update it d9caa2397afa6 ksud: minor refactor (tiann/KernelSU#3377) 5d17fb2c07a05 kernel, ksud: add sulog (tiann/KernelSU#3360) a86fc8478d0ea kernel, ksud, manager: nuke old sulog impl from sukisu b2f18ec6e0f71 manager: sync translation from Crowdin (#134) d63ebb67dfef9 build(deps): bump libc from 0.2.183 to 0.2.184 in /userspace/ksuinit in the crates group (#138) 21754e820d22a build(deps): bump the crates group in /userspace/ksud with 12 updates (#139) f587a254963e5 ksubot: add a delay ec058e15d33eb crowdin: enable skip_identical_translations 5d6925650b9f8 ksud: add `feature get --config` f035650d8c0d8 kernel: fix manual hook check 815fe09cf26b5 ksud: Open susfs subcommand for non-arm64-v8a devices 5bee234587f15 ksud: add --kmi for ksud late-load e85512f299ccd ksud: Change uid references to appid (tiann/KernelSU#3388) 4f40e44797a16 ksud: fix daemonize 086e2caba42ce [skip ci]ci: clean up unused scripts fcac5f7736859 Kernel: minify Kbuild (#129) afdf237da8dd9 build(deps): bump the crates group in /userspace/ksud with 12 updates (#133) 1ed0b9cc9ebc2 kernel: fix multi manager not working with ddk git-subtree-dir: drivers/sukisu git-subtree-split: 81b42954daddaabe227c76936c736a4661772b68
81b42954dadd kernel: Replace GFP_ATOMIC flags in throne tracker 6d47cf8db926 kernel: Fix OOB read caused by missing null terminator (tiann/KernelSU#3413) ae631ffbc1e8 kernel: implement ksu_toolkit support c9272c57bd64 manager: adb_root: load our ksurc if possible 42418d3ab641 kernel: infra: shim is_compat_syscall 12b523147a35 manager: don't play animation when SwipeToDismissBox reset 11e5ca6008e5 manager: make Snackbar don't share across every page, make Snackbar can be dismieed by swipe 71c618a4618b manager: stop show hook type when manager is not valid, stop show hook type in susfs version c6b6bf5f74aa manager: bump minimal supported kernel version to 34795 79fc35b913e4 manager: use Icons.Filled.Adb for adb root feature icon ea35b7172b98 manager: cleanup 2ee60a980d4d manager: disable adb root switch widget when kernel not support this feature 34e60f2270f4 ksud: fix late_load's type error 5a89f36776e4 userspace: improve module loading and ksud CLI (tiann/KernelSU#3406) a53b0d29a97e manager: throw out these comment garbage 291e691a820e ksud: fix late-load mode can't reopen manager after EoP 315143cd9bd3 kernel: Fix building sulog on kernel 6.1 & x86_64 (tiann/KernelSU#3401) 32347a008d81 manager: show seccomp status on Home screen (tiann/KernelSU#3372) 4a216d78b540 syscall_hook: Fix building on kernel 6.6 and below (tiann/KernelSU#3383) ea6d38c11435 kernel: remove asm/memory.h include in adb_root.c 759d6545dc0a kernel: Don't advertise webview zygote in umount list (tiann/KernelSU#3389) 0403aa98bc80 kernel, ksud, manager: adb root (tiann/KernelSU#3382) 1007dda3d135 manager: fix webui ime insets a1411e960f93 fix: add CORS header to ksu://icon/ responses to allow programmatic image loading (#3402) fdc27ed13622 ksud: add manager package name option to some commands b290252f80b6 kernel: add sulog for ioctl grant root fc9a2372609f kernel: fix build for armv7l, 4.9+ kernel e75005fde476 manager: add sulog screen 70dc59494f1c ksud: format 422374fe1669 kernel: mark more functions as init/exit functions (tiann/KernelSU#3380) 935335d05ad1 ksud: remove ksud before update it d9caa2397afa ksud: minor refactor (tiann/KernelSU#3377) 5d17fb2c07a0 kernel, ksud: add sulog (tiann/KernelSU#3360) a86fc8478d0e kernel, ksud, manager: nuke old sulog impl from sukisu b2f18ec6e0f7 manager: sync translation from Crowdin (#134) d63ebb67dfef build(deps): bump libc from 0.2.183 to 0.2.184 in /userspace/ksuinit in the crates group (#138) 21754e820d22 build(deps): bump the crates group in /userspace/ksud with 12 updates (#139) f587a254963e ksubot: add a delay ec058e15d33e crowdin: enable skip_identical_translations 5d6925650b9f ksud: add `feature get --config` f035650d8c0d kernel: fix manual hook check 815fe09cf26b ksud: Open susfs subcommand for non-arm64-v8a devices 5bee234587f1 ksud: add --kmi for ksud late-load e85512f299cc ksud: Change uid references to appid (tiann/KernelSU#3388) 4f40e44797a1 ksud: fix daemonize 086e2caba42c [skip ci]ci: clean up unused scripts fcac5f773685 Kernel: minify Kbuild (#129) afdf237da8dd build(deps): bump the crates group in /userspace/ksud with 12 updates (#133) 1ed0b9cc9ebc kernel: fix multi manager not working with ddk git-subtree-dir: drivers/sukisu git-subtree-split: 81b42954daddaabe227c76936c736a4661772b68
81b42954dadd kernel: Replace GFP_ATOMIC flags in throne tracker 6d47cf8db926 kernel: Fix OOB read caused by missing null terminator (tiann/KernelSU#3413) ae631ffbc1e8 kernel: implement ksu_toolkit support c9272c57bd64 manager: adb_root: load our ksurc if possible 42418d3ab641 kernel: infra: shim is_compat_syscall 12b523147a35 manager: don't play animation when SwipeToDismissBox reset 11e5ca6008e5 manager: make Snackbar don't share across every page, make Snackbar can be dismieed by swipe 71c618a4618b manager: stop show hook type when manager is not valid, stop show hook type in susfs version c6b6bf5f74aa manager: bump minimal supported kernel version to 34795 79fc35b913e4 manager: use Icons.Filled.Adb for adb root feature icon ea35b7172b98 manager: cleanup 2ee60a980d4d manager: disable adb root switch widget when kernel not support this feature 34e60f2270f4 ksud: fix late_load's type error 5a89f36776e4 userspace: improve module loading and ksud CLI (tiann/KernelSU#3406) a53b0d29a97e manager: throw out these comment garbage 291e691a820e ksud: fix late-load mode can't reopen manager after EoP 315143cd9bd3 kernel: Fix building sulog on kernel 6.1 & x86_64 (tiann/KernelSU#3401) 32347a008d81 manager: show seccomp status on Home screen (tiann/KernelSU#3372) 4a216d78b540 syscall_hook: Fix building on kernel 6.6 and below (tiann/KernelSU#3383) ea6d38c11435 kernel: remove asm/memory.h include in adb_root.c 759d6545dc0a kernel: Don't advertise webview zygote in umount list (tiann/KernelSU#3389) 0403aa98bc80 kernel, ksud, manager: adb root (tiann/KernelSU#3382) 1007dda3d135 manager: fix webui ime insets a1411e960f93 fix: add CORS header to ksu://icon/ responses to allow programmatic image loading (#3402) fdc27ed13622 ksud: add manager package name option to some commands b290252f80b6 kernel: add sulog for ioctl grant root fc9a2372609f kernel: fix build for armv7l, 4.9+ kernel e75005fde476 manager: add sulog screen 70dc59494f1c ksud: format 422374fe1669 kernel: mark more functions as init/exit functions (tiann/KernelSU#3380) 935335d05ad1 ksud: remove ksud before update it d9caa2397afa ksud: minor refactor (tiann/KernelSU#3377) 5d17fb2c07a0 kernel, ksud: add sulog (tiann/KernelSU#3360) a86fc8478d0e kernel, ksud, manager: nuke old sulog impl from sukisu b2f18ec6e0f7 manager: sync translation from Crowdin (#134) d63ebb67dfef build(deps): bump libc from 0.2.183 to 0.2.184 in /userspace/ksuinit in the crates group (#138) 21754e820d22 build(deps): bump the crates group in /userspace/ksud with 12 updates (#139) f587a254963e ksubot: add a delay ec058e15d33e crowdin: enable skip_identical_translations 5d6925650b9f ksud: add `feature get --config` f035650d8c0d kernel: fix manual hook check 815fe09cf26b ksud: Open susfs subcommand for non-arm64-v8a devices 5bee234587f1 ksud: add --kmi for ksud late-load e85512f299cc ksud: Change uid references to appid (tiann/KernelSU#3388) 4f40e44797a1 ksud: fix daemonize 086e2caba42c [skip ci]ci: clean up unused scripts fcac5f773685 Kernel: minify Kbuild (#129) afdf237da8dd build(deps): bump the crates group in /userspace/ksud with 12 updates (#133) 1ed0b9cc9ebc kernel: fix multi manager not working with ddk git-subtree-dir: drivers/sukisu git-subtree-split: 81b42954daddaabe227c76936c736a4661772b68
Adds a kernel-based adb root implementation. This allows commands such as adb pull/push/shell to be executed with root privileges. It can be enabled or disabled using the `ksud feature set adb_root 1/0` command, or controlled via a switch in the manager. Changing the switch in the manager will automatically restart adbd, while the `ksud feature` command will not. When enabled, adbd will automatically run with root privileges. To drop privileges, it is not recommended to use `adb unroot` , instead, the feature should be disabled. Note: only dynamic-linked adbd (i.e. Android 10+) is supported. Co-authored-by: backslashxx <118538522+backslashxx@users.noreply.github.com> Signed-off-by: ris <rissu.ntk@gmail.com>
Adds a kernel-based adb root implementation. This allows commands such as adb pull/push/shell to be executed with root privileges. It can be enabled or disabled using the `ksud feature set adb_root 1/0` command, or controlled via a switch in the manager. Changing the switch in the manager will automatically restart adbd, while the `ksud feature` command will not. When enabled, adbd will automatically run with root privileges. To drop privileges, it is not recommended to use `adb unroot` , instead, the feature should be disabled. Note: only dynamic-linked adbd (i.e. Android 10+) is supported. Co-authored-by: backslashxx <118538522+backslashxx@users.noreply.github.com> Signed-off-by: ris <rissu.ntk@gmail.com>
Adds a kernel-based adb root implementation. This allows commands such
as adb pull/push/shell to be executed with root privileges. It can be
enabled or disabled using the `ksud feature set adb_root 1/0` command,
or controlled via a switch in the manager. Changing the switch in the
manager will automatically restart adbd, while the `ksud feature`
command will not. When enabled, adbd will automatically run with root
privileges. To drop privileges, it is not recommended to use `adb
unroot` , instead, the feature should be disabled.
Note: only dynamic-linked adbd (i.e. Android 10+) is supported.
-declare ret ('feat(kernel ksud): add sulog (#3360)' (fb7b666))
Adds a kernel-based adb root implementation. This allows commands such
as adb pull/push/shell to be executed with root privileges. It can be
enabled or disabled using the `ksud feature set adb_root 1/0` command,
or controlled via a switch in the manager. Changing the switch in the
manager will automatically restart adbd, while the `ksud feature`
command will not. When enabled, adbd will automatically run with root
privileges. To drop privileges, it is not recommended to use `adb
unroot` , instead, the feature should be disabled.
Note: only dynamic-linked adbd (i.e. Android 10+) is supported.
-declare ret ('feat(kernel ksud): add sulog (#3360)' (fb7b666))
Adds a kernel-based adb root implementation. This allows commands such
as adb pull/push/shell to be executed with root privileges. It can be
enabled or disabled using the `ksud feature set adb_root 1/0` command,
or controlled via a switch in the manager. Changing the switch in the
manager will automatically restart adbd, while the `ksud feature`
command will not. When enabled, adbd will automatically run with root
privileges. To drop privileges, it is not recommended to use `adb
unroot` , instead, the feature should be disabled.
Note: only dynamic-linked adbd (i.e. Android 10+) is supported.
-declare ret ('feat(kernel ksud): add sulog (#3360)' (fb7b666))
Adds a kernel-based adb root implementation. This allows commands such
as adb pull/push/shell to be executed with root privileges. It can be
enabled or disabled using the `ksud feature set adb_root 1/0` command,
or controlled via a switch in the manager. Changing the switch in the
manager will automatically restart adbd, while the `ksud feature`
command will not. When enabled, adbd will automatically run with root
privileges. To drop privileges, it is not recommended to use `adb
unroot` , instead, the feature should be disabled.
Note: only dynamic-linked adbd (i.e. Android 10+) is supported.
-declare ret ('feat(kernel ksud): add sulog (#3360)' (fb7b666))
Align YukiSU kernel directory structure with upstream tiann/KernelSU layout (core/ feature/ hook/ include/ infra/ manager/ policy/ runtime/ sulog/ supercall/), and create unified uapi/ headers as the single source of truth for kernel-userspace ABI. === Directory Restructuring === - Split flat kernel/ into modular subdirectories matching upstream - Extract uapi/ headers (app_profile, feature, ksu, selinux, sulog, supercall) with dual kernel/userspace compatibility - Move ksud boot events into runtime/boot_event.c with ksud_boot.h - Split supercalls.c into dispatch.c + perm.c + supercall.c + internal.h - Split sulog into event.c + fd.c under sulog/ - Extract syscall event bridge from syscall_hook_manager into hook/syscall_event_bridge.c/h - Add infra/su_mount_ns.c/h for per-app mount namespace setup - Split manager.h into manager_identity.h + manager_observer.h === Upstream Features & Fixes Incorporated === SELinux Hide (tiann/KernelSU#3457, #3459, #3495): 0efe3cf0 feature: selinux hide 3f388ef1 selinux_hide: fix attr/current detection 33dcf82d selinux_hide: hide status ADB Root (tiann/KernelSU#3382, #3391): 1835fe32 feature: adb root 70ca1353 kernel: fix path check in adb root SuLog (tiann/KernelSU#3360, #3364, #3401): fb7b6668 feat(kernel ksud): add sulog d13bac52 kernel: sulog: fix return value a5c357e6 kernel: Fix building sulog on kernel 6.1 & x86_64 LSM Hook Framework: 3e271ac4 kernel: add lsm hook framework c963aa71 kernel: fix lsm hook Syscall Table Hook (TSR): 225ffbbf kernel: use syscall table hook to avoid atomic context 5f9cada6 kernel: handle ksud execve by syscall_hook_manager Symbol Resolver Chain (#3461, #3469, #3475): 6f609368 kernel: common symbol resolve tool 1e7bc48c kernel: Resolve dotted CFI symbol variants da8e0ab1 kernel: refine symbol_resolver 96a72dd0 kernel: symbol_resolver: resolve suffix starts with "$" b11be252 kernel: Prefer hashed .cfi_jt variants before bare symbols Policydb / AVTab (#3350, #3352, #3439): f9c7823e kernel: simpler implementation of copying policydb e7b6bf08 kernel: fix copy avtab cc83433b kernel: prune redundant avtab nodes after deny rules Allowlist (#3418, #3093): 12304099 kernel: refactor allowlist 6948a44d kernel: Fix OOB read caused by missing null terminator 71410ccd kernel: don not call path_put when kern_path failed App Profile v3 Migration (#3363): 18754602 kernel: bump app profile version, migrate selinux domain Late-Load / Init.rc Injection (#3478, #3498): 9ab31068 kernel,ksud: support module-provided init.rc injection 64fb0888 kernel: Improve late load mode sequence calculation Safe Exit / Module Lifecycle (#3317): 3054cc0b feat: safe exit 2ddeed9c kernel: allow exit 08378e55 kernel: mark more functions as init/exit functions Cred / RLIMIT Fixes (#3286, #3338): 218502a0 kernel: Fix RLIMIT_NPROC leak on root escape 68143c96 kernel: remove usage of get_current_cred 15790ccb kernel_umount: fixup printout and avoid UAF Misc Fixes: 8c108e1b kernel: allow disable manager or policy a92f8c75 supercall: perform free_pid() for kernel 6.15+ 8bc28033 feat: support switch to init_group (SET_INIT_PGRP) d21c4436 kernel: Replace GFP_ATOMIC in throne tracker 279c7501 kernel: sepolicy: use GFP_KERNEL 40e8fb76 Bring back x86_64 support 73fc1003 kernel: fix compile for x86-64 v6.13 1625043f kernel: Fix absolute src handling in Kbuild e04f12ec kernel: Fix extmod config propagation 95a31f28 fix: GKI kernel build 9ae97f97 syscall_hook: Fix building on kernel 6.6 and below f3b4d783 Update KSU config to require EXT4_FS UAPI / Layout: 91d0848f kernel: reorganize source layout bd1b00cc kernel: unified uapi header fefa61d5 kernel: move selinux context to ksu 25c92eb9 refact: top level cargo workspace, fix uapi 17367e37 kernel: use parallel build 1576cc33 kernel: selinux: minify rules === YukiSU-Specific Additions === - SuperKey authentication (prctl + reboot kprobe) — YukiSU core feature - KERNEL_SU_DOMAIN defaults to "su" (u:r:su:s0), not upstream "ksu" - Single release signature via manager_sign.h - CONFIG_KSU_SUPERKEY / CONFIG_KSU_DISABLE_MANAGER Kconfig options - Enhanced security feature at ID 100 - app_profile v2→v3 domain migration: ksu→su - CONFIG_KSU_MANUAL_SU removed (legacy SukiSU old-branch feature) - CONFIG_KSU_SUSFS removed (YukiSU does not support SUSFS) - YukiSU version string in Kbuild (GitHub API + local git fallback) - YukiSU-specific ioctls: GET_MANAGER_UID (201), LIST_TRY_UMOUNT (200) - Batch sepolicy ABI (data_len/data payload replacing cmd/arg struct) - Samsung KDP / SELinux porting detection in Kbuild - Backport compatibility macros (KSU_OPTIONAL_*, KSU_COMPAT_HAS_*) Co-authored-by: weishu <twsxtd@gmail.com> Co-authored-by: Ylarod <me@ylarod.cn> Co-authored-by: 5ec1cff <ewtqyqyewtqyqy@gmail.com> Co-authored-by: Wang Han <416810799@qq.com> Co-authored-by: backslashxx <118538522+backslashxx@users.noreply.github.com> Co-authored-by: YuKongA <70465933+YuKongA@users.noreply.github.com> Co-authored-by: Shadichy <60534636+shadichy@users.noreply.github.com> Co-authored-by: u9521 <63995396+u9521@users.noreply.github.com> Co-authored-by: libingxuan <84086386+aaaaaaaa-815@users.noreply.github.com> Co-authored-by: Huy Minh <39849246+hmtheboy154@users.noreply.github.com> Co-authored-by: Kamenta <st2011_230635@qq.com> Co-authored-by: AlexLiuDev233 <wzylin11@outlook.com> Co-authored-by: 小潼 <110387028+XiaoTong6666@users.noreply.github.com> Co-authored-by: Mohammed Riad <1@mhmrdd.me>
Adds a kernel-based adb root implementation. This allows commands such as adb pull/push/shell to be executed with root privileges. It can be enabled or disabled using the
ksud feature set adb_root 1/0command, or controlled via a switch in the manager. Changing the switch in the manager will automatically restart adbd, while theksud featurecommand will not. When enabled, adbd will automatically run with root privileges. To drop privileges, it is not recommended to useadb unroot, instead, the feature should be disabled.Note: only dynamic-linked adbd (i.e. Android 10+) is supported.