From 80098ab872ca5fcbd822a331b2a3f1bdc3a91244 Mon Sep 17 00:00:00 2001 From: Sylphia Date: Mon, 27 Aug 2018 16:35:00 -0700 Subject: [PATCH 1/2] Changed pointer types to aligned_u64 type to avoid struct size mismatch between 64bit kernel and 32bit user space --- .../sysroot/usr/include/linux/netfilter/xt_geoip.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/brcm-arm-hnd/crosstools-arm-gcc-5.3-linux-4.1-glibc-2.22-binutils-2.25/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/linux/netfilter/xt_geoip.h b/brcm-arm-hnd/crosstools-arm-gcc-5.3-linux-4.1-glibc-2.22-binutils-2.25/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/linux/netfilter/xt_geoip.h index 52adc8381..605767395 100644 --- a/brcm-arm-hnd/crosstools-arm-gcc-5.3-linux-4.1-glibc-2.22-binutils-2.25/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/linux/netfilter/xt_geoip.h +++ b/brcm-arm-hnd/crosstools-arm-gcc-5.3-linux-4.1-glibc-2.22-binutils-2.25/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/linux/netfilter/xt_geoip.h @@ -25,12 +25,12 @@ struct geoip_subnet { }; struct geoip_info { - struct geoip_subnet *subnets; + aligned_u64 subnets; u_int32_t count; u_int32_t ref; u_int16_t cc; - struct geoip_info *next; - struct geoip_info *prev; + aligned_u64 next; + aligned_u64 prev; }; struct xt_geoip_match_info { @@ -39,8 +39,8 @@ struct xt_geoip_match_info { u_int16_t cc[XT_GEOIP_MAX]; /* Used internally by the kernel */ - struct geoip_info *mem[XT_GEOIP_MAX]; - u_int8_t *refcount; + aligned_u64 mem[XT_GEOIP_MAX]; + aligned_u64 refcount; /* not implemented yet: void *fini; From d15fc286bc983879aa558e5e4cdfc6b1c6e43da8 Mon Sep 17 00:00:00 2001 From: Sylphia Windy Date: Thu, 26 Jan 2023 03:58:24 +0800 Subject: [PATCH 2/2] Changed pointer types to aligned_u64 type to avoid struct size mismatch between 64bit kernel and 32bit user space --- .../sysroot/usr/include/linux/netfilter/xt_geoip.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/brcm-arm-hnd/crosstools-arm-gcc-9.2-linux-4.19-glibc-2.30-binutils-2.32/arm-buildroot-linux-gnueabi/sysroot/usr/include/linux/netfilter/xt_geoip.h b/brcm-arm-hnd/crosstools-arm-gcc-9.2-linux-4.19-glibc-2.30-binutils-2.32/arm-buildroot-linux-gnueabi/sysroot/usr/include/linux/netfilter/xt_geoip.h index 52adc8381..605767395 100644 --- a/brcm-arm-hnd/crosstools-arm-gcc-9.2-linux-4.19-glibc-2.30-binutils-2.32/arm-buildroot-linux-gnueabi/sysroot/usr/include/linux/netfilter/xt_geoip.h +++ b/brcm-arm-hnd/crosstools-arm-gcc-9.2-linux-4.19-glibc-2.30-binutils-2.32/arm-buildroot-linux-gnueabi/sysroot/usr/include/linux/netfilter/xt_geoip.h @@ -25,12 +25,12 @@ struct geoip_subnet { }; struct geoip_info { - struct geoip_subnet *subnets; + aligned_u64 subnets; u_int32_t count; u_int32_t ref; u_int16_t cc; - struct geoip_info *next; - struct geoip_info *prev; + aligned_u64 next; + aligned_u64 prev; }; struct xt_geoip_match_info { @@ -39,8 +39,8 @@ struct xt_geoip_match_info { u_int16_t cc[XT_GEOIP_MAX]; /* Used internally by the kernel */ - struct geoip_info *mem[XT_GEOIP_MAX]; - u_int8_t *refcount; + aligned_u64 mem[XT_GEOIP_MAX]; + aligned_u64 refcount; /* not implemented yet: void *fini;