Skip to content

Conversation

@Tashar02
Copy link
Contributor

@Tashar02 Tashar02 commented Aug 4, 2025

No description provided.

Currently, handle_sepolicy() holds an RCU read lock across the entire
function including calls to strncpy_from_user() which can sleep, which
is illegal in RCU semantics.

This triggers the following warning when the kernel is compiled with
CONFIG_DEBUG_ATOMIC_SLEEP enabled:

[    8.526345] BUG: sleeping function called from invalid context at lib/strncpy_from_user.c:40
[    8.526349] in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 683, name: ksud
[    8.526351] preempt_count: 0, expected: 0
[    8.526352] RCU nest depth: 1, expected: 0
[    8.526354] 1 lock held by ksud/683:
[    8.526355] #0: ffffffe013e1b970 (rcu_read_lock){....}, at: handle_sepolicy+0xe4/0xaa0
[    8.526365] CPU: 6 PID: 683 Comm: ksud Tainted: G        W         5.4.289-Scarlet-v2.2-beta2 tiann#1
[    8.526366] Hardware name: redwood based Qualcomm Technologies, Inc. SM7325 (DT)
[    8.526367] Call trace:
[    8.526371] dump_backtrace+0x0/0x1c0
[    8.526374] dump_stack+0x90/0xcc
[    8.526376] __might_sleep+0x1a0/0x200
[    8.526378] __might_fault+0x28/0x40
[    8.526381] strncpy_from_user+0xac/0x300
[    8.526383] handle_sepolicy+0x588/0xaa0
[    8.526385] ksu_handle_prctl+0x368/0xd60
[    8.526386] ksu_task_prctl+0xc/0x20
[    8.526389] security_task_prctl+0x5c/0xa0
[    8.526391] __arm64_sys_prctl+0x58/0x7e0
[    8.526393] do_el0_svc+0x68/0x120
[    8.526394] el0_sync_handler+0x11c/0x1c0
[    8.526395] el0_sync+0x140/0x180

To fix this, replace the rcu_read_lock() with the `ksu_rules` mutex_lock()
introduced with commit 9014c66 ("kernel: selinux: rules: Fix illegal RCU
lock usage in apply_kernelsu_rules()") which allows sleeping.

This mutex_lock() ensures mutual exclusion between threads invoking dynamic
policy modifications via handle_sepolicy() and those applying KernelSU rules
via apply_kernelsu_rules(), both of which access the policydb structure through
get_policydb().

Signed-off-by: Tashfin Shakeer Rhythm <[email protected]>
…icydb()

get_policydb() uses rcu_dereference() to read pointers to selinux_state.policy.
But in the SELinux implementation, these pointers are assigned once during
initialization and never changed with rcu_assign_pointer(), rendering the
rcu_dereference() call in get_policydb() completely useless. This just adds
unwanted overhead and implies concurrency pattern that is not even present in
the kernel.

Therefore, read the pointers directly since it's safe.

Signed-off-by: Tashfin Shakeer Rhythm <[email protected]>
@Tashar02 Tashar02 changed the title Micro-optimization of get_policydb() and illegal lock usage fix in handle_sepolicy() kernel: selinux: rules: Micro-optimize get_policydb() and illegal RCU lock usage fix in handle_sepolicy() Aug 4, 2025
@Tashar02 Tashar02 changed the title kernel: selinux: rules: Micro-optimize get_policydb() and illegal RCU lock usage fix in handle_sepolicy() kernel: selinux: rules: Micro-optimize get_policydb() and fix illegal RCU lock usage in handle_sepolicy() Aug 5, 2025
@aviraxp aviraxp enabled auto-merge (squash) August 13, 2025 01:06
@aviraxp aviraxp merged commit 1ccdbc2 into tiann:main Aug 13, 2025
20 checks passed
pershoot pushed a commit to pershoot/KernelSU-Next that referenced this pull request Aug 13, 2025
… RCU lock usage in handle_sepolicy() (tiann/KernelSU#2695)

Signed-off-by: Tashfin Shakeer Rhythm <[email protected]>
LeCmnGend pushed a commit to LeCmnGend/KernelSU that referenced this pull request Aug 14, 2025
… RCU lock usage in handle_sepolicy() (tiann#2695)

Signed-off-by: Tashfin Shakeer Rhythm <[email protected]>
pershoot pushed a commit to pershoot/KernelSU-Next that referenced this pull request Aug 16, 2025
Trijal08 pushed a commit to Trijal08/KernelSU-Next that referenced this pull request Aug 24, 2025
sidex15 referenced this pull request in sidex15/KernelSU-A Aug 25, 2025
… RCU lock usage in handle_sepolicy() (#2695)

Signed-off-by: Tashfin Shakeer Rhythm <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 26, 2025
This commit restores compatibility code needed that was removed at tiann/KernelSU@898e9d4 .
where upstream dropped all pre-5.10 support

Reverts `kernel:Add Huawei hisi check (tiann#1545)`
	- upstream tiann/KernelSU@4f05fe2
	- superceded by `kernel: expose allowlist workaround as Kconfig option` on next commit

other changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
		- just use `ksu_handle_stat(&dfd, &filename->name, &flags);` if you want to hook vfs_statx on 6.1
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
AzyrRuthless pushed a commit to AzyrRuthless/KernelSU-Next that referenced this pull request Aug 26, 2025
AzyrRuthless pushed a commit to AzyrRuthless/KernelSU-Next that referenced this pull request Aug 26, 2025
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Aug 27, 2025
This commit restores compatibility code needed that was removed at tiann/KernelSU@898e9d4 .
where upstream dropped all pre-5.10 support

Reverts `kernel:Add Huawei hisi check (tiann#1545)`
	- upstream tiann/KernelSU@4f05fe2
	- superceded by `kernel: expose allowlist workaround as Kconfig option` on next commit

other changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
		- just use `ksu_handle_stat(&dfd, &filename->name, &flags);` if you want to hook vfs_statx on 6.1
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
This commit restores compatibility code needed that was removed at tiann/KernelSU@898e9d4 .
where upstream dropped all pre-5.10 support

Reverts `kernel:Add Huawei hisi check (tiann#1545)`
	- upstream tiann/KernelSU@4f05fe2
	- superceded by `kernel: expose allowlist workaround as Kconfig option` on next commit

other changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
		- just use `ksu_handle_stat(&dfd, &filename->name, &flags);` if you want to hook vfs_statx on 6.1
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
This commit restores compatibility code needed that was removed at tiann/KernelSU@898e9d4 .
where upstream dropped all pre-5.10 support

Reverts `kernel:Add Huawei hisi check (tiann#1545)`
	- upstream tiann/KernelSU@4f05fe2
	- superceded by `kernel: expose allowlist workaround as Kconfig option` on next commit

other changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
		- just use `ksu_handle_stat(&dfd, &filename->name, &flags);` if you want to hook vfs_statx on 6.1
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
This commit restores compatibility code needed that was removed at tiann/KernelSU@898e9d4 .
where upstream dropped all pre-5.10 support

Reverts `kernel:Add Huawei hisi check (tiann#1545)`
	- upstream tiann/KernelSU@4f05fe2
	- superceded by `kernel: expose allowlist workaround as Kconfig option` on next commit

other changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
		- just use `ksu_handle_stat(&dfd, &filename->name, &flags);` if you want to hook vfs_statx on 6.1
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
This commit restores compatibility code needed that was removed at tiann/KernelSU@898e9d4 .
where upstream dropped all pre-5.10 support

Reverts `kernel:Add Huawei hisi check (tiann#1545)`
	- upstream tiann/KernelSU@4f05fe2
	- superceded by `kernel: expose allowlist workaround as Kconfig option` on next commit

other changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
		- just use `ksu_handle_stat(&dfd, &filename->name, &flags);` if you want to hook vfs_statx on 6.1
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
This commit restores compatibility code needed that was removed at tiann/KernelSU@898e9d4 .
where upstream dropped all pre-5.10 support

Reverts `kernel:Add Huawei hisi check (tiann#1545)`
	- upstream tiann/KernelSU@4f05fe2
	- superceded by `kernel: expose allowlist workaround as Kconfig option` on next commit

other changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
		- just use `ksu_handle_stat(&dfd, &filename->name, &flags);` if you want to hook vfs_statx on 6.1
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 29, 2025
This commit restores compatibility code needed that was removed at tiann/KernelSU@898e9d4 .
where upstream dropped all pre-5.10 support

Reverts `kernel:Add Huawei hisi check (tiann#1545)`
	- upstream tiann/KernelSU@4f05fe2
	- superceded by `kernel: expose allowlist workaround as Kconfig option` on next commit

other changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
		- just use `ksu_handle_stat(&dfd, &filename->name, &flags);` if you want to hook vfs_statx on 6.1
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Aug 29, 2025
This commit restores compatibility code needed that was removed at tiann/KernelSU@898e9d4 .
where upstream dropped all pre-5.10 support

Reverts `kernel:Add Huawei hisi check (tiann#1545)`
	- upstream tiann/KernelSU@4f05fe2
	- superceded by `kernel: expose allowlist workaround as Kconfig option` on next commit

other changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
		- just use `ksu_handle_stat(&dfd, &filename->name, &flags);` if you want to hook vfs_statx on 6.1
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Aug 29, 2025
This commit restores compatibility code needed that was removed at tiann/KernelSU@898e9d4 .
where upstream dropped all pre-5.10 support

Reverts `kernel:Add Huawei hisi check (tiann#1545)`
	- upstream tiann/KernelSU@4f05fe2
	- superceded by `kernel: expose allowlist workaround as Kconfig option` on next commit

other changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
		- just use `ksu_handle_stat(&dfd, &filename->name, &flags);` if you want to hook vfs_statx on 6.1
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Aug 29, 2025
This commit restores compatibility code needed that was removed at tiann/KernelSU@898e9d4 .
where upstream dropped all pre-5.10 support

Reverts `kernel:Add Huawei hisi check (tiann#1545)`
	- upstream tiann/KernelSU@4f05fe2
	- superceded by `kernel: expose allowlist workaround as Kconfig option` on next commit

other changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
		- just use `ksu_handle_stat(&dfd, &filename->name, &flags);` if you want to hook vfs_statx on 6.1
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Aug 30, 2025
This commit restores compatibility code needed that was removed at tiann/KernelSU@898e9d4 .
where upstream dropped all pre-5.10 support

Reverts `kernel:Add Huawei hisi check (tiann#1545)`
	- upstream tiann/KernelSU@4f05fe2
	- superceded by `kernel: expose allowlist workaround as Kconfig option` on next commit

other changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
		- just use `ksu_handle_stat(&dfd, &filename->name, &flags);` if you want to hook vfs_statx on 6.1
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 30, 2025
This commit restores compatibility code needed that was removed at tiann/KernelSU@898e9d4 .
where upstream dropped all pre-5.10 support

Reverts `kernel:Add Huawei hisi check (tiann#1545)`
	- upstream tiann/KernelSU@4f05fe2
	- superceded by `kernel: expose allowlist workaround as Kconfig option` on next commit

other changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
		- just use `ksu_handle_stat(&dfd, &filename->name, &flags);` if you want to hook vfs_statx on 6.1
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 30, 2025
This commit restores compatibility code needed that was removed at tiann/KernelSU@898e9d4 .
where upstream dropped all pre-5.10 support

Reverts `kernel:Add Huawei hisi check (tiann#1545)`
	- upstream tiann/KernelSU@4f05fe2
	- superceded by `kernel: expose allowlist workaround as Kconfig option` on next commit

other changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
		- just use `ksu_handle_stat(&dfd, &filename->name, &flags);` if you want to hook vfs_statx on 6.1
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Aug 31, 2025
This commit restores compatibility code needed that was removed at tiann/KernelSU@898e9d4 .
where upstream dropped all pre-5.10 support

Reverts `kernel:Add Huawei hisi check (tiann#1545)`
	- upstream tiann/KernelSU@4f05fe2
	- superceded by `kernel: expose allowlist workaround as Kconfig option` on next commit

other changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
		- just use `ksu_handle_stat(&dfd, &filename->name, &flags);` if you want to hook vfs_statx on 6.1
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 6, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Jan 6, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Jan 7, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 7, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Jan 7, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Jan 7, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 8, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 8, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Jan 9, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Jan 9, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Jan 9, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 9, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Jan 10, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Jan 10, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 10, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 10, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Jan 10, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 10, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 10, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Jan 11, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Jan 12, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 12, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 13, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 13, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 13, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 13, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 13, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 13, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Jan 13, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

Signed-off-by: backslashxx <[email protected]>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Jan 14, 2026
This commit restores compatibility code needed for legacy that was removed upstream.

Restores LSM hooks:
- inode_rename - replacss pkg_observer.c
- task_fix_setuid - replaces setuid_hook.c + kernel_umount.c

Restores workqueue'd allowlist handling dropped at bfb767b, 9060e61
Restores -Wno-implicit-function-declaration dropped at d3a09fa
Restores old core_hook infrastructure. breaking it up to setuid + kernel_umount is just more complexity here.
Restores an ifdef on arch.h, adds in-32-bit arm support.
Restores Makefile instead of Kbuild - TODO: review this later for UL
Restore needed rules for init's execution of ksud - removed on 6e918fc, pr 3031

smaller changes and cleanups
	sucompat: ksu_handle_stat(), remove dead ifdef.
	LINUX_VERSION_CODE / KERNEL_VERSION, ksu.c
		- reported by Sinclair19
		- fix by including version.h
	fatal_signal_pending, ksud.c
		- add compat by including sched.h or sched/signal.h conditionally
		- ref: torvalds/linux@2a1f062
	selinux_state.ss, core_hook.c
		- remove rcu_dereference use
		- ref: tiann#2695
	seccomp.filter_count, core_hook.c
		- reset this only for 5.9 and up as it only exists there
		- ref: tiann#2708, gregkh/linux@c818c03

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.

2 participants