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>
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
Improve and merge types that do not require hooks
Introducing the hook type prctl
These patches is based on backslashxx/KernelSU#5
Co-authored-by: Cloud_Yun <1770669041@qq.com>
Co-authored-by: Prslc <prslc113@gmail.com>
Co-authored-by: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com>
Signed-off-by: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com>
* 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>
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>
Since commit:
kernel: core_hook: switch to prepare_creds (c58e102)
get_cred_rcu is no longer needed.
Signed-off-by: rsuntk <90097027+rsuntk@users.noreply.github.com>
* Some samsung kernel source have SEC_SELINUX_PORTING_COMMON
* This commit mayfix false warning to sepolicy.
Mayfix: I haven't test it yet
Signed-off-by: rsuntk <90097027+rsuntk@users.noreply.github.com>
* kernel: deny v2 signature blocks with incorrect number
* kernel: reject v1 signature
* kernel: enforce manager package name at compile time
* kernel: don't specific package name in source code, use it in ci
This patch modifies the following:
- Move the version addition logic in ksu.h to Makefile processing
- Print the current version number of KernelSU during make build
build test (normal):
buildlog:
HOSTCC scripts/basic/bin2c Using .. as source for kernel -- KernelSU
version: 11055
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
KernelSU software:
KernelSU Working Version: 11055 (v) Superusers: 0 Modules: 0

build test (missing .git file):
buildlog:
HOSTCC scripts/basic/bin2c Using .. as source for kernel
../drivers/kernelsu/Makefile:23: "KSU_GIT_VERSION not defined! It is
better to make KernelSU a git submodule!"
CHK include/generated/utsrelease.h
CHK scripts/mod/devicetable-offsets.h
KernelSU software:
KernelSU Working Version: 16 (v) Superusers: 0 Modules: 0
The current kernel version 16 is too low for the manager to function
properly. Please upgrade to version 10977 or higher!

(cherry picked from commit 0c38a1614a77d80de752aba20908e3f9d21660a8)
Change-Id: I570f2ee33db224e1a36770f847137f290ba9bcfd
Co-authored-by: stic-server-open <1138705738@qq.com>