From 657f343f5c4daf11df65bafcac16221a4791e613 Mon Sep 17 00:00:00 2001 From: liankong Date: Sun, 13 Apr 2025 14:18:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0super=5Faccess=E5=AF=B9ta?= =?UTF-8?q?sk=5Fstruct=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/kpm/super_access.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/kernel/kpm/super_access.c b/kernel/kpm/super_access.c index 718f0113..0829bfda 100644 --- a/kernel/kpm/super_access.c +++ b/kernel/kpm/super_access.c @@ -155,6 +155,33 @@ DYNAMIC_STRUCT_BEGIN(netlink_kernel_cfg) #endif DYNAMIC_STRUCT_END(netlink_kernel_cfg) + +#include +DYNAMIC_STRUCT_BEGIN(task_struct) + DEFINE_MEMBER(task_struct, pid) + DEFINE_MEMBER(task_struct, tgid) + DEFINE_MEMBER(task_struct, cred) + DEFINE_MEMBER(task_struct, real_cred) + DEFINE_MEMBER(task_struct, comm) + DEFINE_MEMBER(task_struct, parent) + DEFINE_MEMBER(task_struct, group_leader) + DEFINE_MEMBER(task_struct, mm) + DEFINE_MEMBER(task_struct, active_mm) + DEFINE_MEMBER(task_struct, thread_pid) + DEFINE_MEMBER(task_struct, files) + DEFINE_MEMBER(task_struct, seccomp) +#ifdef CONFIG_THREAD_INFO_IN_TASK + DEFINE_MEMBER(task_struct, thread_info) +#endif +#ifdef CONFIG_CGROUPS + DEFINE_MEMBER(task_struct, cgroups) +#endif +#ifdef CONFIG_SECURITY + DEFINE_MEMBER(task_struct, security) +#endif + DEFINE_MEMBER(task_struct, thread) +DYNAMIC_STRUCT_END(task_struct) + // ===================================================================================================================== #define STRUCT_INFO(name) &(name##_info) @@ -169,7 +196,8 @@ struct DynamicStructInfo* dynamic_struct_infos[] = { #endif STRUCT_INFO(vm_area_struct), STRUCT_INFO(vm_operations_struct), - STRUCT_INFO(netlink_kernel_cfg) + STRUCT_INFO(netlink_kernel_cfg), + STRUCT_INFO(task_struct) }; // return 0 if successful From cf825f912cc3de622751a940d5c1e14ed128c1d1 Mon Sep 17 00:00:00 2001 From: liankong Date: Sun, 13 Apr 2025 15:22:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0KPM=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/README.md b/docs/README.md index c532b419..5551aafd 100644 --- a/docs/README.md +++ b/docs/README.md @@ -52,8 +52,13 @@ curl -LSs "https://raw.githubusercontent.com/ShirkNeko/SukiSU-Ultra/main/kernel/ - 我们基于KernelPatch去掉了和KSU重复的功能,保留了KPM支持 - 我们将会引入更多的兼容APatch的函数来确保KPM功能的完整性 + 开源地址: https://github.com/ShirkNeko/SukiSU_KernelPatch_patch + +KPM模板地址: https://github.com/udochina/KPM-Build-Anywhere + + ## 更多链接 基于 SukiSU 和 susfs 编译的项目 - [GKI](https://github.com/ShirkNeko/GKI_KernelSU_SUSFS)