Skip to content

refactor(kernel): Perform umount for webview zygote - #3630

Merged
aviraxp merged 2 commits into
mainfrom
umount
Aug 25, 2026
Merged

aviraxp merged 2 commits into
mainfrom
umount

Conversation

@aviraxp

@aviraxp aviraxp commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

This was deliberately not done because app cannot run custom code from isolated processes forked from webview zygote. However, hidepid=2 is broken for android again.

In 2020, Jann Horn discovered that when zygote forks and specializes to app zygote, process groups are not cleaned. This makes app zygote and its child have AID_READPROC and bypass hidepid=2. This was marked as CVE-2020-0257 and fixed in 2020-08-01.

However, it is ignored that isolated process can get directly forked from zygote while no app zygote fork is needed. So isolated_app context process still may have AID_READPROC, which provides a way to bypass the hidepid=2 restrictions on /proc.

The impact is limited by SELinux because isolated_app does not have mlstrustedsubject. But it can still read cmdline, comm, maps, mountinfo etc of other isolated processes, mainly webview sandboxed processes.

Bangcle, a famous commercial app protection service in China, started to make use of this recently. An isolated process is forked and iterates through all pids, trying to open their mountinfo.

This is no doubt an exploit (almost same with CVE-2020-0257) and we have already reported it to Google. Before Google fixes it, we have no way but unmount anything for webview zygote. This is expected to break some font modules aimed at webview, but we have no choice.

@aviraxp
aviraxp marked this pull request as draft August 11, 2026 15:13
This was deliberately not done because app cannot run custom code from
isolated processes forked from webview zygote. However, hidepid=2 is
broken for android again.

In 2020, Jann Horn discovered that when zygote forks and specializes to
app zygote, process groups are not cleaned. This makes app zygote and
its child have AID_READPROC and bypass hidepid=2. This was marked as
CVE-2020-0257 and fixed in 2020-08-01.

However, it is ignored that isolated process can get directly forked
from zygote while no app zygote fork is needed. So isolated_app context
process still may have AID_READPROC, which provides a way to bypass the
hidepid=2 restrictions on /proc.

The impact is limited by SELinux because isolated_app does not have
mlstrustedsubject. But it can still read cmdline, comm, maps, mountinfo
etc of other isolated processes, mainly webview sandboxed processes.

Bangcle, a famous commercial app protection service in China, started to
make use of this recently. An isolated process is forked and iterates
through all pids, trying to open their mountinfo.

This is no doubt an exploit (almost same with CVE-2020-0257) and we have
already reported it to Google. Before Google fixes it, we have no way
but unmount anything for webview zygote. This is expected to break some
font modules aimed at webview, but we have no choice.
@aviraxp

aviraxp commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

Open for discussion. I cannot think of a better idea.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a new kernel/userspace/Manager feature flag to unmount module mount points from the WebView zygote (and thereby prevent mountinfo leaks to isolated WebView sandbox processes), addressing a hidepid=2 bypass scenario described in the PR.

Changes:

  • Add KSU_FEATURE_WEBVIEW_ZYGOTE_UMOUNT (ID=5) to the shared UAPI and wire it through ksud feature config/CLI.
  • Expose a new toggle in the Android Manager (UI + repository + JNI bridge) for enabling/disabling the feature.
  • Update kernel umount policy to optionally umount for WEBVIEW_ZYGOTE_UID based on the new feature.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
userspace/ksud/src/feature.rs Adds new FeatureId mapping/name/description and includes it in list/save paths.
userspace/ksud/src/cli.rs Updates CLI help text to include webview_zygote_umount.
uapi/feature.h Adds KSU_FEATURE_WEBVIEW_ZYGOTE_UMOUNT = 5 to the feature ID enum.
manager/app/src/main/res/values/strings.xml Adds English UI strings for the new WebView zygote umount setting.
manager/app/src/main/res/values-zh-rCN/strings.xml Adds Simplified Chinese UI strings for the new setting.
manager/app/src/main/java/me/weishu/kernelsu/ui/viewmodel/SettingsViewModel.kt Loads and toggles the new feature in settings state.
manager/app/src/main/java/me/weishu/kernelsu/ui/screen/settings/SettingsUiState.kt Adds UI state fields + action callback for the new setting.
manager/app/src/main/java/me/weishu/kernelsu/ui/screen/settings/SettingsScreen.kt Wires the new action from screen to ViewModel.
manager/app/src/main/java/me/weishu/kernelsu/ui/screen/settings/SettingsMiuix.kt Adds a switch preference for the new feature in MIUIX UI.
manager/app/src/main/java/me/weishu/kernelsu/ui/screen/settings/SettingsMaterial.kt Adds a segmented switch item for the new feature in Material UI.
manager/app/src/main/java/me/weishu/kernelsu/Natives.kt Adds JNI-backed native methods for getting/setting the new feature.
manager/app/src/main/java/me/weishu/kernelsu/data/repository/SettingsRepositoryImpl.kt Implements status/get/set plumbing for the new feature.
manager/app/src/main/java/me/weishu/kernelsu/data/repository/SettingsRepository.kt Extends repository interface with the new feature APIs.
manager/app/src/main/cpp/ksu.h Declares new C++ bridge functions for the feature.
manager/app/src/main/cpp/ksu.cc Implements get/set via get_feature/set_feature for the new feature ID.
manager/app/src/main/cpp/jni.cc Exposes the new native methods to Kotlin via JNI.
kernel/policy/allowlist.c Switches WEBVIEW_ZYGOTE_UID umount decision to be feature-controlled.
kernel/feature/kernel_umount.h Declares ksu_is_webview_zygote_umount_enabled().
kernel/feature/kernel_umount.c Adds the new feature handler, state, and enables umount handling for the WebView zygote UID.
Suppressed comments (1)

kernel/feature/kernel_umount.c:122

  • ksu_handle_umount() reads ksu_kernel_umount_enabled without READ_ONCE(), but the flag can be updated concurrently via the feature set handler. This can trigger KCSAN data-race reports; use READ_ONCE() here as well.
    // 4. Webview zygote forked from zygote: zygote -> webview_zygote (controlled by feature policy)
    // 5. Isolated process forked from app zygote: appuid -> isolated_process (already handled by 3)
    // 6. Isolated process forked from webview zygote (already handled by 4)
    if (!is_appuid(new_uid) && new_uid != WEBVIEW_ZYGOTE_UID && !is_isolated_process(new_uid)) {
        return 0;

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread kernel/feature/kernel_umount.c Outdated
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 11, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 11, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 11, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 11, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 11, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 11, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 11, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 11, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 11, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 12, 2026
debiansid pushed a commit to yapixel/KernelSU that referenced this pull request Aug 12, 2026
@aviraxp
aviraxp marked this pull request as ready for review August 12, 2026 08:16
debiansid pushed a commit to yapixel/KernelSU that referenced this pull request Aug 13, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 13, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 13, 2026
debiansid pushed a commit to yapixel/KernelSU that referenced this pull request Aug 13, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 14, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 14, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 14, 2026
debiansid pushed a commit to yapixel/KernelSU that referenced this pull request Aug 17, 2026
$ git log --pretty=%s upstream/main..HEAD --reverse
	manager: keep api 29 support
	manager: QOL
	manager: restore api 26 support
	manager: fix search bar focus bug on Android 8
	manager: Adjust for Android v7.1 support (backslashxx#31)
	manager: fixup updates
	workflows: debloat
	dummy.keystore
	ksud: add armeabi-v7a support
	workflows: scripts: workaround armv7/a triple mismatch
	kernel:
	kernel: prepare for legacy support
	kernel: uapi: fix portability
	kernel: build: migrate to unity build
	kernel: external: import oss libraries
	kernel: downstream: provide common helpers
	kernel: app_profile: add 32-bit KSU_NO_NEW_PRIVS tif support
	kernel: init lsm_hook infrastructure
	kernel: lsm_hook: introduce selinux_ops LSM tampering for < 4.2
	kernel: lsm_hook: introduce ARM64 branch patching for 6.8+
	kernel: pkg_observer: initialize for downstream
	kernel: setuid_hook: disable seccomp for manager and allowed uids
	kernel: app_profile: adapt disable_seccomp to legacy
	kernel: selinux/sepolicy: handle selinux policydb backports
	kernel: selinux/sepolicy: abstract avtab slot access for compat
	kernel: selinux/rules: backport handle_sepolicy to legacy policydb
	kernel: selinux/rules: Pin task to current CPU to avoid cross-CPU rwlock release
	kernel: supercall: provide sys_reboot handler
	kernel: supercalls: tweak sys_reboot fd install
	kernel: adapt "namespace support" feature to old kernels
	kernel: allowlist: always allow shell for su on CONFIG_KSU_DEBUG
	kernel: file_wrapper: handle anon_inode_getfile for old kernels
	kernel: supercalls: partial backport of do_manage_mark
	kernel: compat: screw path_umount backport, call sys_umount directly
	kernel: app_profile: shim escape_with_root_profile
	kernel: throne_tracker: fixup deadlocks on iterate_dir
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: allowlist: escape allowlist handling to kthread
	kernel: ksud/lsm_hook: migrate ksu_install_rc_hook to security_file_permission LSM
	kernel: ksud: read: add fallback to /init.rc
	kernel: ksud: handle newfstat init_rc size injection
	kernel: ksud: handle early newfstat module_rc size injection
	kernel: ksud: wire up jump_label on vfs_read controlled hooks
	kernel: ksud: read: move second stage apply on read hook
	kernel: ksud: read: grab init_session_keyring on read hook
	kernel: ksud: replace input hook with an input handler
	kernel: sucompat: squash reworked sucompat changes
	kernel: lsm_hook: bprm: escape init ksud call to root for 3.x
	kernel: lsm_hook: bprm: escape init ksud call to root for < 4.14
	kernel: ksud: spit a kthread as unhook watchdog
	kernel: file_wrapper: handle more compat
	kernel: file_wrapper: handle readdir and iterate compat for UL
	kernel: syscall_table_hook: introduce syscall table tampering
	kernel: sucompat: wire up sys_call_table unhooking
	kernel: sucompat: wire up jump label for sucompat unhooking
	kernel: kp_ksud: restore kprobes for early-boot and used-once hooks
	kernel: branch_link_hook: introduce arm64 branch link callsite hijacking
	kernel: feature: sulog: adjust for downstream
	kernel: feature: adbroot: adjust for downstream
	kernel: feature: wire up a smaller selinux_hide implementation
	kernel: lsm_hook: wire up setprocattr lsm hack for selinux_hide
	kernel: supercalls: expose ksu_set_manager_appid to sys_reboot
	kernel: supercalls: allow userspace to pull list entries (tiann#3040)
	kernel: tiny_sulog: basic ringbuffer, timestamped su log
	kernel: supercalls: expose ksuver override
	kernel: supercalls: expose spoof uname function to userspace
	kernel: supercalls: expose ksuflags override
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle conditional read_iter requirement for < 3.16
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: sucompat: bruteforce writeable stack from start_stack for < 3.8
	kernel: compat: no ext4_unregister_sysfs, no problem
	kernel: compat: provide proper strscpy/_pad routines
	kernel: compat: d_is_reg to S_ISREG
	kernel: compat: handle alloc_uid for < 3.5
	kernel: compat: iterate_dir -> vfs_readdir compat for < 3.11
	kernel: compat: provide bin2hex compat for < 3.18
	kernel: compat: file_inode compat for < 3.9
	kernel: compat: provide selinux_inode/selinux_cred wrappers for < 5.1
	kernel: compat: no-op groups_sort if unavailable
	kernel: compat: define U16_MAX if absent
	kernel: compat: fix sulog/adbroot compile for legacy
	kernel: compat: inline newer kernel_read / kernel_write for < 4.14
	kernel: apk_sign, throne_tracker: heap-ify search_manager/check_block
	kernel: compat: handle UL compat for refactored allowlist
	kernel: apk_sign: add more size/hash pairs
	HACK: kernel: bypass tf out of uid_t/gid_t strict type checks
	kernel: build: sucompat: inline fns on non-manual hook methods
	kernel: build: restore LKM support
	kernel: ksu: printout quirks / backports / etc on init
	workflows: restore ksuinit+lkm workflow
	ksuinit: use mount api
	Reapply: "refactor(kernel): Perform umount for webview zygote (tiann#3630)"
	KernelSU v3.2.5+

Commits on top of upstream: 95

Warning: Managers built from this repo has a known keystore.
See dummy.keystore.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 17, 2026
$ git log --pretty=%s upstream/main..HEAD --reverse
	manager: keep api 29 support
	manager: QOL
	manager: restore api 26 support
	manager: fix search bar focus bug on Android 8
	manager: Adjust for Android v7.1 support (#31)
	manager: fixup updates
	workflows: debloat
	dummy.keystore
	ksud: add armeabi-v7a support
	workflows: scripts: workaround armv7/a triple mismatch
	kernel:
	kernel: prepare for legacy support
	kernel: uapi: fix portability
	kernel: build: migrate to unity build
	kernel: external: import oss libraries
	kernel: downstream: provide common helpers
	kernel: app_profile: add 32-bit KSU_NO_NEW_PRIVS tif support
	kernel: init lsm_hook infrastructure
	kernel: lsm_hook: introduce selinux_ops LSM tampering for < 4.2
	kernel: lsm_hook: introduce ARM64 branch patching for 6.8+
	kernel: pkg_observer: initialize for downstream
	kernel: setuid_hook: disable seccomp for manager and allowed uids
	kernel: app_profile: adapt disable_seccomp to legacy
	kernel: selinux/sepolicy: handle selinux policydb backports
	kernel: selinux/sepolicy: abstract avtab slot access for compat
	kernel: selinux/rules: backport handle_sepolicy to legacy policydb
	kernel: selinux/rules: Pin task to current CPU to avoid cross-CPU rwlock release
	kernel: supercall: provide sys_reboot handler
	kernel: supercalls: tweak sys_reboot fd install
	kernel: adapt "namespace support" feature to old kernels
	kernel: allowlist: always allow shell for su on CONFIG_KSU_DEBUG
	kernel: file_wrapper: handle anon_inode_getfile for old kernels
	kernel: supercalls: partial backport of do_manage_mark
	kernel: compat: screw path_umount backport, call sys_umount directly
	kernel: app_profile: shim escape_with_root_profile
	kernel: throne_tracker: fixup deadlocks on iterate_dir
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: allowlist: escape allowlist handling to kthread
	kernel: ksud/lsm_hook: migrate ksu_install_rc_hook to security_file_permission LSM
	kernel: ksud: read: add fallback to /init.rc
	kernel: ksud: handle newfstat init_rc size injection
	kernel: ksud: handle early newfstat module_rc size injection
	kernel: ksud: wire up jump_label on vfs_read controlled hooks
	kernel: ksud: read: move second stage apply on read hook
	kernel: ksud: read: grab init_session_keyring on read hook
	kernel: ksud: replace input hook with an input handler
	kernel: sucompat: squash reworked sucompat changes
	kernel: lsm_hook: bprm: escape init ksud call to root for 3.x
	kernel: lsm_hook: bprm: escape init ksud call to root for < 4.14
	kernel: ksud: spit a kthread as unhook watchdog
	kernel: file_wrapper: handle more compat
	kernel: file_wrapper: handle readdir and iterate compat for UL
	kernel: syscall_table_hook: introduce syscall table tampering
	kernel: sucompat: wire up sys_call_table unhooking
	kernel: sucompat: wire up jump label for sucompat unhooking
	kernel: kp_ksud: restore kprobes for early-boot and used-once hooks
	kernel: branch_link_hook: introduce arm64 branch link callsite hijacking
	kernel: feature: sulog: adjust for downstream
	kernel: feature: adbroot: adjust for downstream
	kernel: feature: wire up a smaller selinux_hide implementation
	kernel: lsm_hook: wire up setprocattr lsm hack for selinux_hide
	kernel: supercalls: expose ksu_set_manager_appid to sys_reboot
	kernel: supercalls: allow userspace to pull list entries (tiann#3040)
	kernel: tiny_sulog: basic ringbuffer, timestamped su log
	kernel: supercalls: expose ksuver override
	kernel: supercalls: expose spoof uname function to userspace
	kernel: supercalls: expose ksuflags override
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle conditional read_iter requirement for < 3.16
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: sucompat: bruteforce writeable stack from start_stack for < 3.8
	kernel: compat: no ext4_unregister_sysfs, no problem
	kernel: compat: provide proper strscpy/_pad routines
	kernel: compat: d_is_reg to S_ISREG
	kernel: compat: handle alloc_uid for < 3.5
	kernel: compat: iterate_dir -> vfs_readdir compat for < 3.11
	kernel: compat: provide bin2hex compat for < 3.18
	kernel: compat: file_inode compat for < 3.9
	kernel: compat: provide selinux_inode/selinux_cred wrappers for < 5.1
	kernel: compat: no-op groups_sort if unavailable
	kernel: compat: define U16_MAX if absent
	kernel: compat: fix sulog/adbroot compile for legacy
	kernel: compat: inline newer kernel_read / kernel_write for < 4.14
	kernel: apk_sign, throne_tracker: heap-ify search_manager/check_block
	kernel: compat: handle UL compat for refactored allowlist
	kernel: apk_sign: add more size/hash pairs
	HACK: kernel: bypass tf out of uid_t/gid_t strict type checks
	kernel: build: sucompat: inline fns on non-manual hook methods
	kernel: build: restore LKM support
	kernel: ksu: printout quirks / backports / etc on init
	workflows: restore ksuinit+lkm workflow
	ksuinit: use mount api
	Reapply: "refactor(kernel): Perform umount for webview zygote (tiann#3630)"
	KernelSU v3.2.5+

Commits on top of upstream: 95

Warning: Managers built from this repo has a known keystore.
See dummy.keystore.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 17, 2026
$ git log --pretty=%s upstream/main..HEAD --reverse
	manager: keep api 29 support
	manager: QOL
	manager: restore api 26 support
	manager: fix search bar focus bug on Android 8
	manager: Adjust for Android v7.1 support (#31)
	manager: fixup updates
	workflows: debloat
	dummy.keystore
	ksud: add armeabi-v7a support
	workflows: scripts: workaround armv7/a triple mismatch
	kernel:
	kernel: prepare for legacy support
	kernel: uapi: fix portability
	kernel: build: migrate to unity build
	kernel: external: import oss libraries
	kernel: downstream: provide common helpers
	kernel: app_profile: add 32-bit KSU_NO_NEW_PRIVS tif support
	kernel: init lsm_hook infrastructure
	kernel: lsm_hook: introduce selinux_ops LSM tampering for < 4.2
	kernel: lsm_hook: introduce ARM64 branch patching for 6.8+
	kernel: pkg_observer: initialize for downstream
	kernel: setuid_hook: disable seccomp for manager and allowed uids
	kernel: app_profile: adapt disable_seccomp to legacy
	kernel: selinux/sepolicy: handle selinux policydb backports
	kernel: selinux/sepolicy: abstract avtab slot access for compat
	kernel: selinux/rules: backport handle_sepolicy to legacy policydb
	kernel: selinux/rules: Pin task to current CPU to avoid cross-CPU rwlock release
	kernel: supercall: provide sys_reboot handler
	kernel: supercalls: tweak sys_reboot fd install
	kernel: adapt "namespace support" feature to old kernels
	kernel: allowlist: always allow shell for su on CONFIG_KSU_DEBUG
	kernel: file_wrapper: handle anon_inode_getfile for old kernels
	kernel: supercalls: partial backport of do_manage_mark
	kernel: compat: screw path_umount backport, call sys_umount directly
	kernel: app_profile: shim escape_with_root_profile
	kernel: throne_tracker: fixup deadlocks on iterate_dir
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: allowlist: escape allowlist handling to kthread
	kernel: ksud/lsm_hook: migrate ksu_install_rc_hook to security_file_permission LSM
	kernel: ksud: read: add fallback to /init.rc
	kernel: ksud: handle newfstat init_rc size injection
	kernel: ksud: handle early newfstat module_rc size injection
	kernel: ksud: wire up jump_label on vfs_read controlled hooks
	kernel: ksud: read: move second stage apply on read hook
	kernel: ksud: read: grab init_session_keyring on read hook
	kernel: ksud: replace input hook with an input handler
	kernel: sucompat: squash reworked sucompat changes
	kernel: lsm_hook: bprm: escape init ksud call to root for 3.x
	kernel: lsm_hook: bprm: escape init ksud call to root for < 4.14
	kernel: ksud: spit a kthread as unhook watchdog
	kernel: file_wrapper: handle more compat
	kernel: file_wrapper: handle readdir and iterate compat for UL
	kernel: syscall_table_hook: introduce syscall table tampering
	kernel: sucompat: wire up sys_call_table unhooking
	kernel: sucompat: wire up jump label for sucompat unhooking
	kernel: kp_ksud: restore kprobes for early-boot and used-once hooks
	kernel: branch_link_hook: introduce arm64 branch link callsite hijacking
	kernel: feature: sulog: adjust for downstream
	kernel: feature: adbroot: adjust for downstream
	kernel: feature: wire up a smaller selinux_hide implementation
	kernel: lsm_hook: wire up setprocattr lsm hack for selinux_hide
	kernel: supercalls: expose ksu_set_manager_appid to sys_reboot
	kernel: supercalls: allow userspace to pull list entries (tiann#3040)
	kernel: tiny_sulog: basic ringbuffer, timestamped su log
	kernel: supercalls: expose ksuver override
	kernel: supercalls: expose spoof uname function to userspace
	kernel: supercalls: expose ksuflags override
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle conditional read_iter requirement for < 3.16
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: sucompat: bruteforce writeable stack from start_stack for < 3.8
	kernel: compat: no ext4_unregister_sysfs, no problem
	kernel: compat: provide proper strscpy/_pad routines
	kernel: compat: d_is_reg to S_ISREG
	kernel: compat: handle alloc_uid for < 3.5
	kernel: compat: iterate_dir -> vfs_readdir compat for < 3.11
	kernel: compat: provide bin2hex compat for < 3.18
	kernel: compat: file_inode compat for < 3.9
	kernel: compat: provide selinux_inode/selinux_cred wrappers for < 5.1
	kernel: compat: no-op groups_sort if unavailable
	kernel: compat: define U16_MAX if absent
	kernel: compat: fix sulog/adbroot compile for legacy
	kernel: compat: inline newer kernel_read / kernel_write for < 4.14
	kernel: apk_sign, throne_tracker: heap-ify search_manager/check_block
	kernel: compat: handle UL compat for refactored allowlist
	kernel: apk_sign: add more size/hash pairs
	HACK: kernel: bypass tf out of uid_t/gid_t strict type checks
	kernel: build: sucompat: inline fns on non-manual hook methods
	kernel: build: restore LKM support
	kernel: ksu: printout quirks / backports / etc on init
	workflows: restore ksuinit+lkm workflow
	ksuinit: use mount api
	Reapply: "refactor(kernel): Perform umount for webview zygote (tiann#3630)"
	KernelSU v3.2.5+

Commits on top of upstream: 95

Warning: Managers built from this repo has a known keystore.
See dummy.keystore.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 17, 2026
$ git log --pretty=%s upstream/main..HEAD --reverse
	manager: keep api 29 support
	manager: QOL
	manager: restore api 26 support
	manager: fix search bar focus bug on Android 8
	manager: Adjust for Android v7.1 support (#31)
	manager: fixup updates
	workflows: debloat
	dummy.keystore
	ksud: add armeabi-v7a support
	workflows: scripts: workaround armv7/a triple mismatch
	kernel:
	kernel: prepare for legacy support
	kernel: uapi: fix portability
	kernel: build: migrate to unity build
	kernel: external: import oss libraries
	kernel: downstream: provide common helpers
	kernel: app_profile: add 32-bit KSU_NO_NEW_PRIVS tif support
	kernel: init lsm_hook infrastructure
	kernel: lsm_hook: introduce selinux_ops LSM tampering for < 4.2
	kernel: lsm_hook: introduce ARM64 branch patching for 6.8+
	kernel: pkg_observer: initialize for downstream
	kernel: setuid_hook: disable seccomp for manager and allowed uids
	kernel: app_profile: adapt disable_seccomp to legacy
	kernel: selinux/sepolicy: handle selinux policydb backports
	kernel: selinux/sepolicy: abstract avtab slot access for compat
	kernel: selinux/rules: backport handle_sepolicy to legacy policydb
	kernel: selinux/rules: Pin task to current CPU to avoid cross-CPU rwlock release
	kernel: supercall: provide sys_reboot handler
	kernel: supercalls: tweak sys_reboot fd install
	kernel: adapt "namespace support" feature to old kernels
	kernel: allowlist: always allow shell for su on CONFIG_KSU_DEBUG
	kernel: file_wrapper: handle anon_inode_getfile for old kernels
	kernel: supercalls: partial backport of do_manage_mark
	kernel: compat: screw path_umount backport, call sys_umount directly
	kernel: app_profile: shim escape_with_root_profile
	kernel: throne_tracker: fixup deadlocks on iterate_dir
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: allowlist: escape allowlist handling to kthread
	kernel: ksud/lsm_hook: migrate ksu_install_rc_hook to security_file_permission LSM
	kernel: ksud: read: add fallback to /init.rc
	kernel: ksud: handle newfstat init_rc size injection
	kernel: ksud: handle early newfstat module_rc size injection
	kernel: ksud: wire up jump_label on vfs_read controlled hooks
	kernel: ksud: read: move second stage apply on read hook
	kernel: ksud: read: grab init_session_keyring on read hook
	kernel: ksud: replace input hook with an input handler
	kernel: sucompat: squash reworked sucompat changes
	kernel: lsm_hook: bprm: escape init ksud call to root for 3.x
	kernel: lsm_hook: bprm: escape init ksud call to root for < 4.14
	kernel: ksud: spit a kthread as unhook watchdog
	kernel: file_wrapper: handle more compat
	kernel: file_wrapper: handle readdir and iterate compat for UL
	kernel: syscall_table_hook: introduce syscall table tampering
	kernel: sucompat: wire up sys_call_table unhooking
	kernel: sucompat: wire up jump label for sucompat unhooking
	kernel: kp_ksud: restore kprobes for early-boot and used-once hooks
	kernel: branch_link_hook: introduce arm64 branch link callsite hijacking
	kernel: feature: sulog: adjust for downstream
	kernel: feature: adbroot: adjust for downstream
	kernel: feature: wire up a smaller selinux_hide implementation
	kernel: lsm_hook: wire up setprocattr lsm hack for selinux_hide
	kernel: supercalls: expose ksu_set_manager_appid to sys_reboot
	kernel: supercalls: allow userspace to pull list entries (tiann#3040)
	kernel: tiny_sulog: basic ringbuffer, timestamped su log
	kernel: supercalls: expose ksuver override
	kernel: supercalls: expose spoof uname function to userspace
	kernel: supercalls: expose ksuflags override
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle conditional read_iter requirement for < 3.16
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: sucompat: bruteforce writeable stack from start_stack for < 3.8
	kernel: compat: no ext4_unregister_sysfs, no problem
	kernel: compat: provide proper strscpy/_pad routines
	kernel: compat: d_is_reg to S_ISREG
	kernel: compat: handle alloc_uid for < 3.5
	kernel: compat: iterate_dir -> vfs_readdir compat for < 3.11
	kernel: compat: provide bin2hex compat for < 3.18
	kernel: compat: file_inode compat for < 3.9
	kernel: compat: provide selinux_inode/selinux_cred wrappers for < 5.1
	kernel: compat: no-op groups_sort if unavailable
	kernel: compat: define U16_MAX if absent
	kernel: compat: fix sulog/adbroot compile for legacy
	kernel: compat: inline newer kernel_read / kernel_write for < 4.14
	kernel: apk_sign, throne_tracker: heap-ify search_manager/check_block
	kernel: compat: handle UL compat for refactored allowlist
	kernel: apk_sign: add more size/hash pairs
	HACK: kernel: bypass tf out of uid_t/gid_t strict type checks
	kernel: build: sucompat: inline fns on non-manual hook methods
	kernel: build: restore LKM support
	kernel: ksu: printout quirks / backports / etc on init
	workflows: restore ksuinit+lkm workflow
	ksuinit: use mount api
	Reapply: "refactor(kernel): Perform umount for webview zygote (tiann#3630)"
	WIP: kernel: tinyfs_sucompat: file ops based sucompat
	KernelSU v3.2.5+

Commits on top of upstream: 96

Warning: Managers built from this repo has a known keystore.
See dummy.keystore.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 17, 2026
$ git log --pretty=%s upstream/main..HEAD --reverse
	manager: keep api 29 support
	manager: QOL
	manager: restore api 26 support
	manager: fix search bar focus bug on Android 8
	manager: Adjust for Android v7.1 support (#31)
	manager: fixup updates
	workflows: debloat
	dummy.keystore
	ksud: add armeabi-v7a support
	workflows: scripts: workaround armv7/a triple mismatch
	kernel:
	kernel: prepare for legacy support
	kernel: uapi: fix portability
	kernel: build: migrate to unity build
	kernel: external: import oss libraries
	kernel: downstream: provide common helpers
	kernel: app_profile: add 32-bit KSU_NO_NEW_PRIVS tif support
	kernel: init lsm_hook infrastructure
	kernel: lsm_hook: introduce selinux_ops LSM tampering for < 4.2
	kernel: lsm_hook: introduce ARM64 branch patching for 6.8+
	kernel: pkg_observer: initialize for downstream
	kernel: setuid_hook: disable seccomp for manager and allowed uids
	kernel: app_profile: adapt disable_seccomp to legacy
	kernel: selinux/sepolicy: handle selinux policydb backports
	kernel: selinux/sepolicy: abstract avtab slot access for compat
	kernel: selinux/rules: backport handle_sepolicy to legacy policydb
	kernel: selinux/rules: Pin task to current CPU to avoid cross-CPU rwlock release
	kernel: supercall: provide sys_reboot handler
	kernel: supercalls: tweak sys_reboot fd install
	kernel: adapt "namespace support" feature to old kernels
	kernel: allowlist: always allow shell for su on CONFIG_KSU_DEBUG
	kernel: file_wrapper: handle anon_inode_getfile for old kernels
	kernel: supercalls: partial backport of do_manage_mark
	kernel: compat: screw path_umount backport, call sys_umount directly
	kernel: app_profile: shim escape_with_root_profile
	kernel: throne_tracker: fixup deadlocks on iterate_dir
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: allowlist: escape allowlist handling to kthread
	kernel: ksud/lsm_hook: migrate ksu_install_rc_hook to security_file_permission LSM
	kernel: ksud: read: add fallback to /init.rc
	kernel: ksud: handle newfstat init_rc size injection
	kernel: ksud: handle early newfstat module_rc size injection
	kernel: ksud: wire up jump_label on vfs_read controlled hooks
	kernel: ksud: read: move second stage apply on read hook
	kernel: ksud: read: grab init_session_keyring on read hook
	kernel: ksud: replace input hook with an input handler
	kernel: sucompat: squash reworked sucompat changes
	kernel: lsm_hook: bprm: escape init ksud call to root for 3.x
	kernel: lsm_hook: bprm: escape init ksud call to root for < 4.14
	kernel: ksud: spit a kthread as unhook watchdog
	kernel: file_wrapper: handle more compat
	kernel: file_wrapper: handle readdir and iterate compat for UL
	kernel: syscall_table_hook: introduce syscall table tampering
	kernel: sucompat: wire up sys_call_table unhooking
	kernel: sucompat: wire up jump label for sucompat unhooking
	kernel: kp_ksud: restore kprobes for early-boot and used-once hooks
	kernel: branch_link_hook: introduce arm64 branch link callsite hijacking
	kernel: feature: sulog: adjust for downstream
	kernel: feature: adbroot: adjust for downstream
	kernel: feature: wire up a smaller selinux_hide implementation
	kernel: lsm_hook: wire up setprocattr lsm hack for selinux_hide
	kernel: supercalls: expose ksu_set_manager_appid to sys_reboot
	kernel: supercalls: allow userspace to pull list entries (tiann#3040)
	kernel: tiny_sulog: basic ringbuffer, timestamped su log
	kernel: supercalls: expose ksuver override
	kernel: supercalls: expose spoof uname function to userspace
	kernel: supercalls: expose ksuflags override
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle conditional read_iter requirement for < 3.16
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: sucompat: bruteforce writeable stack from start_stack for < 3.8
	kernel: compat: no ext4_unregister_sysfs, no problem
	kernel: compat: provide proper strscpy/_pad routines
	kernel: compat: d_is_reg to S_ISREG
	kernel: compat: handle alloc_uid for < 3.5
	kernel: compat: iterate_dir -> vfs_readdir compat for < 3.11
	kernel: compat: provide bin2hex compat for < 3.18
	kernel: compat: file_inode compat for < 3.9
	kernel: compat: provide selinux_inode/selinux_cred wrappers for < 5.1
	kernel: compat: no-op groups_sort if unavailable
	kernel: compat: define U16_MAX if absent
	kernel: compat: fix sulog/adbroot compile for legacy
	kernel: compat: inline newer kernel_read / kernel_write for < 4.14
	kernel: apk_sign, throne_tracker: heap-ify search_manager/check_block
	kernel: compat: handle UL compat for refactored allowlist
	kernel: apk_sign: add more size/hash pairs
	HACK: kernel: bypass tf out of uid_t/gid_t strict type checks
	kernel: build: sucompat: inline fns on non-manual hook methods
	kernel: build: restore LKM support
	kernel: ksu: printout quirks / backports / etc on init
	workflows: restore ksuinit+lkm workflow
	ksuinit: use mount api
	Reapply: "refactor(kernel): Perform umount for webview zygote (tiann#3630)"
	WIP: kernel: tinyfs_sucompat: file ops based sucompat
	KernelSU v3.2.5+

Commits on top of upstream: 96

Warning: Managers built from this repo has a known keystore.
See dummy.keystore.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
debiansid pushed a commit to yapixel/KernelSU that referenced this pull request Aug 17, 2026
midori01 pushed a commit to midori01/KernelSU that referenced this pull request Aug 17, 2026
midori01 pushed a commit to midori01/KernelSU that referenced this pull request Aug 17, 2026
$ git log --pretty=%s upstream/main..HEAD --reverse
	manager: keep api 29 support
	manager: QOL
	manager: restore api 26 support
	manager: fix search bar focus bug on Android 8
	manager: Adjust for Android v7.1 support (KOWX712#31)
	manager: fixup updates
	workflows: debloat
	dummy.keystore
	ksud: add armeabi-v7a support
	workflows: scripts: workaround armv7/a triple mismatch
	kernel:
	kernel: prepare for legacy support
	kernel: uapi: fix portability
	kernel: build: migrate to unity build
	kernel: external: import oss libraries
	kernel: downstream: provide common helpers
	kernel: app_profile: add 32-bit KSU_NO_NEW_PRIVS tif support
	kernel: init lsm_hook infrastructure
	kernel: lsm_hook: introduce selinux_ops LSM tampering for < 4.2
	kernel: lsm_hook: introduce ARM64 branch patching for 6.8+
	kernel: pkg_observer: initialize for downstream
	kernel: setuid_hook: disable seccomp for manager and allowed uids
	kernel: app_profile: adapt disable_seccomp to legacy
	kernel: selinux/sepolicy: handle selinux policydb backports
	kernel: selinux/sepolicy: abstract avtab slot access for compat
	kernel: selinux/rules: backport handle_sepolicy to legacy policydb
	kernel: selinux/rules: Pin task to current CPU to avoid cross-CPU rwlock release
	kernel: supercall: provide sys_reboot handler
	kernel: supercalls: tweak sys_reboot fd install
	kernel: adapt "namespace support" feature to old kernels
	kernel: allowlist: always allow shell for su on CONFIG_KSU_DEBUG
	kernel: file_wrapper: handle anon_inode_getfile for old kernels
	kernel: supercalls: partial backport of do_manage_mark
	kernel: compat: screw path_umount backport, call sys_umount directly
	kernel: app_profile: shim escape_with_root_profile
	kernel: throne_tracker: fixup deadlocks on iterate_dir
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: allowlist: escape allowlist handling to kthread
	kernel: ksud/lsm_hook: migrate ksu_install_rc_hook to security_file_permission LSM
	kernel: ksud: read: add fallback to /init.rc
	kernel: ksud: handle newfstat init_rc size injection
	kernel: ksud: handle early newfstat module_rc size injection
	kernel: ksud: wire up jump_label on vfs_read controlled hooks
	kernel: ksud: read: move second stage apply on read hook
	kernel: ksud: read: grab init_session_keyring on read hook
	kernel: ksud: replace input hook with an input handler
	kernel: sucompat: squash reworked sucompat changes
	kernel: lsm_hook: bprm: escape init ksud call to root for 3.x
	kernel: lsm_hook: bprm: escape init ksud call to root for < 4.14
	kernel: ksud: spit a kthread as unhook watchdog
	kernel: file_wrapper: handle more compat
	kernel: file_wrapper: handle readdir and iterate compat for UL
	kernel: syscall_table_hook: introduce syscall table tampering
	kernel: sucompat: wire up sys_call_table unhooking
	kernel: sucompat: wire up jump label for sucompat unhooking
	kernel: kp_ksud: restore kprobes for early-boot and used-once hooks
	kernel: branch_link_hook: introduce arm64 branch link callsite hijacking
	kernel: feature: sulog: adjust for downstream
	kernel: feature: adbroot: adjust for downstream
	kernel: feature: wire up a smaller selinux_hide implementation
	kernel: lsm_hook: wire up setprocattr lsm hack for selinux_hide
	kernel: supercalls: expose ksu_set_manager_appid to sys_reboot
	kernel: supercalls: allow userspace to pull list entries (tiann#3040)
	kernel: tiny_sulog: basic ringbuffer, timestamped su log
	kernel: supercalls: expose ksuver override
	kernel: supercalls: expose spoof uname function to userspace
	kernel: supercalls: expose ksuflags override
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle conditional read_iter requirement for < 3.16
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: sucompat: bruteforce writeable stack from start_stack for < 3.8
	kernel: compat: no ext4_unregister_sysfs, no problem
	kernel: compat: provide proper strscpy/_pad routines
	kernel: compat: d_is_reg to S_ISREG
	kernel: compat: handle alloc_uid for < 3.5
	kernel: compat: iterate_dir -> vfs_readdir compat for < 3.11
	kernel: compat: provide bin2hex compat for < 3.18
	kernel: compat: file_inode compat for < 3.9
	kernel: compat: provide selinux_inode/selinux_cred wrappers for < 5.1
	kernel: compat: no-op groups_sort if unavailable
	kernel: compat: define U16_MAX if absent
	kernel: compat: fix sulog/adbroot compile for legacy
	kernel: compat: inline newer kernel_read / kernel_write for < 4.14
	kernel: apk_sign, throne_tracker: heap-ify search_manager/check_block
	kernel: compat: handle UL compat for refactored allowlist
	kernel: apk_sign: add more size/hash pairs
	HACK: kernel: bypass tf out of uid_t/gid_t strict type checks
	kernel: build: sucompat: inline fns on non-manual hook methods
	kernel: build: restore LKM support
	kernel: ksu: printout quirks / backports / etc on init
	workflows: restore ksuinit+lkm workflow
	ksuinit: use mount api
	Reapply: "refactor(kernel): Perform umount for webview zygote (tiann#3630)"
	KernelSU v3.2.5+

Commits on top of upstream: 95

Warning: Managers built from this repo has a known keystore.
See dummy.keystore.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 17, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 17, 2026
debiansid pushed a commit to yapixel/KernelSU that referenced this pull request Aug 17, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 18, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 18, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 18, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 18, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 18, 2026
midori01 pushed a commit to midori01/KernelSU that referenced this pull request Aug 19, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 20, 2026
MrShockWAVEog pushed a commit to MrShockWAVEog/KernelSU that referenced this pull request Aug 20, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 21, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 22, 2026
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 22, 2026
Keep webview zygote unmounting enabled by default while allowing users
to restore compatibility with modules that modify webview resources.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new kernel feature flag is accessed across code paths without READ_ONCE/WRITE_ONCE (data-race risk), and one updated scenario comment is misleading relative to the actual control flow.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

kernel/feature/kernel_umount.c:115

  • The updated scenario comment is misleading: isolated UIDs are still handled primarily via the is_isolated_process(new_uid) path (independent of the WebView zygote feature flag). Please clarify the scenario description to match the actual control flow.
    // 4. Webview zygote forked from zygote: zygote -> webview_zygote (controlled by feature policy)
    // 5. Isolated process forked from app zygote: appuid -> isolated_process (already handled by 3)
    // 6. Isolated process forked from webview zygote (already handled by 4)
  • Files reviewed: 19/19 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread kernel/feature/kernel_umount.c
Comment thread kernel/policy/allowlist.c
@JingMatrix

Copy link
Copy Markdown

To me, it suffice to treat the webview_zygote as a legal target for denylist.
The detection point is on inconsistency, hence I provide webview_zygote the same mount namespace that a normal isolated process (belonging to a detector) would receive. See JingMatrix/NeoZygisk@ec29fb1

@aviraxp

aviraxp commented Aug 29, 2026 •

Copy link
Copy Markdown
Collaborator Author

As I said in commit message, this is expected to break some font modules aimed at webview, because fonts are usually loaded in sandboxed process forked from webview zygote. Webview zygote is previously not unmounted for this exact reason, as per a user request. So I provided a toggle.

If some fonts work, that is just because a few common fonts are preloaded in zygote.

@JingMatrix

Copy link
Copy Markdown

In this case, to address the user need, isn't propagating webview_zygote as a configurable process to the profile setting the right move ?

The underlying issue of detection was simply neglecting webview_zygote as configurable process.

@aviraxp

aviraxp commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator Author

The issue is as long as there is one not-unmounted sandboxed isolated process running, the detection will work. So one match = all match. So I don't think it makes too much sense to make it toggable per-app. Also there is no easy way to do this without a userspace daemon, maybe need to parse cmdline in process's stack.

@JingMatrix

Copy link
Copy Markdown

I meant show webview_zygote as an app which you can configure its profile (deny list).

Not a per app sense as you have understood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants