Commit Graph

16 Commits

Author SHA1 Message Date
ShirkNeko
30c627395a kernel: Optimise sulog to prevent deadlocks caused by global lock contexts. 2025-11-14 13:04:28 +08:00
ShirkNeko
e4d7c292d6 kernel: remove unused kernel_compat
Co-authored-by: weishu <twsxtd@gmail.com>
2025-11-08 20:28:58 +08:00
weishu
c307bf5614 kernel: remove ksu_compat_{open,read,write} because we're in the right context now
Co-authored-by: weishu <twsxtd@gmail.com>
2025-11-08 20:22:06 +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
ShirkNeko
4aa73f2869 kernel: Fix time64_to_tm scope 2025-11-01 15:19:10 +08:00
MorStar
3933de0ae9 Fix compilation errors on the newer kernels (#509)
* Fix compilation errors on the newer kernels

* 更新 Makefile

* 更新 Kconfig

* 更新 sulog.c
2025-11-01 14:47:30 +08:00
MorStar
4b1bbda3b1 add rtc_time compatibility for older kernels (#504)
* KernelSU: add rtc_time compatibility for older kernels

* KernelSU: add rtc_time compatibility for older kernels
2025-10-31 21:55:04 +08:00
ShirkNeko
343c6452cf 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>
2025-10-27 21:54:20 +08:00
ShirkNeko
1ea6af52a0 kernel: Enable macro protection for sulog
- Only enabled on kernel versions greater than 5.10.245
2025-10-25 00:48:02 +08:00
ShirkNeko
163424673f kernel: sulog: Simplify code using vfs_truncate 2025-10-23 22:15:44 +08:00
ShirkNeko
923153db70 kernel: Replace workqueue creation with alloc_workqueue for improved performance 2025-10-23 21:40:17 +08:00
ShirkNeko
31fb74616d kernel: Restore the sequence of sulog logs 2025-10-23 21:07:38 +08:00
ShirkNeko
0d55990b98 kernel: Add a UID blacklist feature to restrict the operational permissions of specific users 2025-10-23 01:49:35 +08:00
ShirkNeko
1a63b2d756 kernel: Extend sulog to also record system call logs 2025-10-22 20:43:14 +08:00
ShirkNeko
ad3cd241f8 kermel: Optimize timestamp retrieval logic by replacing startup time with actual time. 2025-10-22 18:18:02 +08:00
ShirkNeko
b8e463b532 Kernel: Implement sulog for enhanced logging of SU attempts and permissions 2025-10-22 17:21:58 +08:00