-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
kernel: ksud: dont create structs just to deconstruct them for a string #2595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Signed-off-by: backslashxx <[email protected]>
e4b8dc4
to
fb61235
Compare
Which kernels lack this struct? |
ah yeah, that is actually irrelevant for current ksu, but this is introduced on 3.7-rc1 |
This is not good, it transforms an explicit dependency into an implicit one. |
which? this is the only part on kprobes that needs filename struct, execve_sucompat hook doesnt use it already, you might as well free this part from struct filename use |
So, why should we care about pre-3.7 kernels? |
you dont have to, but this is still creating a dummy struct that it just deconstructs. |
The first member of the struct filename is |
I don't understand why that is a good thing. isnt the flow like sys_execve --> kprobe --> sys_execve_handler_pre --> create dummy struct filename --> ksu_handle_execveat_ksud now itll be like sys_execve --> kprobe --> sys_execve_handler_pre --> __ksu_handle_execveat_ksud |
the struct is allocated on stack, which is very cheap. |
__ksu_handle_execve_ksud was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
__ksu_handle_execve_ksud was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
__ksu_handle_execve_ksud was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann/KernelSU#2595 Signed-off-by: backslashxx <[email protected]>
sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
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 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 ksud: probe for more workdir candidates (#12) app: persist show system app settings Other changes: (+26) 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: require backports kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig kernel: sucompat: sucompat toggle support for non-kp (tiann#2506) kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) kernel: ksud: add ksu_handle_execve_ksud v2 kernel: core_hook: try umount /system/etc/hosts (tiann#1494) kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels kernel: ksud: provide ksu_handle_compat_execve_ksud v2 kernel: ksud: commonize execve_ksud handlers kernel: sucompat: increase reliability of execve_sucompat kernel: sucompat: micro-opt exec handlers - move permission check up kernel: Makefile: sanity checks kernel: apk_sign: add more size/hash pairs kernel: expose KSU_USE_STRUCT_FILENAME on Kconfig kernel: ksud, sucompat: micro-opt, drop redundant memset before strncpy KernelSU v1.0.5+magic Warning: Managers built from this repo has a known keystore. See dummy.keystore. Signed-off-by: backslashxx <[email protected]>
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 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 ksud: probe for more workdir candidates (#12) app: persist show system app settings Other changes: (+26) 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: require backports kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig kernel: sucompat: sucompat toggle support for non-kp (tiann#2506) kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) kernel: ksud: add ksu_handle_execve_ksud v2 kernel: core_hook: try umount /system/etc/hosts (tiann#1494) kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels kernel: ksud: provide ksu_handle_compat_execve_ksud v2 kernel: ksud: commonize execve_ksud handlers kernel: sucompat: increase reliability of execve_sucompat kernel: sucompat: micro-opt exec handlers - move permission check up kernel: Makefile: sanity checks kernel: apk_sign: add more size/hash pairs kernel: expose KSU_USE_STRUCT_FILENAME on Kconfig kernel: ksud, sucompat: micro-opt, drop redundant memset before strncpy KernelSU v1.0.5+magic Warning: Managers built from this repo has a known keystore. See dummy.keystore. Signed-off-by: backslashxx <[email protected]>
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 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 ksud: probe for more workdir candidates (#12) app: persist show system app settings Other changes: (+26) 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: require backports kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig kernel: sucompat: sucompat toggle support for non-kp (tiann#2506) kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) kernel: ksud: add ksu_handle_execve_ksud v2 kernel: core_hook: try umount /system/etc/hosts (tiann#1494) kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels kernel: ksud: provide ksu_handle_compat_execve_ksud v2 kernel: ksud: commonize execve_ksud handlers kernel: sucompat: increase reliability of execve_sucompat kernel: sucompat: micro-opt exec handlers - move permission check up kernel: Makefile: sanity checks kernel: apk_sign: add more size/hash pairs kernel: expose KSU_USE_STRUCT_FILENAME on Kconfig kernel: ksud, sucompat: micro-opt, drop redundant memset before strncpy KernelSU v1.0.5+magic Warning: Managers built from this repo has a known keystore. See dummy.keystore. Signed-off-by: backslashxx <[email protected]>
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 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 ksud: probe for more workdir candidates (#12) app: persist show system app settings Other changes: (+26) 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: require backports kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig kernel: sucompat: sucompat toggle support for non-kp (tiann#2506) kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) kernel: ksud: add ksu_handle_execve_ksud v2 kernel: core_hook: try umount /system/etc/hosts (tiann#1494) kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels kernel: ksud: provide ksu_handle_compat_execve_ksud v2 kernel: ksud: commonize execve_ksud handlers kernel: sucompat: increase reliability of execve_sucompat kernel: sucompat: micro-opt exec handlers - move permission check up kernel: Makefile: sanity checks kernel: apk_sign: add more size/hash pairs kernel: opt-out of struct filename use when unused kernel: ksud, sucompat: micro-opt, drop redundant memset before strncpy KernelSU v1.0.5+magic Warning: Managers built from this repo has a known keystore. See dummy.keystore. Signed-off-by: backslashxx <[email protected]>
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 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 ksud: probe for more workdir candidates (#12) app: persist show system app settings Other changes: (+26) 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: require backports kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig kernel: sucompat: sucompat toggle support for non-kp (tiann#2506) kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) kernel: ksud: add ksu_handle_execve_ksud v2 kernel: core_hook: try umount /system/etc/hosts (tiann#1494) kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels kernel: ksud: provide ksu_handle_compat_execve_ksud v2 kernel: ksud: commonize execve_ksud handlers kernel: sucompat: increase reliability of execve_sucompat kernel: sucompat: micro-opt exec handlers - move permission check up kernel: Makefile: sanity checks kernel: apk_sign: add more size/hash pairs kernel: opt-out of struct filename use when unused kernel: ksud, sucompat: micro-opt, drop redundant memset before strncpy KernelSU v1.0.5+magic Warning: Managers built from this repo has a known keystore. See dummy.keystore. Signed-off-by: backslashxx <[email protected]>
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 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 ksud: probe for more workdir candidates (#12) app: persist show system app settings Other changes: (+26) 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: require backports kernel: expose KSU_LSM_SECURITY_HOOKS on Kconfig kernel: sucompat: sucompat toggle support for non-kp (tiann#2506) kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) kernel: ksud: add ksu_handle_execve_ksud v2 kernel: core_hook: try umount /system/etc/hosts (tiann#1494) kernel: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels kernel: ksud: provide ksu_handle_compat_execve_ksud v2 kernel: ksud: commonize execve_ksud handlers kernel: sucompat: increase reliability of execve_sucompat kernel: sucompat: micro-opt exec handlers - move permission check up kernel: Makefile: sanity checks kernel: apk_sign: add more size/hash pairs kernel: opt-out of struct filename use when unused kernel: ksud, sucompat: micro-opt, drop redundant memset before strncpy KernelSU v1.0.5+magic Warning: Managers built from this repo has a known keystore. See dummy.keystore. Signed-off-by: backslashxx <[email protected]>
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: (+51) 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: sucompat: sucompat toggle support for non-kp (tiann#2506) 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: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) kernel: ksud: add commonized execve/compat_execve hooks for ksud kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656) kernel: core_hook: intercept devpts via security_inode_permission LSM kernel: sucompat: dummify and micro-optimize devpts hook kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653) kernel: sucompat: strncpy_from_user -> copy_from_user kernel: ksud: reuse bprm_ksud logic on old handlers kernel: ksud: remove and no-op old hooks kernel: compat: handle strncpy_from_user -> copy_from_user migration kernel: core_hook: fixup 32-on-64 compat detection via linux_binprm 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]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
This commit squashes the following: - kernel: ksud: commonize execve_ksud handlers - kernel: ksud: provide ksu_handle_compat_execve_ksud v2 - kernel: ksud: add ksu_handle_execve_ksud v2 This finalizes syscall-only hooking for KernelSU as we provide both native and compat. - sys_execve - ksu_handle_execve_ksud - compat_sys_execve - ksu_handle_compat_execve_ksud since these two share common logic, we commonize them to ksu_common_execve_ksud sinc only the argv field is different. (.native vs .compat) usage: ksu_handle_execve_ksud(filename, argv); // for sys_execve ksu_handle_compat_execve_ksud(filename, argv); // for compat_sys_execve This implementations avoids any dependency on struct filename making it also usable on Ultra-Legacy. Requires: - kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) original logic was taken from sys_execve_handler_pre upstream: tiann@2027ac3 Tested-by: selfmusing <[email protected]> Tested-by: Adam W. Willis <[email protected]> Tested-by: alternoegraha <[email protected]> Tested-by: iDead XD <[email protected]> Tested-by: rsuntk <[email protected]> Signed-off-by: backslashxx <[email protected]> Co-Authored-By: Another Guy <[email protected]>
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: (+51) 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: sucompat: sucompat toggle support for non-kp (tiann#2506) 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: selinux: fix pointer mismatch with 32-bit ksud on 64-bit kernels kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) kernel: ksud: add commonized execve/compat_execve hooks for ksud kernel: sucompat: increase reliability, commonize and micro-optimize (tiann#2656) kernel: core_hook: intercept devpts via security_inode_permission LSM kernel: sucompat: dummify and micro-optimize devpts hook kernel: ksud: migrate ksud execution to security_bprm_check (tiann#2653) kernel: sucompat: strncpy_from_user -> copy_from_user kernel: ksud: reuse bprm_ksud logic on old handlers kernel: ksud: remove and no-op old hooks kernel: compat: handle strncpy_from_user -> copy_from_user migration kernel: core_hook: fixup 32-on-64 compat detection via linux_binprm 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]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
This commit squashes the following: - kernel: ksud: commonize execve_ksud handlers - kernel: ksud: provide ksu_handle_compat_execve_ksud v2 - kernel: ksud: add ksu_handle_execve_ksud v2 This finalizes syscall-only hooking for KernelSU as we provide both native and compat. - sys_execve - ksu_handle_execve_ksud - compat_sys_execve - ksu_handle_compat_execve_ksud since these two share common logic, we commonize them to ksu_common_execve_ksud sinc only the argv field is different. (.native vs .compat) usage: ksu_handle_execve_ksud(filename, argv); // for sys_execve ksu_handle_compat_execve_ksud(filename, argv); // for compat_sys_execve This implementations avoids any dependency on struct filename making it also usable on Ultra-Legacy. Requires: - kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) original logic was taken from sys_execve_handler_pre upstream: tiann@2027ac3 Tested-by: selfmusing <[email protected]> Tested-by: Adam W. Willis <[email protected]> Tested-by: alternoegraha <[email protected]> Tested-by: iDead XD <[email protected]> Tested-by: rsuntk <[email protected]> Signed-off-by: backslashxx <[email protected]> Co-Authored-By: Another Guy <[email protected]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
This commit squashes the following: - kernel: ksud: commonize execve_ksud handlers - kernel: ksud: provide ksu_handle_compat_execve_ksud v2 - kernel: ksud: add ksu_handle_execve_ksud v2 This finalizes syscall-only hooking for KernelSU as we provide both native and compat. - sys_execve - ksu_handle_execve_ksud - compat_sys_execve - ksu_handle_compat_execve_ksud since these two share common logic, we commonize them to ksu_common_execve_ksud sinc only the argv field is different. (.native vs .compat) usage: ksu_handle_execve_ksud(filename, argv); // for sys_execve ksu_handle_compat_execve_ksud(filename, argv); // for compat_sys_execve This implementations avoids any dependency on struct filename making it also usable on Ultra-Legacy. Requires: - kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) original logic was taken from sys_execve_handler_pre upstream: tiann@2027ac3 Tested-by: selfmusing <[email protected]> Tested-by: Adam W. Willis <[email protected]> Tested-by: alternoegraha <[email protected]> Tested-by: iDead XD <[email protected]> Tested-by: rsuntk <[email protected]> Signed-off-by: backslashxx <[email protected]> Co-Authored-By: Another Guy <[email protected]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
This commit squashes the following: - kernel: ksud: commonize execve_ksud handlers - kernel: ksud: provide ksu_handle_compat_execve_ksud v2 - kernel: ksud: add ksu_handle_execve_ksud v2 This finalizes syscall-only hooking for KernelSU as we provide both native and compat. - sys_execve - ksu_handle_execve_ksud - compat_sys_execve - ksu_handle_compat_execve_ksud since these two share common logic, we commonize them to ksu_common_execve_ksud sinc only the argv field is different. (.native vs .compat) usage: ksu_handle_execve_ksud(filename, argv); // for sys_execve ksu_handle_compat_execve_ksud(filename, argv); // for compat_sys_execve This implementations avoids any dependency on struct filename making it also usable on Ultra-Legacy. Requires: - kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) original logic was taken from sys_execve_handler_pre upstream: tiann@2027ac3 Tested-by: selfmusing <[email protected]> Tested-by: Adam W. Willis <[email protected]> Tested-by: alternoegraha <[email protected]> Tested-by: iDead XD <[email protected]> Tested-by: rsuntk <[email protected]> Signed-off-by: backslashxx <[email protected]> Co-Authored-By: Another Guy <[email protected]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
This commit squashes the following: - kernel: ksud: commonize execve_ksud handlers - kernel: ksud: provide ksu_handle_compat_execve_ksud v2 - kernel: ksud: add ksu_handle_execve_ksud v2 This finalizes syscall-only hooking for KernelSU as we provide both native and compat. - sys_execve - ksu_handle_execve_ksud - compat_sys_execve - ksu_handle_compat_execve_ksud since these two share common logic, we commonize them to ksu_common_execve_ksud sinc only the argv field is different. (.native vs .compat) usage: ksu_handle_execve_ksud(filename, argv); // for sys_execve ksu_handle_compat_execve_ksud(filename, argv); // for compat_sys_execve This implementations avoids any dependency on struct filename making it also usable on Ultra-Legacy. Requires: - kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) original logic was taken from sys_execve_handler_pre upstream: tiann@2027ac3 Tested-by: selfmusing <[email protected]> Tested-by: Adam W. Willis <[email protected]> Tested-by: alternoegraha <[email protected]> Tested-by: iDead XD <[email protected]> Tested-by: rsuntk <[email protected]> Signed-off-by: backslashxx <[email protected]> Co-Authored-By: Another Guy <[email protected]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
This commit squashes the following: - kernel: ksud: commonize execve_ksud handlers - kernel: ksud: provide ksu_handle_compat_execve_ksud v2 - kernel: ksud: add ksu_handle_execve_ksud v2 This finalizes syscall-only hooking for KernelSU as we provide both native and compat. - sys_execve - ksu_handle_execve_ksud - compat_sys_execve - ksu_handle_compat_execve_ksud since these two share common logic, we commonize them to ksu_common_execve_ksud sinc only the argv field is different. (.native vs .compat) usage: ksu_handle_execve_ksud(filename, argv); // for sys_execve ksu_handle_compat_execve_ksud(filename, argv); // for compat_sys_execve This implementations avoids any dependency on struct filename making it also usable on Ultra-Legacy. Requires: - kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) original logic was taken from sys_execve_handler_pre upstream: tiann@2027ac3 Tested-by: selfmusing <[email protected]> Tested-by: Adam W. Willis <[email protected]> Tested-by: alternoegraha <[email protected]> Tested-by: iDead XD <[email protected]> Tested-by: rsuntk <[email protected]> Signed-off-by: backslashxx <[email protected]> Co-Authored-By: Another Guy <[email protected]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
This commit squashes the following: - kernel: ksud: commonize execve_ksud handlers - kernel: ksud: provide ksu_handle_compat_execve_ksud v2 - kernel: ksud: add ksu_handle_execve_ksud v2 This finalizes syscall-only hooking for KernelSU as we provide both native and compat. - sys_execve - ksu_handle_execve_ksud - compat_sys_execve - ksu_handle_compat_execve_ksud since these two share common logic, we commonize them to ksu_common_execve_ksud sinc only the argv field is different. (.native vs .compat) usage: ksu_handle_execve_ksud(filename, argv); // for sys_execve ksu_handle_compat_execve_ksud(filename, argv); // for compat_sys_execve This implementations avoids any dependency on struct filename making it also usable on Ultra-Legacy. Requires: - kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) original logic was taken from sys_execve_handler_pre upstream: tiann@2027ac3 Tested-by: selfmusing <[email protected]> Tested-by: Adam W. Willis <[email protected]> Tested-by: alternoegraha <[email protected]> Tested-by: iDead XD <[email protected]> Tested-by: rsuntk <[email protected]> Signed-off-by: backslashxx <[email protected]> Co-Authored-By: Another Guy <[email protected]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
This commit squashes the following: - kernel: ksud: commonize execve_ksud handlers - kernel: ksud: provide ksu_handle_compat_execve_ksud v2 - kernel: ksud: add ksu_handle_execve_ksud v2 This finalizes syscall-only hooking for KernelSU as we provide both native and compat. - sys_execve - ksu_handle_execve_ksud - compat_sys_execve - ksu_handle_compat_execve_ksud since these two share common logic, we commonize them to ksu_common_execve_ksud sinc only the argv field is different. (.native vs .compat) usage: ksu_handle_execve_ksud(filename, argv); // for sys_execve ksu_handle_compat_execve_ksud(filename, argv); // for compat_sys_execve This implementations avoids any dependency on struct filename making it also usable on Ultra-Legacy. Requires: - kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) original logic was taken from sys_execve_handler_pre upstream: tiann@2027ac3 Tested-by: selfmusing <[email protected]> Tested-by: Adam W. Willis <[email protected]> Tested-by: alternoegraha <[email protected]> Tested-by: iDead XD <[email protected]> Tested-by: rsuntk <[email protected]> Signed-off-by: backslashxx <[email protected]> Co-Authored-By: Another Guy <[email protected]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
This commit squashes the following: - kernel: ksud: commonize execve_ksud handlers - kernel: ksud: provide ksu_handle_compat_execve_ksud v2 - kernel: ksud: add ksu_handle_execve_ksud v2 This finalizes syscall-only hooking for KernelSU as we provide both native and compat. - sys_execve - ksu_handle_execve_ksud - compat_sys_execve - ksu_handle_compat_execve_ksud since these two share common logic, we commonize them to ksu_common_execve_ksud sinc only the argv field is different. (.native vs .compat) usage: ksu_handle_execve_ksud(filename, argv); // for sys_execve ksu_handle_compat_execve_ksud(filename, argv); // for compat_sys_execve This implementations avoids any dependency on struct filename making it also usable on Ultra-Legacy. Requires: - kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) original logic was taken from sys_execve_handler_pre upstream: tiann@2027ac3 Tested-by: selfmusing <[email protected]> Tested-by: Adam W. Willis <[email protected]> Tested-by: alternoegraha <[email protected]> Tested-by: iDead XD <[email protected]> Tested-by: rsuntk <[email protected]> Signed-off-by: backslashxx <[email protected]> Co-Authored-By: Another Guy <[email protected]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
This commit squashes the following: - kernel: ksud: commonize execve_ksud handlers - kernel: ksud: provide ksu_handle_compat_execve_ksud v2 - kernel: ksud: add ksu_handle_execve_ksud v2 This finalizes syscall-only hooking for KernelSU as we provide both native and compat. - sys_execve - ksu_handle_execve_ksud - compat_sys_execve - ksu_handle_compat_execve_ksud since these two share common logic, we commonize them to ksu_common_execve_ksud sinc only the argv field is different. (.native vs .compat) usage: ksu_handle_execve_ksud(filename, argv); // for sys_execve ksu_handle_compat_execve_ksud(filename, argv); // for compat_sys_execve This implementations avoids any dependency on struct filename making it also usable on Ultra-Legacy. Requires: - kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) original logic was taken from sys_execve_handler_pre upstream: tiann@2027ac3 Tested-by: selfmusing <[email protected]> Tested-by: Adam W. Willis <[email protected]> Tested-by: alternoegraha <[email protected]> Tested-by: iDead XD <[email protected]> Tested-by: rsuntk <[email protected]> Signed-off-by: backslashxx <[email protected]> Co-Authored-By: Another Guy <[email protected]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
This commit squashes the following: - kernel: ksud: commonize execve_ksud handlers - kernel: ksud: provide ksu_handle_compat_execve_ksud v2 - kernel: ksud: add ksu_handle_execve_ksud v2 This finalizes syscall-only hooking for KernelSU as we provide both native and compat. - sys_execve - ksu_handle_execve_ksud - compat_sys_execve - ksu_handle_compat_execve_ksud since these two share common logic, we commonize them to ksu_common_execve_ksud sinc only the argv field is different. (.native vs .compat) usage: ksu_handle_execve_ksud(filename, argv); // for sys_execve ksu_handle_compat_execve_ksud(filename, argv); // for compat_sys_execve This implementations avoids any dependency on struct filename making it also usable on Ultra-Legacy. Requires: - kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) original logic was taken from sys_execve_handler_pre upstream: tiann@2027ac3 Tested-by: selfmusing <[email protected]> Tested-by: Adam W. Willis <[email protected]> Tested-by: alternoegraha <[email protected]> Tested-by: iDead XD <[email protected]> Tested-by: rsuntk <[email protected]> Signed-off-by: backslashxx <[email protected]> Co-Authored-By: Another Guy <[email protected]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
This commit squashes the following: - kernel: ksud: commonize execve_ksud handlers - kernel: ksud: provide ksu_handle_compat_execve_ksud v2 - kernel: ksud: add ksu_handle_execve_ksud v2 This finalizes syscall-only hooking for KernelSU as we provide both native and compat. - sys_execve - ksu_handle_execve_ksud - compat_sys_execve - ksu_handle_compat_execve_ksud since these two share common logic, we commonize them to ksu_common_execve_ksud sinc only the argv field is different. (.native vs .compat) usage: ksu_handle_execve_ksud(filename, argv); // for sys_execve ksu_handle_compat_execve_ksud(filename, argv); // for compat_sys_execve This implementations avoids any dependency on struct filename making it also usable on Ultra-Legacy. Requires: - kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) original logic was taken from sys_execve_handler_pre upstream: tiann@2027ac3 Tested-by: selfmusing <[email protected]> Tested-by: Adam W. Willis <[email protected]> Tested-by: alternoegraha <[email protected]> Tested-by: iDead XD <[email protected]> Tested-by: rsuntk <[email protected]> Signed-off-by: backslashxx <[email protected]> Co-Authored-By: Another Guy <[email protected]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
This commit squashes the following: - kernel: ksud: commonize execve_ksud handlers - kernel: ksud: provide ksu_handle_compat_execve_ksud v2 - kernel: ksud: add ksu_handle_execve_ksud v2 This finalizes syscall-only hooking for KernelSU as we provide both native and compat. - sys_execve - ksu_handle_execve_ksud - compat_sys_execve - ksu_handle_compat_execve_ksud since these two share common logic, we commonize them to ksu_common_execve_ksud sinc only the argv field is different. (.native vs .compat) usage: ksu_handle_execve_ksud(filename, argv); // for sys_execve ksu_handle_compat_execve_ksud(filename, argv); // for compat_sys_execve This implementations avoids any dependency on struct filename making it also usable on Ultra-Legacy. Requires: - kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) original logic was taken from sys_execve_handler_pre upstream: tiann@2027ac3 Tested-by: selfmusing <[email protected]> Tested-by: Adam W. Willis <[email protected]> Tested-by: alternoegraha <[email protected]> Tested-by: iDead XD <[email protected]> Tested-by: rsuntk <[email protected]> Signed-off-by: backslashxx <[email protected]> Co-Authored-By: Another Guy <[email protected]>
…ng (tiann#2595) sys_execve_handler_pre was building a fake struct filename just to pass it to ksu_handle_execveat_ksud, which immediately does... filename->name. ?? All we ever needed was filename->name, but we kept doing this meme where we manually built a struct filename, passed it around, then immediately ripped out the string again. ?? refactor this so that __ksu_handle_execveat_ksud, takes plain char *. The old ksu_handle_execveat_ksud is now a shim that unpacks the struct and hands off the string like we should’ve been doing from the start. Also mark ksu_handle_execveat_ksud as maybe unused as this will actually be unused on syscall-only builds. This also makes integration easier on kernels that don’t have struct filename. Rejected: tiann#2595 Signed-off-by: backslashxx <[email protected]>
This commit squashes the following: - kernel: ksud: commonize execve_ksud handlers - kernel: ksud: provide ksu_handle_compat_execve_ksud v2 - kernel: ksud: add ksu_handle_execve_ksud v2 This finalizes syscall-only hooking for KernelSU as we provide both native and compat. - sys_execve - ksu_handle_execve_ksud - compat_sys_execve - ksu_handle_compat_execve_ksud since these two share common logic, we commonize them to ksu_common_execve_ksud sinc only the argv field is different. (.native vs .compat) usage: ksu_handle_execve_ksud(filename, argv); // for sys_execve ksu_handle_compat_execve_ksud(filename, argv); // for compat_sys_execve This implementations avoids any dependency on struct filename making it also usable on Ultra-Legacy. Requires: - kernel: ksud: dont create structs just to deconstruct them for a string (tiann#2595) original logic was taken from sys_execve_handler_pre upstream: tiann@2027ac3 Tested-by: selfmusing <[email protected]> Tested-by: Adam W. Willis <[email protected]> Tested-by: alternoegraha <[email protected]> Tested-by: iDead XD <[email protected]> Tested-by: rsuntk <[email protected]> Signed-off-by: backslashxx <[email protected]> Co-Authored-By: Another Guy <[email protected]>
No description provided.