From 10e05689e5f32f0c815f2fede3117502b59a5d12 Mon Sep 17 00:00:00 2001 From: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com> Date: Sat, 12 Apr 2025 16:09:48 +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=20linux/version.h=20=E7=9A=84?= =?UTF-8?q?=E5=BC=95=E7=94=A8=EF=BC=8C=E5=B9=B6=E6=A0=B9=E6=8D=AE=E5=86=85?= =?UTF-8?q?=E6=A0=B8=E7=89=88=E6=9C=AC=E6=9D=A1=E4=BB=B6=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=88=90=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/kpm/super_access.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/kernel/kpm/super_access.c b/kernel/kpm/super_access.c index bc4cd768..1fd2491a 100644 --- a/kernel/kpm/super_access.c +++ b/kernel/kpm/super_access.c @@ -66,6 +66,11 @@ struct DynamicStructInfo { // ================================================================================== +#include + +#define KERNEL_VERSION_6_6 KERNEL_VERSION(6, 6, 0) + + #include <../fs/mount.h> #include @@ -87,27 +92,29 @@ DYNAMIC_STRUCT_BEGIN(vfsmount) DYNAMIC_STRUCT_END(vfsmount) DYNAMIC_STRUCT_BEGIN(mnt_namespace) - DEFINE_MEMBER(mnt_namespace, count) DEFINE_MEMBER(mnt_namespace, ns) DEFINE_MEMBER(mnt_namespace, root) DEFINE_MEMBER(mnt_namespace, seq) DEFINE_MEMBER(mnt_namespace, mounts) +#if LINUX_VERSION_CODE < KERNEL_VERSION_6_6 + DEFINE_MEMBER(mnt_namespace, count) +#endif DYNAMIC_STRUCT_END(mnt_namespace) #include #ifdef CONFIG_KPROBES - DYNAMIC_STRUCT_BEGIN(kprobe) DEFINE_MEMBER(kprobe, addr) DEFINE_MEMBER(kprobe, symbol_name) DEFINE_MEMBER(kprobe, offset) DEFINE_MEMBER(kprobe, pre_handler) DEFINE_MEMBER(kprobe, post_handler) +#if LINUX_VERSION_CODE < KERNEL_VERSION_6_6 DEFINE_MEMBER(kprobe, fault_handler) +#endif DEFINE_MEMBER(kprobe, flags) DYNAMIC_STRUCT_END(kprobe) - #endif #include @@ -143,7 +150,9 @@ DYNAMIC_STRUCT_BEGIN(netlink_kernel_cfg) DEFINE_MEMBER(netlink_kernel_cfg, cb_mutex) DEFINE_MEMBER(netlink_kernel_cfg, bind) DEFINE_MEMBER(netlink_kernel_cfg, unbind) +#if LINUX_VERSION_CODE < KERNEL_VERSION_6_6 DEFINE_MEMBER(netlink_kernel_cfg, compare) +#endif DYNAMIC_STRUCT_END(netlink_kernel_cfg) // =====================================================================================================================