From d6084aeca14a9fc306e4d7bd7770c2e4cee5e4f7 Mon Sep 17 00:00:00 2001 From: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com> Date: Sat, 12 Apr 2025 16:09:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8super=5Faccess.c=E4=B8=AD=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=AF=B9linux/version.h=E7=9A=84=E5=BC=95=E7=94=A8?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E5=AE=9A=E4=B9=89KERNEL=5FVERSION=5F6=5F6?= =?UTF-8?q?=E5=AE=8F=EF=BC=8C=E4=BB=A5=E6=94=AF=E6=8C=81=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E5=86=85=E6=A0=B8=E7=89=88=E6=9C=AC=E7=9A=84=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E7=BC=96=E8=AF=91?= 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) // =====================================================================================================================