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 23:16:16 +08:00
parent f57fe79c5d
commit 2c2698f6bc
53 changed files with 234 additions and 122 deletions

View File

@@ -47,6 +47,8 @@
#include "kpm/kpm.h"
char ksu_version_id[KSU_MAX_VERSION_NAME] = KSU_VERSION;
static bool ksu_module_mounted = false;
extern int handle_sepolicy(unsigned long arg3, void __user *arg4);
@@ -308,7 +310,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
@@ -418,6 +420,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)) {