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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user