Commit Graph

26 Commits

Author SHA1 Message Date
Ylarod
91312effba fix sepolicy patch hint (#2872) 2025-11-06 12:53:09 +08:00
ShirkNeko
320e08b8fb 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 aa2cbbf9cd.

* 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-01 23:30:30 +08:00
生于生时 亡于亡刻
0a804ba170 feat: Optimize some codes (ksud) (#465)
* chore: make cargo clippy happy

Signed-off-by: Tools-app <localhost.hutao@gmail.com>

* chore: Optimize import
-  Format as a standard import

Signed-off-by: Tools-app <localhost.hutao@gmail.com>

---------

Signed-off-by: Tools-app <localhost.hutao@gmail.com>
2025-10-12 15:48:24 +08:00
rsuntk
436071a3f1 ksud: fix some warnings
warning: hiding a lifetime that's elided elsewhere is confusing
  --> src/sepolicy.rs:22:30
   |
22 | fn parse_bracket_objs(input: &str) -> IResult<&str, SeObject> {
   |                              ^^^^             ----  -------- the same lifetime is hidden here
   |                              |                |
   |                              |                the same lifetime is elided here
   |                              the lifetime is elided here

Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
2025-08-25 21:30:39 +08:00
5ec1cff
a041b90891 ksud: make clippy happy (#2683)
e1be06240d/clippy_lints/src/format_args.rs (L168)
2025-08-10 17:59:12 +08:00
weishu
4fdd3e07e5 ksud: migrate to Rust 2024 edition 2025-02-24 16:53:37 +08:00
weishu
e245e3419d ksud: upgrade nom to 8.0 2025-02-24 16:45:24 +08:00
weishu
3d3bc5ce3c ksud: make clippy happy 2025-02-05 16:15:10 +08:00
LoveSy
62297a74a6 Upgrade rustix (#1900) 2024-07-22 07:43:59 +08:00
Wang Han
4a1ebe490e Allow skipping commented policy (#1870) 2024-07-10 11:38:12 +08:00
LoveSy
64269c8c4f Use rustix for prctl (#1333) 2024-02-01 23:28:56 +08:00
weishu
827a2f2901 ksud: don't apply rule when check grammer 2023-07-01 17:43:40 +08:00
tiann
b1af4ada60 ksud: fix clippy 2023-03-27 15:44:18 +08:00
tiann
0c8b4a48de ksud: ignore empty sepolicy rule 2023-02-14 18:10:39 +08:00
tiann
f50b4dfe34 ksud: fmt 2023-02-14 12:59:21 +08:00
tiann
9ce7351aaa ksud: support check_sepolicy in scripts 2023-02-14 12:57:08 +08:00
skbeh
3181dd17bc ci: add CI for clippy, rustfmt and shell scripts (#193) 2023-02-04 13:52:20 +08:00
tiann
175de861bf ksud: Fix incorrect dependency 2023-02-03 23:19:22 +08:00
tiann
71cc166f72 ksud: Fix macOS compile 2023-02-03 14:46:48 +08:00
tiann
70b8b43b48 ksud: support sepolicy check 2023-02-03 13:16:17 +08:00
skbeh
219ea1c458 ksud: fix issues found by clippy (#167)
These issues are mostly found by `cargo clippy -- -W clippy::pedantic`.
2023-02-03 09:45:07 +08:00
tiann
681c4a3f0d ksud: minor tweaks 2023-02-01 19:12:25 +08:00
tiann
619dd1ace1 ksud: make it compilable for non-android 2023-02-01 19:04:33 +08:00
tiann
b7ff6b1a51 ksud: support module sepolicy.rule 2023-01-31 21:58:59 +08:00
tiann
ad89c5a80f ksud: fix compile for x86_64 2023-01-31 19:00:58 +08:00
tiann
3413f4a4fe ksud: sepolicy support 2023-01-31 18:47:43 +08:00