Commit Graph

23 Commits

Author SHA1 Message Date
ShirkNeko
118fcf507a kernel: fmt 2025-11-18 21:39:31 +08:00
ShirkNeko
e79b702fd6 Synchronise some modifications
Co-authored-by: Ylarod <me@ylarod.cn>
Co-authored-by: 5ec1cff <56485584+5ec1cff@users.noreply.github.com>
Co-authored-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
Co-authored-by: u9521 <63995396+u9521@users.noreply.github.com>
Co-authored-by: Wang Han <416810799@qq.com>
Co-authored-by: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com>
Co-authored-by: Faris <rissu.ntk@gmail.com>
2025-11-18 21:27:22 +08:00
小 小w
724c7517f5 Susfs main (#597)
* Update file_wrapper.c (#595)

* Remove wrong compatibility code from susfs-main (#596)

Nongki compatibility code should be committed to nongki branch, rather than susfs-main branch.

---------

Co-authored-by: kAiF <askthekaif@proton.me>
Co-authored-by: cctv18 <85936817+cctv18@users.noreply.github.com>
2025-11-18 11:16:41 +08:00
YangQi0408
fb539fae57 kernel: Fix compatibility with nongki kernels (#594) 2025-11-18 00:25:48 +08:00
Jiu
55ddeb63fb Susfs main (#592)
* Update rules.c

* Update selinux.c

* Rename susfs_set_kernel_sid to susfs_set_priv_app_sid
2025-11-17 18:06:02 +08:00
ShirkNeko
4c04508267 kernel: Apply the susfs patch
Co-authored-by: simonpunk <simonpunk2016@gmail.com>
Co-authored-by: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com>
2025-11-14 18:36:04 +08:00
5ec1cff
9203006028 kernel: refine syscall_hook_manager
- Don't unmark process when setuid if syscall tracepoint is in use
- Remark process when app profile updated
- Ensure zygote is marked on first boot
2025-11-14 13:03:46 +08:00
ShirkNeko
66f37c7310 Revert "kernel: Apply the SUSFS patch"
This reverts commit ad0f3f6025.
2025-11-09 21:39:04 +08:00
ShirkNeko
ad0f3f6025 kernel: Apply the SUSFS patch 2025-11-09 18:32:16 +08:00
ShirkNeko
a525048d1f kernel: Remove susfs patch 2025-11-09 12:48:51 +08:00
Shadichy
f39d4f0f38 kernel: Refactor selinux/selinux.c (#2881)
Signed-off-by: shadichy <shadichy@blisslabs.org>
Co-authored-by: Wang Han <416810799@qq.com>
2025-11-08 01:35:37 +08:00
5ec1cff
c876d60e53 feature: add devpts fd wrapper (#21)
This feature is intended to resolve devpts problem.
2025-11-07 18:49:32 +08:00
ShirkNeko
71353a70d4 kernel: use sys_enter tracepoint for sucompat (#533)
* use sys_enter tracepoint for sucompat

* update sucompat rules

* clean tif mark

* mark tif after load allow list

* clear all tif first, then mark target

* Fix shell su

* allow when escape

* fix bugs

* kernel: Resolve logical inconsistencies

---------

Co-authored-by: Ylarod <me@ylarod.cn>
Co-authored-by: weishu <twsxtd@gmail.com>
2025-11-06 14:34:45 +08:00
ShirkNeko
afc8b53ca6 new supercall impl (#511)
* refactor: replace throne tracker with ksud token

* use snprintf

* refactor: new supercall impl

- Import the sukisu command

* disable seccomp for supercall users

* kernel: fmt clear

* kernel: Enable macro protection for sulog

- Only enabled on kernel versions greater than 5.10.245

* kernel: Refactor kprobe hooks and implement LSM hooks for improved security handling

* debug mode

* kernel: Add functionality to generate and validate authentication tokens for cmd_su

* kernel: Simplified manual SU command processing for code

* kernel: replace renameat hook with fsnotify

* Revert "refactor: replace throne tracker with ksud token"

This reverts commit aa2cbbf.

* kernel: fix compile

* kernel: fix compile below 6.0

* Fix compile err; Add become_manager

* kernel: install fd for manager automaticlly

- extend to import the corresponding command

* manager: new supercall impl

* temp changes for ksud

* ksud: fix compile

* fix wrong opcode

* kernel: fix compile

* kernel: Fixed hook type and KPM status retrieval errors

* kernel: Fixed potential null pointer issue with current->mm in kernel version 5.10

When calling get_full_comm() within system call hooks, current->mm may be null (prctl). A fallback mechanism for current->comm must be added beforehand to prevent null pointer dereferences when accessing mm->arg_start/arg_end.

Signed-off-by: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com>

* ksud: fix cargo check

* manager: Fixed an issue where the KSUD release and user-mode scanning switch failed to function correctly.

- kernel: fix spin lock mutual

kernel: Fixed potential null pointer issue with current->mm in kernel version 5.10

When calling get_full_comm() within system call hooks, current->mm may be null (prctl). A fallback mechanism for current->comm must be added beforehand to prevent null pointer dereferences when accessing mm->arg_start/arg_end.

kernel: try introduce like susfs's method to fix prctl delay

* seccomp: allow reboot

* use u32

* update clang-format

* 4 spaces save the world

* ksud: Fix build on macOS

* manager: bump minimal supported kernel.

- When get_hook_type is empty, display “Unknown”.

* Fix ksud build (#2841)

* try fix ksud

* fix for macos

* remove any

* Fix ksud build, take 3

* try fix allowlist

* bring lsm hook back

* fix: a lot again

* Fix ksud build, take 4 (#2846)

Remove init_driver_fd function for non-linux/android targets

* manager: Return to the native method via KSUd installation

* Merge with susfs-mian format

---------

Signed-off-by: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com>
Co-authored-by: Ylarod <me@ylarod.cn>
Co-authored-by: weishu <twsxtd@gmail.com>
Co-authored-by: AlexLiuDev233 <wzylin11@outlook.com>
Co-authored-by: Wang Han <416810799@qq.com>
2025-11-02 01:11:38 +08:00
Huy Minh
44834f0172 kernel: add initial 6.8+/6.14 kernel support
* This is a squashed of un-merged pull requests of Official KernelSU
* LKM support are not available.
* Require this additional patch to avoid kernel panic because of "Too many LSMs registered":
7042991a5c

* Un-merged pull requests of Official KernelSU:
https://github.com/tiann/KernelSU/pull/1785
https://github.com/tiann/KernelSU/pull/2662

* This commit probably not 100% completed.

Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
2025-10-07 16:52:42 +08:00
rsuntk
22eb11c391 kernel: fix -Wstrict-prototypes warnings/errors
* On newer kernel for some reason -Wno-strict-prototypes still does not fix the errors or warnings.
* To fix it, we just need to add void type.

Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
2025-09-02 14:56:00 +08:00
ShirkNeko
e41fa8ef62 Revert renaming symbols in KernelSU driver
- In order to reduce the extra patch code and increase the rate of hunk succeed, we do not rename the symbols in KernelSU drvier but instead do it all in kernel/kallsym.c

- Make susfs_starts_with() global as it maybe useful in future

Co-authored-by: simonpunk <simonpunk2016@gmail.com>
2025-08-25 19:29:14 +08:00
rsuntk
69a13ff999 kernel: move some defs to single file
* Much cleaner code, although setenforce is not used anymore
* Guard is_ksu_transition only for 4.19 and under.

Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
2025-08-16 13:40:42 +08:00
ShirkNeko
e2ea0138db kernel & KernelSU & ksu_susfs: Temp fix for avc log message being leaked by...
kernel & KernelSU & ksu_susfs: Temp fix for avc log message being leaked by logd and added new toggle for enabling or disabling avc log spoofing

- See full details:
  https://android-review.googlesource.com/c/platform/system/logging/+/3725346/2
  https://github.com/aviraxp/ZN-AuditPatch

- Since spoofing avc log in kernel may make things harder when users trying to debug with some permission issues or selinux issues, so thats why the toggle is created here and this is just a temp fix implemented in kernel side

- usage: ksu_susfs enable_avc_log_spoofing <0|1>

Co-authored-by: simonpunk <simonpunk2016@gmail.com>
2025-08-10 16:35:19 +08:00
rsuntk
4502a52e1b kernel: selinux: expose is_ksu_transition to all linux version
* Allow newer kernel to use is_ksu_transition function.

Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
2025-06-20 00:30:10 +08:00
ShirkNeko
22db54c5d3 kernel: Fix compilation flags in Makefiles and optimize SELinux rule handling
Co-authored-by: rsuntk <90097027+rsuntk@users.noreply.github.com>
2025-06-12 15:43:24 +08:00
rsuntk
dc0026c10b [skip ci] kernel: move is_ksu_transition to selinux.c
* SELinux stuff on ksud? Does something like this is offtopic?

Signed-off-by: rsuntk <90097027+rsuntk@users.noreply.github.com>
2025-06-12 15:34:23 +08:00
樱檩殇雪
ad064fea9e add susfs-dev branch files 2025-03-17 02:48:59 +08:00