From 64e88114437072b29bed8aae9eb04ed5e773708f Mon Sep 17 00:00:00 2001 From: Juliana Rodrigueiro Date: Tue, 20 Aug 2019 13:30:39 +0200 Subject: extensions: nfacct: Fix alignment mismatch in xt_nfacct_match_info When running a 64-bit kernel with a 32-bit iptables binary, the size of the xt_nfacct_match_info struct diverges. kernel: sizeof(struct xt_nfacct_match_info) : 40 iptables: sizeof(struct xt_nfacct_match_info)) : 36 This patch is the userspace fix of the memory misalignment. It introduces a v1 ABI with the correct alignment and stays compatible with unfixed revision 0 kernels. Signed-off-by: Juliana Rodrigueiro Signed-off-by: Pablo Neira Ayuso --- include/linux/netfilter/xt_nfacct.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/linux/netfilter') diff --git a/include/linux/netfilter/xt_nfacct.h b/include/linux/netfilter/xt_nfacct.h index 59ab00dd..04ec2b04 100644 --- a/include/linux/netfilter/xt_nfacct.h +++ b/include/linux/netfilter/xt_nfacct.h @@ -14,4 +14,9 @@ struct xt_nfacct_match_info { struct nf_acct *nfacct; }; +struct xt_nfacct_match_info_v1 { + char name[NFACCT_NAME_MAX]; + struct nf_acct *nfacct __attribute__((aligned(8))); +}; + #endif /* _XT_NFACCT_MATCH_H */ -- cgit v1.2.3