Skip to content

Conversation

@backslashxx
Copy link
Contributor

@backslashxx backslashxx commented Mar 27, 2025

monitors and lists all incoming mounts by hooking security_sb_mount or alternatively, sys_mount / do_mount.
this requires ksud to go back and use sys_mount instead of fsopen + move_mount

this also fixes that MNT_DETACH issue. (#2386 (comment))
Modules also can create an overlay with KSU devname and it will be added to the list.
This will also restore pre 5.2 manager support.

Those might be a bit questionable, so it is a take it or reject it kind of situation.

sys_mount hook looks like

ksu_mount_monitor(copy_mount_string(dev_name), copy_mount_string(dir_name), copy_mount_string(type));

ref: ximi-mojito-test/mojito_krenol@ac020b0

sys_mount / do_mount compatibility is for LKM and 6.8+ where you cant just do LSM hooks as is.
torvalds/linux@9285c5a#diff-3b35df76d1c4627ed97cc307a957850d57b85e77917c19ac0813286c46b4ace2R556

Context: aviraxp@c7facef#commitcomment-153941502

@backslashxx backslashxx force-pushed the umount-1 branch 3 times, most recently from f9156b0 to e38a41f Compare March 28, 2025 01:39
@backslashxx backslashxx changed the title kernel: core_hook: automate umount list kernel: core_hook: automate and refactor umount Mar 28, 2025
@tiann
Copy link
Owner

tiann commented Mar 28, 2025

What is the root cause of #2386 (comment), and how does it fix the issue?

@backslashxx
Copy link
Contributor Author

backslashxx commented Mar 28, 2025

What is the root cause of #2386 (comment), and how does it fix the issue?

That I don't really have an idea, I suspect it has something to do with mount order and then unmount order.

image

maybe need to follow
mount: A B C D
unmount: D C B A

if its not that, then maybe it has something to do with the use of fsopen + move_mount.
since this is whats different on current implementation where everything is hardcoded.

@backslashxx backslashxx force-pushed the umount-1 branch 12 times, most recently from e51fe8d to 807ce07 Compare March 28, 2025 16:57
@backslashxx backslashxx force-pushed the umount-1 branch 2 times, most recently from fefc2e6 to 094a7ff Compare March 29, 2025 06:25
@backslashxx backslashxx requested a review from aviraxp March 29, 2025 06:26
@backslashxx backslashxx force-pushed the umount-1 branch 5 times, most recently from b992e8e to 594d366 Compare March 29, 2025 06:45
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
monitors and lists all incoming mounts by hooking security_sb_mount
this requires ksud to go back and use sys_mount instead of fsopen + move_mount

this also fixes that MNT_DETACH issue. tiann#2386 (comment)
Modules also can create an overlay with KSU devname and it will be added to the list.

Context: aviraxp@c7facef#commitcomment-153941502

Stale: tiann#2531

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
Added from 5ec1cff@16e13ae (+23)
	implement magic mount
	restorecon: set adb_file to system_file for module files
	magic_mount: use trusted.overlay.opaque
	chore: fmt
	magic_mount: supports whiteout
	chore: refine code
	magic_mount: fix
	log: make verbose logging optional
	magic_mount: refine
	ksud: fix disable / enable modules
	ksud: fix odm not magic-mounted
	manager: no need to check overlayfs
	ksud: fix partition link
	ksud: fix clone symlink
	ksud: refine tmpfs
	ksud: add KSU_MAGIC_MOUNT to env (5ec1cff#5)
	manager: remove shrink image
	use module dir name as real id
	allow restore uninstalled module
	ksud: make tmpfs and magic mount optional
	ksud: fix stat
	reformat rust codes
	app: persist show system app settings

Other changes: (+45)
	ksud: move workdir to /mnt/vendor
	ksud: remove tmpfs mounting
	manager: show module id on module page (tiann#2365)
	workflows: debloat
	ksud: add armeabi-v7a support
	manager: Add ABI and Kernel archirecture info into InfoCardItem
	manager:  failure mode dummy demo
	dummy.keystore
	manager: unofficial build
	kernel: drop LKM and kprobes support
	kernel: restore compat code required for old kernels
	kernel: expose allowlist workaround as Kconfig option
	kernel: core_hook: screw path_umount backport, call sys_umount directly
	kernel: handle backports
	kernel: core_hook: automate and refactor umount (tiann#2531)
	kernel: core_hook: only umount when unmountable > 0
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656)
	kernel: sucompat: sucompat toggle support for non-kp (tiann#2506)
	kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653)
	kernel: core_hook: intercept devpts via security_inode_permission LSM
	kernel: compat: migrate sucompat strncpy_from_user to copy_from_user
	kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels
	kernel: ksud: provide dummy handlers for old hooks
	kernel: core_hook: earlier escape_to_root already-root check
	kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig
	kernel: sucompat: provide do_execve_common handler for <= 3.13
	kernel: ksud: provide is_ksu_transition check v2
	kernel: core_hook: no ext4_unregister_sysfs, no problem
	kernel: throne_tracker: add strscpy/strlcpy compat
	kernel: ksud: d_is_reg to IS_REG
	kernel: Makefile: remove overlayfs requirement
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle read_iter requirement conditionally
	kernel: apk_sign: casting to char for strcmp -> memcmp
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: compat: inline iterate_dir -> vfs_readdir compat
	kernel: apk_sign: fix return check for ksu_sha256
	kernel: apk_sign: add more size/hash pairs
	kernel: ksu: printout quirks / backports / etc on init
	kernel: sucompat: provide getname_flags (user) ultimatum hook
	kernel: sucompat: provide getname_flags (kernel) ultimatum hook
	kernel: core_hook: add support for KernelNoSU
	KernelSU v1.0.5+magic

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

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
monitors and lists all incoming mounts by hooking security_sb_mount
this requires ksud to go back and use sys_mount instead of fsopen + move_mount

this also fixes that MNT_DETACH issue. tiann#2386 (comment)
Modules also can create an overlay with KSU devname and it will be added to the list.

Context: aviraxp@c7facef#commitcomment-153941502

Stale: tiann#2531

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
Added from 5ec1cff@16e13ae (+23)
	implement magic mount
	restorecon: set adb_file to system_file for module files
	magic_mount: use trusted.overlay.opaque
	chore: fmt
	magic_mount: supports whiteout
	chore: refine code
	magic_mount: fix
	log: make verbose logging optional
	magic_mount: refine
	ksud: fix disable / enable modules
	ksud: fix odm not magic-mounted
	manager: no need to check overlayfs
	ksud: fix partition link
	ksud: fix clone symlink
	ksud: refine tmpfs
	ksud: add KSU_MAGIC_MOUNT to env (5ec1cff#5)
	manager: remove shrink image
	use module dir name as real id
	allow restore uninstalled module
	ksud: make tmpfs and magic mount optional
	ksud: fix stat
	reformat rust codes
	app: persist show system app settings

Other changes: (+45)
	ksud: move workdir to /mnt/vendor
	ksud: remove tmpfs mounting
	manager: show module id on module page (tiann#2365)
	workflows: debloat
	ksud: add armeabi-v7a support
	manager: Add ABI and Kernel archirecture info into InfoCardItem
	manager:  failure mode dummy demo
	dummy.keystore
	manager: unofficial build
	kernel: drop LKM and kprobes support
	kernel: restore compat code required for old kernels
	kernel: expose allowlist workaround as Kconfig option
	kernel: core_hook: screw path_umount backport, call sys_umount directly
	kernel: handle backports
	kernel: core_hook: automate and refactor umount (tiann#2531)
	kernel: core_hook: only umount when unmountable > 0
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656)
	kernel: sucompat: sucompat toggle support for non-kp (tiann#2506)
	kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653)
	kernel: core_hook: intercept devpts via security_inode_permission LSM
	kernel: compat: migrate sucompat strncpy_from_user to copy_from_user
	kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels
	kernel: ksud: provide dummy handlers for old hooks
	kernel: core_hook: earlier escape_to_root already-root check
	kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig
	kernel: sucompat: provide do_execve_common handler for <= 3.13
	kernel: ksud: provide is_ksu_transition check v2
	kernel: core_hook: no ext4_unregister_sysfs, no problem
	kernel: throne_tracker: add strscpy/strlcpy compat
	kernel: ksud: d_is_reg to IS_REG
	kernel: Makefile: remove overlayfs requirement
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle read_iter requirement conditionally
	kernel: apk_sign: casting to char for strcmp -> memcmp
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: compat: inline iterate_dir -> vfs_readdir compat
	kernel: apk_sign: fix return check for ksu_sha256
	kernel: apk_sign: add more size/hash pairs
	kernel: ksu: printout quirks / backports / etc on init
	kernel: sucompat: provide getname_flags (user) ultimatum hook
	kernel: sucompat: provide getname_flags (kernel) ultimatum hook
	kernel: core_hook: add support for KernelNoSU
	KernelSU v1.0.5+magic

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

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
monitors and lists all incoming mounts by hooking security_sb_mount
this requires ksud to go back and use sys_mount instead of fsopen + move_mount

this also fixes that MNT_DETACH issue. tiann#2386 (comment)
Modules also can create an overlay with KSU devname and it will be added to the list.

Context: aviraxp@c7facef#commitcomment-153941502

Stale: tiann#2531

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
Added from 5ec1cff@16e13ae (+23)
	implement magic mount
	restorecon: set adb_file to system_file for module files
	magic_mount: use trusted.overlay.opaque
	chore: fmt
	magic_mount: supports whiteout
	chore: refine code
	magic_mount: fix
	log: make verbose logging optional
	magic_mount: refine
	ksud: fix disable / enable modules
	ksud: fix odm not magic-mounted
	manager: no need to check overlayfs
	ksud: fix partition link
	ksud: fix clone symlink
	ksud: refine tmpfs
	ksud: add KSU_MAGIC_MOUNT to env (5ec1cff#5)
	manager: remove shrink image
	use module dir name as real id
	allow restore uninstalled module
	ksud: make tmpfs and magic mount optional
	ksud: fix stat
	reformat rust codes
	app: persist show system app settings

Other changes: (+45)
	ksud: move workdir to /mnt/vendor
	ksud: remove tmpfs mounting
	manager: show module id on module page (tiann#2365)
	workflows: debloat
	ksud: add armeabi-v7a support
	manager: Add ABI and Kernel archirecture info into InfoCardItem
	manager:  failure mode dummy demo
	dummy.keystore
	manager: unofficial build
	kernel: drop LKM and kprobes support
	kernel: restore compat code required for old kernels
	kernel: expose allowlist workaround as Kconfig option
	kernel: core_hook: screw path_umount backport, call sys_umount directly
	kernel: handle backports
	kernel: core_hook: automate and refactor umount (tiann#2531)
	kernel: core_hook: only umount when unmountable > 0
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656)
	kernel: sucompat: sucompat toggle support for non-kp (tiann#2506)
	kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653)
	kernel: core_hook: intercept devpts via security_inode_permission LSM
	kernel: compat: migrate sucompat strncpy_from_user to copy_from_user
	kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels
	kernel: ksud: provide dummy handlers for old hooks
	kernel: core_hook: earlier escape_to_root already-root check
	kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig
	kernel: sucompat: provide do_execve_common handler for <= 3.13
	kernel: ksud: provide is_ksu_transition check v2
	kernel: core_hook: no ext4_unregister_sysfs, no problem
	kernel: throne_tracker: add strscpy/strlcpy compat
	kernel: ksud: d_is_reg to IS_REG
	kernel: Makefile: remove overlayfs requirement
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle read_iter requirement conditionally
	kernel: apk_sign: casting to char for strcmp -> memcmp
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: compat: inline iterate_dir -> vfs_readdir compat
	kernel: apk_sign: fix return check for ksu_sha256
	kernel: apk_sign: add more size/hash pairs
	kernel: ksu: printout quirks / backports / etc on init
	kernel: sucompat: provide getname_flags (user) ultimatum hook
	kernel: sucompat: provide getname_flags (kernel) ultimatum hook
	kernel: core_hook: add support for KernelNoSU
	KernelSU v1.0.5+magic

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

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
monitors and lists all incoming mounts by hooking security_sb_mount
this requires ksud to go back and use sys_mount instead of fsopen + move_mount

this also fixes that MNT_DETACH issue. tiann#2386 (comment)
Modules also can create an overlay with KSU devname and it will be added to the list.

Context: aviraxp@c7facef#commitcomment-153941502

Stale: tiann#2531

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
Added from 5ec1cff@16e13ae (+23)
	implement magic mount
	restorecon: set adb_file to system_file for module files
	magic_mount: use trusted.overlay.opaque
	chore: fmt
	magic_mount: supports whiteout
	chore: refine code
	magic_mount: fix
	log: make verbose logging optional
	magic_mount: refine
	ksud: fix disable / enable modules
	ksud: fix odm not magic-mounted
	manager: no need to check overlayfs
	ksud: fix partition link
	ksud: fix clone symlink
	ksud: refine tmpfs
	ksud: add KSU_MAGIC_MOUNT to env (5ec1cff#5)
	manager: remove shrink image
	use module dir name as real id
	allow restore uninstalled module
	ksud: make tmpfs and magic mount optional
	ksud: fix stat
	reformat rust codes
	app: persist show system app settings

Other changes: (+45)
	ksud: move workdir to /mnt/vendor
	ksud: remove tmpfs mounting
	manager: show module id on module page (tiann#2365)
	workflows: debloat
	ksud: add armeabi-v7a support
	manager: Add ABI and Kernel archirecture info into InfoCardItem
	manager:  failure mode dummy demo
	dummy.keystore
	manager: unofficial build
	kernel: drop LKM and kprobes support
	kernel: restore compat code required for old kernels
	kernel: expose allowlist workaround as Kconfig option
	kernel: core_hook: screw path_umount backport, call sys_umount directly
	kernel: handle backports
	kernel: core_hook: automate and refactor umount (tiann#2531)
	kernel: core_hook: only umount when unmountable > 0
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656)
	kernel: sucompat: sucompat toggle support for non-kp (tiann#2506)
	kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653)
	kernel: core_hook: intercept devpts via security_inode_permission LSM
	kernel: compat: migrate sucompat strncpy_from_user to copy_from_user
	kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels
	kernel: ksud: provide dummy handlers for old hooks
	kernel: core_hook: earlier escape_to_root already-root check
	kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig
	kernel: sucompat: provide do_execve_common handler for <= 3.13
	kernel: ksud: provide is_ksu_transition check v2
	kernel: core_hook: no ext4_unregister_sysfs, no problem
	kernel: throne_tracker: add strscpy/strlcpy compat
	kernel: ksud: d_is_reg to IS_REG
	kernel: Makefile: remove overlayfs requirement
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle read_iter requirement conditionally
	kernel: apk_sign: casting to char for strcmp -> memcmp
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: compat: inline iterate_dir -> vfs_readdir compat
	kernel: apk_sign: fix return check for ksu_sha256
	kernel: apk_sign: add more size/hash pairs
	kernel: ksu: printout quirks / backports / etc on init
	kernel: sucompat: provide getname_flags (user) ultimatum hook
	kernel: sucompat: provide getname_flags (kernel) ultimatum hook
	kernel: core_hook: add support for KernelNoSU
	KernelSU v1.0.5+magic

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

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
monitors and lists all incoming mounts by hooking security_sb_mount
this requires ksud to go back and use sys_mount instead of fsopen + move_mount

this also fixes that MNT_DETACH issue. tiann#2386 (comment)
Modules also can create an overlay with KSU devname and it will be added to the list.

Context: aviraxp@c7facef#commitcomment-153941502

Stale: tiann#2531

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
Added from 5ec1cff@16e13ae (+23)
	implement magic mount
	restorecon: set adb_file to system_file for module files
	magic_mount: use trusted.overlay.opaque
	chore: fmt
	magic_mount: supports whiteout
	chore: refine code
	magic_mount: fix
	log: make verbose logging optional
	magic_mount: refine
	ksud: fix disable / enable modules
	ksud: fix odm not magic-mounted
	manager: no need to check overlayfs
	ksud: fix partition link
	ksud: fix clone symlink
	ksud: refine tmpfs
	ksud: add KSU_MAGIC_MOUNT to env (5ec1cff#5)
	manager: remove shrink image
	use module dir name as real id
	allow restore uninstalled module
	ksud: make tmpfs and magic mount optional
	ksud: fix stat
	reformat rust codes
	app: persist show system app settings

Other changes: (+45)
	ksud: move workdir to /mnt/vendor
	ksud: remove tmpfs mounting
	manager: show module id on module page (tiann#2365)
	workflows: debloat
	ksud: add armeabi-v7a support
	manager: Add ABI and Kernel archirecture info into InfoCardItem
	manager:  failure mode dummy demo
	dummy.keystore
	manager: unofficial build
	kernel: drop LKM and kprobes support
	kernel: restore compat code required for old kernels
	kernel: expose allowlist workaround as Kconfig option
	kernel: core_hook: screw path_umount backport, call sys_umount directly
	kernel: handle backports
	kernel: core_hook: automate and refactor umount (tiann#2531)
	kernel: core_hook: only umount when unmountable > 0
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656)
	kernel: sucompat: sucompat toggle support for non-kp (tiann#2506)
	kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653)
	kernel: core_hook: intercept devpts via security_inode_permission LSM
	kernel: compat: migrate sucompat strncpy_from_user to copy_from_user
	kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels
	kernel: ksud: provide dummy handlers for old hooks
	kernel: core_hook: earlier escape_to_root already-root check
	kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig
	kernel: sucompat: provide do_execve_common handler for <= 3.13
	kernel: ksud: provide is_ksu_transition check v2
	kernel: core_hook: no ext4_unregister_sysfs, no problem
	kernel: throne_tracker: add strscpy/strlcpy compat
	kernel: ksud: d_is_reg to IS_REG
	kernel: Makefile: remove overlayfs requirement
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle read_iter requirement conditionally
	kernel: apk_sign: casting to char for strcmp -> memcmp
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: compat: inline iterate_dir -> vfs_readdir compat
	kernel: apk_sign: fix return check for ksu_sha256
	kernel: apk_sign: add more size/hash pairs
	kernel: ksu: printout quirks / backports / etc on init
	kernel: sucompat: provide getname_flags (user) ultimatum hook
	kernel: sucompat: provide getname_flags (kernel) ultimatum hook
	kernel: core_hook: add support for KernelNoSU
	KernelSU v1.0.5+magic

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

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
monitors and lists all incoming mounts by hooking security_sb_mount
this requires ksud to go back and use sys_mount instead of fsopen + move_mount

this also fixes that MNT_DETACH issue. tiann#2386 (comment)
Modules also can create an overlay with KSU devname and it will be added to the list.

Context: aviraxp@c7facef#commitcomment-153941502

Stale: tiann#2531

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
Added from 5ec1cff@16e13ae (+23)
	implement magic mount
	restorecon: set adb_file to system_file for module files
	magic_mount: use trusted.overlay.opaque
	chore: fmt
	magic_mount: supports whiteout
	chore: refine code
	magic_mount: fix
	log: make verbose logging optional
	magic_mount: refine
	ksud: fix disable / enable modules
	ksud: fix odm not magic-mounted
	manager: no need to check overlayfs
	ksud: fix partition link
	ksud: fix clone symlink
	ksud: refine tmpfs
	ksud: add KSU_MAGIC_MOUNT to env (5ec1cff#5)
	manager: remove shrink image
	use module dir name as real id
	allow restore uninstalled module
	ksud: make tmpfs and magic mount optional
	ksud: fix stat
	reformat rust codes
	app: persist show system app settings

Other changes: (+45)
	ksud: move workdir to /mnt/vendor
	ksud: remove tmpfs mounting
	manager: show module id on module page (tiann#2365)
	workflows: debloat
	ksud: add armeabi-v7a support
	manager: Add ABI and Kernel archirecture info into InfoCardItem
	manager:  failure mode dummy demo
	dummy.keystore
	manager: unofficial build
	kernel: drop LKM and kprobes support
	kernel: restore compat code required for old kernels
	kernel: expose allowlist workaround as Kconfig option
	kernel: core_hook: screw path_umount backport, call sys_umount directly
	kernel: handle backports
	kernel: core_hook: automate and refactor umount (tiann#2531)
	kernel: core_hook: only umount when unmountable > 0
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656)
	kernel: sucompat: sucompat toggle support for non-kp (tiann#2506)
	kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653)
	kernel: core_hook: intercept devpts via security_inode_permission LSM
	kernel: compat: migrate sucompat strncpy_from_user to copy_from_user
	kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels
	kernel: ksud: provide dummy handlers for old hooks
	kernel: core_hook: earlier escape_to_root already-root check
	kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig
	kernel: sucompat: provide do_execve_common handler for <= 3.13
	kernel: ksud: provide is_ksu_transition check v2
	kernel: core_hook: no ext4_unregister_sysfs, no problem
	kernel: throne_tracker: add strscpy/strlcpy compat
	kernel: ksud: d_is_reg to IS_REG
	kernel: Makefile: remove overlayfs requirement
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle read_iter requirement conditionally
	kernel: apk_sign: casting to char for strcmp -> memcmp
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: compat: inline iterate_dir -> vfs_readdir compat
	kernel: apk_sign: fix return check for ksu_sha256
	kernel: apk_sign: add more size/hash pairs
	kernel: ksu: printout quirks / backports / etc on init
	kernel: sucompat: provide getname_flags (user) ultimatum hook
	kernel: sucompat: provide getname_flags (kernel) ultimatum hook
	kernel: core_hook: add support for KernelNoSU
	KernelSU v1.0.5+magic

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

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
Added from 5ec1cff@16e13ae (+19)
	implement magic mount
	restorecon: set adb_file to system_file for module files
	magic_mount: use trusted.overlay.opaque
	chore: fmt
	magic_mount: supports whiteout
	chore: refine code
	magic_mount: fix
	log: make verbose logging optional
	magic_mount: refine
	ksud: fix disable / enable modules
	ksud: fix odm not magic-mounted
	manager: no need to check overlayfs
	ksud: fix partition link
	ksud: fix clone symlink
	ksud: refine tmpfs
	ksud: add KSU_MAGIC_MOUNT to env (5ec1cff#5)
	ksud: make tmpfs and magic mount optional
	ksud: fix stat
	reformat rust codes

Other changes: (+45)
	manager: remove shrink image
	ksud: move workdir to /mnt/vendor
	ksud: remove tmpfs mounting
	workflows: debloat
	ksud: add armeabi-v7a support
	manager:  failure mode dummy demo
	dummy.keystore
	manager: unofficial build
	manager: Add ABI and Kernel archirecture info into InfoCardItem
	kernel: drop LKM and kprobes support
	kernel: restore compat code required for old kernels
	kernel: expose allowlist workaround as Kconfig option
	kernel: core_hook: screw path_umount backport, call sys_umount directly
	kernel: handle backports
	kernel: core_hook: automate and refactor umount (tiann#2531)
	kernel: core_hook: only umount when unmountable > 0
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656)
	kernel: sucompat: sucompat toggle support for non-kp (tiann#2506)
	kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653)
	kernel: core_hook: intercept devpts via security_inode_permission LSM
	kernel: compat: migrate sucompat strncpy_from_user to copy_from_user
	kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels
	kernel: ksud: provide dummy handlers for old hooks
	kernel: core_hook: earlier escape_to_root already-root check
	kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig
	kernel: sucompat: provide do_execve_common handler for <= 3.13
	kernel: ksud: provide is_ksu_transition check v2
	kernel: core_hook: no ext4_unregister_sysfs, no problem
	kernel: throne_tracker: add strscpy/strlcpy compat
	kernel: ksud: d_is_reg to IS_REG
	kernel: Makefile: remove overlayfs requirement
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle read_iter requirement conditionally
	kernel: apk_sign: casting to char for strcmp -> memcmp
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: compat: inline iterate_dir -> vfs_readdir compat
	kernel: apk_sign: fix return check for ksu_sha256
	kernel: apk_sign: add more size/hash pairs
	kernel: ksu: printout quirks / backports / etc on init
	kernel: sucompat: provide getname_flags (user) ultimatum hook
	kernel: sucompat: provide getname_flags (kernel) ultimatum hook
	kernel: core_hook: add support for KernelNoSU
	KernelSU v1.0.5+magic
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 30, 2025
monitors and lists all incoming mounts by hooking security_sb_mount
this requires ksud to go back and use sys_mount instead of fsopen + move_mount

this also fixes that MNT_DETACH issue. tiann#2386 (comment)
Modules also can create an overlay with KSU devname and it will be added to the list.

Context: aviraxp@c7facef#commitcomment-153941502

Stale: tiann#2531

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 30, 2025
Added from 5ec1cff@16e13ae (+19)
	implement magic mount
	restorecon: set adb_file to system_file for module files
	magic_mount: use trusted.overlay.opaque
	chore: fmt
	magic_mount: supports whiteout
	chore: refine code
	magic_mount: fix
	log: make verbose logging optional
	magic_mount: refine
	ksud: fix disable / enable modules
	ksud: fix odm not magic-mounted
	manager: no need to check overlayfs
	ksud: fix partition link
	ksud: fix clone symlink
	ksud: refine tmpfs
	ksud: add KSU_MAGIC_MOUNT to env (5ec1cff#5)
	ksud: make tmpfs and magic mount optional
	ksud: fix stat
	reformat rust codes

Other changes: (+45)
	manager: remove shrink image
	ksud: move workdir to /mnt/vendor
	ksud: remove tmpfs mounting
	workflows: debloat
	ksud: add armeabi-v7a support
	manager:  failure mode dummy demo
	dummy.keystore
	manager: unofficial build
	manager: Add ABI and Kernel archirecture info into InfoCardItem
	kernel: drop LKM and kprobes support
	kernel: restore compat code required for old kernels
	kernel: expose allowlist workaround as Kconfig option
	kernel: core_hook: screw path_umount backport, call sys_umount directly
	kernel: handle backports
	kernel: core_hook: automate and refactor umount (tiann#2531)
	kernel: core_hook: only umount when unmountable > 0
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656)
	kernel: sucompat: sucompat toggle support for non-kp (tiann#2506)
	kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653)
	kernel: core_hook: intercept devpts via security_inode_permission LSM
	kernel: compat: migrate sucompat strncpy_from_user to copy_from_user
	kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels
	kernel: ksud: provide dummy handlers for old hooks
	kernel: core_hook: earlier escape_to_root already-root check
	kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig
	kernel: sucompat: provide do_execve_common handler for <= 3.13
	kernel: ksud: provide is_ksu_transition check v2
	kernel: core_hook: no ext4_unregister_sysfs, no problem
	kernel: throne_tracker: add strscpy/strlcpy compat
	kernel: ksud: d_is_reg to IS_REG
	kernel: Makefile: remove overlayfs requirement
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle read_iter requirement conditionally
	kernel: apk_sign: casting to char for strcmp -> memcmp
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: compat: inline iterate_dir -> vfs_readdir compat
	kernel: apk_sign: fix return check for ksu_sha256
	kernel: apk_sign: add more size/hash pairs
	kernel: ksu: printout quirks / backports / etc on init
	kernel: sucompat: provide getname_flags (user) ultimatum hook
	kernel: sucompat: provide getname_flags (kernel) ultimatum hook
	kernel: core_hook: add support for KernelNoSU
	KernelSU v1.0.5+magic
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 30, 2025
monitors and lists all incoming mounts by hooking security_sb_mount
this requires ksud to go back and use sys_mount instead of fsopen + move_mount

this also fixes that MNT_DETACH issue. tiann#2386 (comment)
Modules also can create an overlay with KSU devname and it will be added to the list.

Context: aviraxp@c7facef#commitcomment-153941502

Stale: tiann#2531

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 30, 2025
Added from 5ec1cff@16e13ae (+19)
	implement magic mount
	restorecon: set adb_file to system_file for module files
	magic_mount: use trusted.overlay.opaque
	chore: fmt
	magic_mount: supports whiteout
	chore: refine code
	magic_mount: fix
	log: make verbose logging optional
	magic_mount: refine
	ksud: fix disable / enable modules
	ksud: fix odm not magic-mounted
	manager: no need to check overlayfs
	ksud: fix partition link
	ksud: fix clone symlink
	ksud: refine tmpfs
	ksud: add KSU_MAGIC_MOUNT to env (5ec1cff#5)
	ksud: make tmpfs and magic mount optional
	ksud: fix stat
	reformat rust codes

Other changes: (+45)
	manager: remove shrink image
	ksud: move workdir to /mnt/vendor
	ksud: remove tmpfs mounting
	workflows: debloat
	ksud: add armeabi-v7a support
	manager:  failure mode dummy demo
	dummy.keystore
	manager: unofficial build
	manager: Add ABI and Kernel archirecture info into InfoCardItem
	kernel: drop LKM and kprobes support
	kernel: restore compat code required for old kernels
	kernel: expose allowlist workaround as Kconfig option
	kernel: core_hook: screw path_umount backport, call sys_umount directly
	kernel: handle backports
	kernel: core_hook: automate and refactor umount (tiann#2531)
	kernel: core_hook: only umount when unmountable > 0
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656)
	kernel: sucompat: sucompat toggle support for non-kp (tiann#2506)
	kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653)
	kernel: core_hook: intercept devpts via security_inode_permission LSM
	kernel: compat: migrate sucompat strncpy_from_user to copy_from_user
	kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels
	kernel: ksud: provide dummy handlers for old hooks
	kernel: core_hook: earlier escape_to_root already-root check
	kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig
	kernel: sucompat: provide do_execve_common handler for <= 3.13
	kernel: ksud: provide is_ksu_transition check v2
	kernel: core_hook: no ext4_unregister_sysfs, no problem
	kernel: throne_tracker: add strscpy/strlcpy compat
	kernel: ksud: d_is_reg to IS_REG
	kernel: Makefile: remove overlayfs requirement
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle read_iter requirement conditionally
	kernel: apk_sign: casting to char for strcmp -> memcmp
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: compat: inline iterate_dir -> vfs_readdir compat
	kernel: apk_sign: fix return check for ksu_sha256
	kernel: apk_sign: add more size/hash pairs
	kernel: ksu: printout quirks / backports / etc on init
	kernel: sucompat: provide getname_flags (user) ultimatum hook
	kernel: sucompat: provide getname_flags (kernel) ultimatum hook
	kernel: core_hook: add support for KernelNoSU
	KernelSU v1.0.5+magic
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 31, 2025
monitors and lists all incoming mounts by hooking security_sb_mount
this requires ksud to go back and use sys_mount instead of fsopen + move_mount

this also fixes that MNT_DETACH issue. tiann#2386 (comment)
Modules also can create an overlay with KSU devname and it will be added to the list.

Context: aviraxp@c7facef#commitcomment-153941502

Stale: tiann#2531

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 31, 2025
Added from 5ec1cff@79c4a17 (+23)
	implement magic mount
	restorecon: set adb_file to system_file for module files
	magic_mount: use trusted.overlay.opaque
	chore: fmt
	magic_mount: supports whiteout
	chore: refine code
	magic_mount: fix
	log: make verbose logging optional
	magic_mount: refine
	ksud: fix disable / enable modules
	ksud: fix odm not magic-mounted
	manager: no need to check overlayfs
	ksud: fix partition link
	ksud: fix clone symlink
	ksud: refine tmpfs
	ksud: add KSU_MAGIC_MOUNT to env (#5)
	manager: remove shrink image
	use module dir name as real id
	allow restore uninstalled module
	ksud: make tmpfs and magic mount optional
	ksud: fix stat
	reformat rust codes
	app: persist show system app settings

Other changes: (+44)
	ksud: move workdir to /mnt/vendor
	ksud: remove tmpfs mounting
	workflows: debloat
	ksud: add armeabi-v7a support
	manager:  failure mode dummy demo
	dummy.keystore
	manager: unofficial build
	manager: Add ABI and Kernel archirecture info into InfoCardItem
	kernel: drop LKM and kprobes support
	kernel: restore compat code required for old kernels
	kernel: expose allowlist workaround as Kconfig option
	kernel: core_hook: screw path_umount backport, call sys_umount directly
	kernel: handle backports
	kernel: core_hook: automate and refactor umount (tiann#2531)
	kernel: core_hook: only umount when unmountable > 0
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656)
	kernel: sucompat: sucompat toggle support for non-kp (tiann#2506)
	kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653)
	kernel: core_hook: intercept devpts via security_inode_permission LSM
	kernel: compat: migrate sucompat strncpy_from_user to copy_from_user
	kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels
	kernel: ksud: provide dummy handlers for old hooks
	kernel: core_hook: earlier escape_to_root already-root check
	kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig
	kernel: sucompat: provide do_execve_common handler for <= 3.13
	kernel: ksud: provide is_ksu_transition check v2
	kernel: core_hook: no ext4_unregister_sysfs, no problem
	kernel: throne_tracker: add strscpy/strlcpy compat
	kernel: ksud: d_is_reg to IS_REG
	kernel: Makefile: remove overlayfs requirement
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle read_iter requirement conditionally
	kernel: apk_sign: casting to char for strcmp -> memcmp
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: compat: inline iterate_dir -> vfs_readdir compat
	kernel: apk_sign: fix return check for ksu_sha256
	kernel: apk_sign: add more size/hash pairs
	kernel: ksu: printout quirks / backports / etc on init
	kernel: sucompat: provide getname_flags (user) ultimatum hook
	kernel: sucompat: provide getname_flags (kernel) ultimatum hook
	kernel: core_hook: add support for KernelNoSU
	KernelSU v1.0.5+magic
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 31, 2025
monitors and lists all incoming mounts by hooking security_sb_mount
this requires ksud to go back and use sys_mount instead of fsopen + move_mount

this also fixes that MNT_DETACH issue. tiann#2386 (comment)
Modules also can create an overlay with KSU devname and it will be added to the list.

Context: aviraxp@c7facef#commitcomment-153941502

Stale: tiann#2531

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 31, 2025
Added from 5ec1cff@79c4a17 (+23)
	implement magic mount
	restorecon: set adb_file to system_file for module files
	magic_mount: use trusted.overlay.opaque
	chore: fmt
	magic_mount: supports whiteout
	chore: refine code
	magic_mount: fix
	log: make verbose logging optional
	magic_mount: refine
	ksud: fix disable / enable modules
	ksud: fix odm not magic-mounted
	manager: no need to check overlayfs
	ksud: fix partition link
	ksud: fix clone symlink
	ksud: refine tmpfs
	ksud: add KSU_MAGIC_MOUNT to env (#5)
	manager: remove shrink image
	use module dir name as real id
	allow restore uninstalled module
	ksud: make tmpfs and magic mount optional
	ksud: fix stat
	reformat rust codes
	app: persist show system app settings

Other changes: (+44)
	ksud: move workdir to /mnt/vendor
	ksud: remove tmpfs mounting
	workflows: debloat
	ksud: add armeabi-v7a support
	manager:  failure mode dummy demo
	dummy.keystore
	manager: unofficial build
	manager: Add ABI and Kernel archirecture info into InfoCardItem
	kernel: drop LKM and kprobes support
	kernel: restore compat code required for old kernels
	kernel: expose allowlist workaround as Kconfig option
	kernel: core_hook: screw path_umount backport, call sys_umount directly
	kernel: handle backports
	kernel: core_hook: automate and refactor umount (tiann#2531)
	kernel: core_hook: only umount when unmountable > 0
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656)
	kernel: sucompat: sucompat toggle support for non-kp (tiann#2506)
	kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653)
	kernel: core_hook: intercept devpts via security_inode_permission LSM
	kernel: compat: migrate sucompat strncpy_from_user to copy_from_user
	kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels
	kernel: ksud: provide dummy handlers for old hooks
	kernel: core_hook: earlier escape_to_root already-root check
	kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig
	kernel: sucompat: provide do_execve_common handler for <= 3.13
	kernel: ksud: provide is_ksu_transition check v2
	kernel: core_hook: no ext4_unregister_sysfs, no problem
	kernel: throne_tracker: add strscpy/strlcpy compat
	kernel: ksud: d_is_reg to IS_REG
	kernel: Makefile: remove overlayfs requirement
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle read_iter requirement conditionally
	kernel: apk_sign: casting to char for strcmp -> memcmp
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: compat: inline iterate_dir -> vfs_readdir compat
	kernel: apk_sign: fix return check for ksu_sha256
	kernel: apk_sign: add more size/hash pairs
	kernel: ksu: printout quirks / backports / etc on init
	kernel: sucompat: provide getname_flags (user) ultimatum hook
	kernel: sucompat: provide getname_flags (kernel) ultimatum hook
	kernel: core_hook: add support for KernelNoSU
	KernelSU v1.0.5+magic
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 31, 2025
Added from 5ec1cff@79c4a17 (+23)
	implement magic mount
	restorecon: set adb_file to system_file for module files
	magic_mount: use trusted.overlay.opaque
	chore: fmt
	magic_mount: supports whiteout
	chore: refine code
	magic_mount: fix
	log: make verbose logging optional
	magic_mount: refine
	ksud: fix disable / enable modules
	ksud: fix odm not magic-mounted
	manager: no need to check overlayfs
	ksud: fix partition link
	ksud: fix clone symlink
	ksud: refine tmpfs
	ksud: add KSU_MAGIC_MOUNT to env (5ec1cff#5)
	manager: remove shrink image
	use module dir name as real id
	allow restore uninstalled module
	ksud: make tmpfs and magic mount optional
	ksud: fix stat
	reformat rust codes
	app: persist show system app settings

Other changes: (+44)
	ksud: move workdir to /mnt/vendor
	ksud: remove tmpfs mounting
	workflows: debloat
	ksud: add armeabi-v7a support
	manager:  failure mode dummy demo
	dummy.keystore
	manager: unofficial build
	manager: Add ABI and Kernel archirecture info into InfoCardItem
	kernel: drop LKM and kprobes support
	kernel: restore compat code required for old kernels
	kernel: expose allowlist workaround as Kconfig option
	kernel: core_hook: screw path_umount backport, call sys_umount directly
	kernel: handle backports
	kernel: core_hook: automate and refactor umount (tiann#2531)
	kernel: core_hook: only umount when unmountable > 0
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656)
	kernel: sucompat: sucompat toggle support for non-kp (tiann#2506)
	kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653)
	kernel: core_hook: intercept devpts via security_inode_permission LSM
	kernel: compat: migrate sucompat strncpy_from_user to copy_from_user
	kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels
	kernel: ksud: provide dummy handlers for old hooks
	kernel: core_hook: earlier escape_to_root already-root check
	kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig
	kernel: sucompat: provide do_execve_common handler for <= 3.13
	kernel: ksud: provide is_ksu_transition check v2
	kernel: core_hook: no ext4_unregister_sysfs, no problem
	kernel: throne_tracker: add strscpy/strlcpy compat
	kernel: ksud: d_is_reg to IS_REG
	kernel: Makefile: remove overlayfs requirement
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle read_iter requirement conditionally
	kernel: apk_sign: casting to char for strcmp -> memcmp
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: compat: inline iterate_dir -> vfs_readdir compat
	kernel: apk_sign: fix return check for ksu_sha256
	kernel: apk_sign: add more size/hash pairs
	kernel: ksu: printout quirks / backports / etc on init
	kernel: sucompat: provide getname_flags (user) ultimatum hook
	kernel: sucompat: provide getname_flags (kernel) ultimatum hook
	kernel: core_hook: add support for KernelNoSU
	KernelSU v1.0.5+magic
@backslashxx backslashxx mentioned this pull request Sep 1, 2025
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Sep 2, 2025
monitors and lists all incoming mounts by hooking security_sb_mount
this requires ksud to go back and use sys_mount instead of fsopen + move_mount

this also fixes that MNT_DETACH issue. tiann#2386 (comment)
Modules also can create an overlay with KSU devname and it will be added to the list.

Context: aviraxp@c7facef#commitcomment-153941502

Stale: tiann#2531

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Sep 2, 2025
Added from 5ec1cff@79c4a17 (+23)
	implement magic mount
	restorecon: set adb_file to system_file for module files
	magic_mount: use trusted.overlay.opaque
	chore: fmt
	magic_mount: supports whiteout
	chore: refine code
	magic_mount: fix
	log: make verbose logging optional
	magic_mount: refine
	ksud: fix disable / enable modules
	ksud: fix odm not magic-mounted
	manager: no need to check overlayfs
	ksud: fix partition link
	ksud: fix clone symlink
	ksud: refine tmpfs
	ksud: add KSU_MAGIC_MOUNT to env (5ec1cff#5)
	manager: remove shrink image
	use module dir name as real id
	allow restore uninstalled module
	ksud: make tmpfs and magic mount optional
	ksud: fix stat
	reformat rust codes
	app: persist show system app settings

Other changes: (+44)
	ksud: move workdir to /mnt/vendor
	ksud: remove tmpfs mounting
	workflows: debloat
	ksud: add armeabi-v7a support
	manager:  failure mode dummy demo
	dummy.keystore
	manager: unofficial build
	manager: Add ABI and Kernel archirecture info into InfoCardItem
	kernel: drop LKM and kprobes support
	kernel: restore compat code required for old kernels
	kernel: expose allowlist workaround as Kconfig option
	kernel: core_hook: screw path_umount backport, call sys_umount directly
	kernel: handle backports
	kernel: core_hook: automate and refactor umount (tiann#2531)
	kernel: core_hook: only umount when unmountable > 0
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656)
	kernel: sucompat: sucompat toggle support for non-kp (tiann#2506)
	kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653)
	kernel: core_hook: intercept devpts via security_inode_permission LSM
	kernel: compat: migrate sucompat strncpy_from_user to copy_from_user
	kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels
	kernel: ksud: provide dummy handlers for old hooks
	kernel: core_hook: earlier escape_to_root already-root check
	kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig
	kernel: sucompat: provide do_execve_common handler for <= 3.13
	kernel: ksud: provide is_ksu_transition check v2
	kernel: core_hook: no ext4_unregister_sysfs, no problem
	kernel: throne_tracker: add strscpy/strlcpy compat
	kernel: ksud: d_is_reg to IS_REG
	kernel: Makefile: remove overlayfs requirement
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle read_iter requirement conditionally
	kernel: apk_sign: casting to char for strcmp -> memcmp
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: compat: inline iterate_dir -> vfs_readdir compat
	kernel: apk_sign: fix return check for ksu_sha256
	kernel: apk_sign: add more size/hash pairs
	kernel: ksu: printout quirks / backports / etc on init
	kernel: sucompat: provide getname_flags (user) ultimatum hook
	kernel: sucompat: provide getname_flags (kernel) ultimatum hook
	kernel: core_hook: add support for KernelNoSU
	KernelSU v1.0.5+magic
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Sep 10, 2025
Added from 5ec1cff@79c4a17 (+23)
	implement magic mount
	restorecon: set adb_file to system_file for module files
	magic_mount: use trusted.overlay.opaque
	chore: fmt
	magic_mount: supports whiteout
	chore: refine code
	magic_mount: fix
	log: make verbose logging optional
	magic_mount: refine
	ksud: fix disable / enable modules
	ksud: fix odm not magic-mounted
	manager: no need to check overlayfs
	ksud: fix partition link
	ksud: fix clone symlink
	ksud: refine tmpfs
	ksud: add KSU_MAGIC_MOUNT to env (5ec1cff#5)
	manager: remove shrink image
	use module dir name as real id
	allow restore uninstalled module
	ksud: make tmpfs and magic mount optional
	ksud: fix stat
	reformat rust codes
	app: persist show system app settings

Other changes: (+44)
	ksud: move workdir to /mnt/vendor
	ksud: remove tmpfs mounting
	workflows: debloat
	ksud: add armeabi-v7a support
	manager:  failure mode dummy demo
	dummy.keystore
	manager: unofficial build
	manager: Add ABI and Kernel archirecture info into InfoCardItem
	kernel: drop LKM and kprobes support
	kernel: restore compat code required for old kernels
	kernel: expose allowlist workaround as Kconfig option
	kernel: core_hook: screw path_umount backport, call sys_umount directly
	kernel: handle backports
	kernel: core_hook: automate and refactor umount (tiann#2531)
	kernel: core_hook: only umount when unmountable > 0
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656)
	kernel: sucompat: sucompat toggle support for non-kp (tiann#2506)
	kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653)
	kernel: core_hook: intercept devpts via security_inode_permission LSM
	kernel: compat: migrate sucompat strncpy_from_user to copy_from_user
	kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels
	kernel: ksud: provide dummy handlers for old hooks
	kernel: core_hook: earlier escape_to_root already-root check
	kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig
	kernel: sucompat: provide do_execve_common handler for <= 3.13
	kernel: ksud: provide is_ksu_transition check v2
	kernel: core_hook: no ext4_unregister_sysfs, no problem
	kernel: throne_tracker: add strscpy/strlcpy compat
	kernel: ksud: d_is_reg to IS_REG
	kernel: Makefile: remove overlayfs requirement
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle read_iter requirement conditionally
	kernel: apk_sign: casting to char for strcmp -> memcmp
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: compat: inline iterate_dir -> vfs_readdir compat
	kernel: apk_sign: fix return check for ksu_sha256
	kernel: apk_sign: add more size/hash pairs
	kernel: ksu: printout quirks / backports / etc on init
	kernel: sucompat: provide getname_flags (user) ultimatum hook
	kernel: sucompat: provide getname_flags (kernel) ultimatum hook
	kernel: core_hook: add support for KernelNoSU
	KernelSU v1.0.5+magic
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Sep 10, 2025
Added from 5ec1cff@79c4a17 (+23)
	implement magic mount
	restorecon: set adb_file to system_file for module files
	magic_mount: use trusted.overlay.opaque
	chore: fmt
	magic_mount: supports whiteout
	chore: refine code
	magic_mount: fix
	log: make verbose logging optional
	magic_mount: refine
	ksud: fix disable / enable modules
	ksud: fix odm not magic-mounted
	manager: no need to check overlayfs
	ksud: fix partition link
	ksud: fix clone symlink
	ksud: refine tmpfs
	ksud: add KSU_MAGIC_MOUNT to env (5ec1cff#5)
	manager: remove shrink image
	use module dir name as real id
	allow restore uninstalled module
	ksud: make tmpfs and magic mount optional
	ksud: fix stat
	reformat rust codes
	app: persist show system app settings

Other changes: (+44)
	ksud: move workdir to /mnt/vendor
	ksud: remove tmpfs mounting
	workflows: debloat
	ksud: add armeabi-v7a support
	manager:  failure mode dummy demo
	dummy.keystore
	manager: unofficial build
	manager: Add ABI and Kernel archirecture info into InfoCardItem
	kernel: drop LKM and kprobes support
	kernel: restore compat code required for old kernels
	kernel: expose allowlist workaround as Kconfig option
	kernel: core_hook: screw path_umount backport, call sys_umount directly
	kernel: handle backports
	kernel: core_hook: automate and refactor umount (tiann#2531)
	kernel: core_hook: only umount when unmountable > 0
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656)
	kernel: sucompat: sucompat toggle support for non-kp (tiann#2506)
	kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653)
	kernel: core_hook: intercept devpts via security_inode_permission LSM
	kernel: compat: migrate sucompat strncpy_from_user to copy_from_user
	kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels
	kernel: ksud: provide dummy handlers for old hooks
	kernel: core_hook: earlier escape_to_root already-root check
	kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig
	kernel: sucompat: provide do_execve_common handler for <= 3.13
	kernel: ksud: provide is_ksu_transition check v2
	kernel: core_hook: no ext4_unregister_sysfs, no problem
	kernel: throne_tracker: add strscpy/strlcpy compat
	kernel: ksud: d_is_reg to IS_REG
	kernel: Makefile: remove overlayfs requirement
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle read_iter requirement conditionally
	kernel: apk_sign: casting to char for strcmp -> memcmp
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: compat: inline iterate_dir -> vfs_readdir compat
	kernel: apk_sign: fix return check for ksu_sha256
	kernel: apk_sign: add more size/hash pairs
	kernel: ksu: printout quirks / backports / etc on init
	kernel: sucompat: provide getname_flags (user) ultimatum hook
	kernel: sucompat: provide getname_flags (kernel) ultimatum hook
	kernel: core_hook: add support for KernelNoSU
	KernelSU v1.0.5+magic
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Sep 10, 2025
Added from 5ec1cff@79c4a17 (+23)
	implement magic mount
	restorecon: set adb_file to system_file for module files
	magic_mount: use trusted.overlay.opaque
	chore: fmt
	magic_mount: supports whiteout
	chore: refine code
	magic_mount: fix
	log: make verbose logging optional
	magic_mount: refine
	ksud: fix disable / enable modules
	ksud: fix odm not magic-mounted
	manager: no need to check overlayfs
	ksud: fix partition link
	ksud: fix clone symlink
	ksud: refine tmpfs
	ksud: add KSU_MAGIC_MOUNT to env (5ec1cff#5)
	manager: remove shrink image
	use module dir name as real id
	allow restore uninstalled module
	ksud: make tmpfs and magic mount optional
	ksud: fix stat
	reformat rust codes
	app: persist show system app settings

Other changes: (+44)
	ksud: move workdir to /mnt/vendor
	ksud: remove tmpfs mounting
	workflows: debloat
	ksud: add armeabi-v7a support
	manager:  failure mode dummy demo
	dummy.keystore
	manager: unofficial build
	manager: Add ABI and Kernel archirecture info into InfoCardItem
	kernel: drop LKM and kprobes support
	kernel: restore compat code required for old kernels
	kernel: expose allowlist workaround as Kconfig option
	kernel: core_hook: screw path_umount backport, call sys_umount directly
	kernel: handle backports
	kernel: core_hook: automate and refactor umount (tiann#2531)
	kernel: core_hook: only umount when unmountable > 0
	kernel: throne_tracker: offload to kthread (tiann#2632)
	kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656)
	kernel: sucompat: sucompat toggle support for non-kp (tiann#2506)
	kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653)
	kernel: core_hook: intercept devpts via security_inode_permission LSM
	kernel: compat: migrate sucompat strncpy_from_user to copy_from_user
	kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels
	kernel: ksud: provide dummy handlers for old hooks
	kernel: core_hook: earlier escape_to_root already-root check
	kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig
	kernel: sucompat: provide do_execve_common handler for <= 3.13
	kernel: ksud: provide is_ksu_transition check v2
	kernel: core_hook: no ext4_unregister_sysfs, no problem
	kernel: throne_tracker: add strscpy/strlcpy compat
	kernel: ksud: d_is_reg to IS_REG
	kernel: Makefile: remove overlayfs requirement
	kernel: throne_tracker: resolve s_magic for < 3.9
	kernel: ksud: handle read_iter requirement conditionally
	kernel: apk_sign: casting to char for strcmp -> memcmp
	kernel: apk_sign: migrate generic_file_llseek -> vfs_llseek
	kernel: throne_tracker: handle filldir_t ABI mismatch on <= 3.18
	kernel: compat: inline iterate_dir -> vfs_readdir compat
	kernel: apk_sign: fix return check for ksu_sha256
	kernel: apk_sign: add more size/hash pairs
	kernel: ksu: printout quirks / backports / etc on init
	kernel: sucompat: provide getname_flags (user) ultimatum hook
	kernel: sucompat: provide getname_flags (kernel) ultimatum hook
	kernel: core_hook: add support for KernelNoSU
	KernelSU v1.0.5+magic
yamaizano pushed a commit to yamaizano/KernelSU that referenced this pull request Sep 21, 2025
monitors and lists all incoming mounts by hooking security_sb_mount
this requires ksud to go back and use sys_mount instead of fsopen + move_mount

this also fixes that MNT_DETACH issue. tiann#2386 (comment)
Modules also can create an overlay with KSU devname and it will be added to the list.

Context: aviraxp@c7facef#commitcomment-153941502

Stale: tiann#2531

Signed-off-by: backslashxx <[email protected]>
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.

5 participants