Commit Graph

113 Commits

Author SHA1 Message Date
ShirkNeko
eebde9be16 kernel: handle optional backport for selinux_inode
* For supporting kernel 4.19 with 5.10 bpf backports.

Co-authored-by: rsuntk <rsuntk@yukiprjkt.my.id>
2025-09-12 14:37:39 +08:00
dabao1955
6e5226efbb kernel: Removs extra strip for hook choice (#361)
* kernel: Removs extra strip for hook choice

extra changes for #353

* kernel: Fix Makefile
2025-08-28 10:23:40 +08:00
rsuntk
f3f2089a13 kernel: nuke creds wrapper
* Little bit complicated, so let's remove it.

Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
2025-08-27 15:20:08 +08:00
ShirkNeko
20b58dcf44 kernel: Bump KSU_VERSION_API to 3.1.9 2025-08-24 11:46:28 +08:00
dabao1955
75548097d4 kernel: Remove unnecessary strip in CONFIG_KSU_TRACEPOINT_HOOK check (#353)
The 'strip' function is redundant when checking Kconfig variables, as
values from CONFIG options (like CONFIG_KSU_TRACEPOINT_HOOK) are already
trimmed and do not contain leading/trailing whitespace.

Simplify the condition for better readability and maintainability:
  - Remove unnecessary $(strip ...)
  - Add consistent spacing around the comma

This change aligns with kernel Makefile conventions and improves code clarity
without altering behavior.

Signed-off-by: dabao1955 <dabao1955@163.com>
2025-08-24 11:42:05 +08:00
ShirkNeko
444aefd5d5 kernel: Modified dynamic signature All files have been renamed to the correct names: Dynamic Manager 2025-08-24 11:08:09 +08:00
ShirkNeko
8a0d52a2ee kernel: add wrapper for creds, refine disable_seccomp, revert some changes (#131)
1. Wrapper for creds:
* Some older kernel does not have {.val}, so, for nicer compatibility support and clean code,
make some wrapper for credential use.
* After this change, do not use current_uid().val, instead, use ksu_current_uid(). For more
info, check kernel/include/ksu_creds.h.

2. Refine disable_seccomp (need to add k6.11+ support)
https://github.com/tiann/KernelSU/pull/2708
https://github.com/tiann/KernelSU/issues/2706

3. Revert "Handle unmount for isolated process correctly"
Reason: https://github.com/tiann/KernelSU/pull/2696#issuecomment-3181866301

Co-authored-by: Wang Han <416810799@qq.com>
Co-authored-by: rsuntk <rsuntk@yukiprjkt.my.id>
2025-08-16 14:25:17 +08:00
Prslc
ef399712dc kernel: Introducing Tracepoint Hook Type Support
Tracepoint is a predefined hook point in the kernel, compared to Kprobe,
it is more stable and has lower performance overhead, although compatibility
is relatively poor, it is still worth trying

By the way, we have also included the config definitions related to hook types
in Kconfig, to enhance cleanliness

These patches is based on https://github.com/backslashxx/KernelSU/issues/5

Co-authored-by: Cloud_Yun <1770669041@qq.com>
Co-authored-by: Prslc <prslc113@gmail.com>
2025-08-14 20:59:44 +08:00
ShirkNeko
9ff53ce683 kermel: Refactoring and separating dynamic signature-related structures and functions and implement hot-signature updates 2025-08-03 22:46:00 +08:00
ShirkNeko
bdf675b448 kernel: bump KSU_VERSION_API to 3.1.8 2025-07-21 21:25:11 +08:00
ShirkNeko
5a0801334c kernel: bump KSU_VERSION to 3.1.7 2025-06-30 17:06:25 +08:00
rsuntk
bb02b12a69 kernel: phase out devpts_hook
* Since it's interceptable from LSM Hook,
then we just need to remove ksu_handle_devpts and
make a decoy for it.

Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
2025-06-27 12:31:38 +08:00
古塵
d0cb0cf25a kernel: refactor CMD_GET_FULL_VERSION to safely initialize version string (#220)
Use strscpy()/strlcpy() to populate the version buffer in CMD_GET_FULL_VERSION
instead of relying on uninitialized memory. This ensures the returned string
is null-terminated and avoids exposing garbage data to user space.

Signed-off-by: schqiushui <orochi9999@gmail.com>
2025-06-27 00:24:14 +08:00
ShirkNeko
8c9692c350 kernel/Makefile: enhance version retrieval logic with GitHub commit count 2025-06-24 22:53:12 +08:00
ShirkNeko
f876a523f6 kernel: Rewrite kernle version code management
Co-authored-by: lamadaemon <i@lama.icu>
Signed-off-by: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com>
2025-06-24 20:07:56 +08:00
Prslc
0f3a9de958 Kernel: use main branch commit count for consistent versioning (#209) 2025-06-23 20:05:16 +08:00
ShirkNeko
8716b764ee kernel/Makefile: check kernelsu driver version from online git repo first, if fails then check local .git and if that also fails then use hardcoded fallback
Co-authored-by: rifsxd <rifat.44.azad.rifs@gmail.com>
2025-06-21 17:12:03 +08:00
rsuntk
103217755b kernel: allow GKI kprobes to use LSM hook for ksu_handle_devpts
* Also minor changes on comments

Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
2025-06-20 00:30:15 +08:00
rsuntk
babc50c048 [skip ci] kernel: just search for ksu_handle_devpts
* only to make 100% sure?

Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
2025-06-19 18:26:24 +08:00
backslashxx
aa80661186 kernel: intercept devpts via security_inode_permission LSM
* This changes:
  + Avoid conflicts with other devpts hooks.
  + We keep pts_unix98_pre for KPROBES for simplifying things.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
2025-06-19 18:26:15 +08:00
ShirkNeko
37f238f674 kernel: 移除 Makefile 中不必要的签名写入选项 2025-06-12 15:55:49 +08:00
ShirkNeko
514adfe86e Optimize compilation flags in Makefile, remove redundant options and add Samsung SELinux porting support
Co-authored-by: rsuntk <90097027+rsuntk@users.noreply.github.com>
2025-06-12 15:50:24 +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
467bbeb74e kernel: Remove more stray backslash in grep regex and move path_umount as optional backport 2025-06-12 15:22:30 +08:00
Tashfin Shakeer Rhythm
8996cb9f4a kernel: Makefile: Remove stray backslash from path_umount grep regex (#103)
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
2025-06-12 15:19:57 +08:00
YC酱luyancib
56bfe55c3d Drop auto backport path_umount (#124)
Since https://github.com/backslashxx/KernelSU/commit/4f8943a and https://github.com/rsuntk/KernelSU/commit/0eab5ae , so auto backport `path_umount` is no longer needed.
2025-06-01 00:55:22 +08:00
rsuntk
84a0ab78fb kernel: make path_umount backporting as optional
Since https://github.com/backslashxx/KernelSU/commit/4f8943a, path_umount is no longer needed.

Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
2025-05-24 15:02:40 +08:00
YC酱luyancib
6ee558d52a kernel:fix missing auto backport can_mount #85 2025-05-18 18:39:20 +08:00
ShirkNeko
95c47b8602 Fixed misspelling of CONFIG_KSU_HOOK_KPROBES to CONFIG_KSU_KPROBES_HOOK in Makefile and related files. 2025-05-17 18:33:29 +08:00
ShirkNeko
fb94ea9dfd 修正Makefile中关于CONFIG_KSU_HOOK_KPROBES的拼写错误 2025-05-16 23:48:37 +08:00
由崎黑板
8db72cc414 修正Makefile中关于CONFIG_KSU_HOOK_KPROBES的错误 #78 2025-05-16 23:45:12 +08:00
ShirkNeko
986a706f25 Remove checks on atomic functions to simplify the Makefile 2025-05-16 11:32:44 +08:00
ShirkNeko
049865daea Remove duplicate get_cred_rcu backport 2025-05-15 21:26:12 +08:00
ShirkNeko
682fdf0afe Prioritize sukisu recognition.
Simplified manual hooks
2025-05-10 14:38:45 +08:00
ShirkNeko
970e7651a5 Refactoring Kconfig and Makefile to optimize KernelSU configuration logic and simplify kernel type determination 2025-04-19 16:02:18 +08:00
ShirkNeko
1a563bb3e1 Update Makefile to add support for kernel version 6 and optimize KERNEL_TYPE judgment logic. 2025-04-19 14:44:49 +08:00
ShirkNeko
6c2e67cd50 更新Makefile,添加内核类型判断逻辑并输出相关信息 2025-04-17 20:07:02 +08:00
ShirkNeko
be8d6ca052 重构Makefile中的KPROBES钩子逻辑,简化条件编译信息输出 2025-04-17 19:53:21 +08:00
ShirkNeko
b72ab79e06 简化Makefile中的内核版本判断逻辑,移除冗余的条件编译代码 2025-04-17 19:52:50 +08:00
ShirkNeko
28f006ed39 Refactor Kconfig and Makefile, update KPROBES related configurations, simplify conditional compilation logic 2025-04-17 19:46:14 +08:00
ShirkNeko
8ada7757ea Update Makefile 2025-04-15 15:14:20 +08:00
ShirkNeko
04f2b53754 Add the definition of the get_cred_rcu function to the Makefile to support SukiSU compatibility 2025-04-11 23:40:30 +08:00
ShirkNeko
3923007430 Add the KSU_COMPAT_GET_CRED_RCU flag to the Makefile to support the compatibility feature 2025-04-11 20:51:24 +08:00
ShirkNeko
d240c1035f Fix spelling error in SELinux driver check to ensure current_sid function is recognized correctly 2025-04-11 20:46:52 +08:00
ShirkNeko
6060fdd4ab Remove the KSU_COMPAT_GET_CRED_RCU flag from the Makefile and add a compile check for the path_umount function to ensure that the necessary validation is done before compilation. 2025-04-11 20:44:45 +08:00
ShirkNeko
e54785c069 Update Makefile to support SukiSU, add get_cred_rcu, can_umount, and path_umount functions, and change information to reflect the new name. 2025-04-11 20:39:43 +08:00
ShirkNeko
ef4c1f50ab Update the log message prefixes in the Makefile to uniformly format the output 2025-04-11 04:07:29 +08:00
ShirkNeko
ad051ce22b Remove definition checks for atomic functions in the kernel Makefile to simplify path unloading logic 2025-04-11 04:04:55 +08:00
ShirkNeko
aee56e803d Add the definitions of the get_cred_rcu, can_umount, and path_umount functions to the Makefile to enhance the readability and maintainability of the path unloading logic 2025-04-11 03:59:31 +08:00
ShirkNeko
3c0944530d Add error checking to the kernel Makefile to ensure that the atomic_inc_not_zero or atomic_long_inc_not_zero functions are found in kernel/cred.c 2025-04-11 03:57:23 +08:00