kernel: Rewrite kernle version code management

Co-authored-by: lamadaemon <i@lama.icu>
Signed-off-by: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com>
This commit is contained in:
ShirkNeko
2025-06-24 20:07:56 +08:00
parent 0f3a9de958
commit f876a523f6
3 changed files with 51 additions and 17 deletions

View File

@@ -55,6 +55,8 @@
#include "kpm/kpm.h"
#endif
char ksu_version_id[KSU_MAX_VERSION_NAME] = KSU_VERSION;
#ifdef CONFIG_KSU_SUSFS
bool susfs_is_allow_su(void)
{
@@ -397,7 +399,7 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
if (copy_to_user(arg3, &version, sizeof(version))) {
pr_err("prctl reply error, cmd: %lu\n", arg2);
}
u32 version_flags = 0;
u32 version_flags = 2;
#ifdef MODULE
version_flags |= 0x1;
#endif
@@ -510,6 +512,14 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
return 0;
}
if (arg2 == CMD_GET_FULL_VERSION) {
if (copy_to_user(arg3, &ksu_version_id, KSU_MAX_VERSION_NAME)) {
pr_err("prctl reply error, cmd: %lu\n", arg2);
}
return 0;
}
#ifdef CONFIG_KPM
// ADD: 添加KPM模块控制
if(sukisu_is_kpm_control_code(arg2)) {