From 51a0357f0f5920d2fb84f36071b203d6826bdf07 Mon Sep 17 00:00:00 2001 From: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com> Date: Sat, 12 Apr 2025 16:23:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=20super=5Faccess.c=20=E4=B8=AD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9=E5=86=85=E6=A0=B8=E7=89=88=E6=9C=AC?= =?UTF-8?q?=206.6=20=E5=92=8C=205.15=20=E7=9A=84=E5=AE=8F=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=EF=BC=8C=E5=B9=B6=E8=B0=83=E6=95=B4=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E4=BB=A5=E9=80=82=E5=BA=94=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E5=86=85=E6=A0=B8=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/kpm/super_access.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/kernel/kpm/super_access.c b/kernel/kpm/super_access.c index cf7db00c..8f2791ca 100644 --- a/kernel/kpm/super_access.c +++ b/kernel/kpm/super_access.c @@ -68,8 +68,15 @@ struct DynamicStructInfo { #include + +#define KERNEL_VERSION_6_6 KERNEL_VERSION(6, 6, 0) + #define KERNEL_VERSION_6_1 KERNEL_VERSION(6, 1, 0) +#define KERNEL_VERSION_5_15 KERNEL_VERSION(5, 15, 0) + +#define KERNEL_VERSION_5_10 KERNEL_VERSION(5, 10, 0) + #define KERNEL_VERSION_4_14 KERNEL_VERSION(4, 14, 0) @@ -98,7 +105,7 @@ DYNAMIC_STRUCT_BEGIN(mnt_namespace) DEFINE_MEMBER(mnt_namespace, root) DEFINE_MEMBER(mnt_namespace, seq) DEFINE_MEMBER(mnt_namespace, mounts) -#if LINUX_VERSION_CODE < KERNEL_VERSION_6_1 +#if LINUX_VERSION_CODE < KERNEL_VERSION_5_15 DEFINE_MEMBER(mnt_namespace, count) #endif DYNAMIC_STRUCT_END(mnt_namespace) @@ -112,10 +119,10 @@ DYNAMIC_STRUCT_BEGIN(kprobe) DEFINE_MEMBER(kprobe, offset) DEFINE_MEMBER(kprobe, pre_handler) DEFINE_MEMBER(kprobe, post_handler) -#if LINUX_VERSION_CODE < KERNEL_VERSION_6_1 +#if LINUX_VERSION_CODE < KERNEL_VERSION_5_15 DEFINE_MEMBER(kprobe, fault_handler) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION_4_14 +#if LINUX_VERSION_CODE < KERNEL_VERSION_5_10 DEFINE_MEMBER(kprobe, break_handler) #endif DEFINE_MEMBER(kprobe, flags)