Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B39D5C7618B for ; Mon, 29 Jul 2019 08:45:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B3B220693 for ; Mon, 29 Jul 2019 08:45:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727752AbfG2IpL (ORCPT ); Mon, 29 Jul 2019 04:45:11 -0400 Received: from rs07.intra2net.com ([85.214.138.66]:54560 "EHLO rs07.intra2net.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727109AbfG2IpL (ORCPT ); Mon, 29 Jul 2019 04:45:11 -0400 X-Greylist: delayed 432 seconds by postgrey-1.27 at vger.kernel.org; Mon, 29 Jul 2019 04:45:10 EDT Received: from mail.m.i2n (unknown [172.17.128.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by rs07.intra2net.com (Postfix) with ESMTPS id C64A215002D1; Mon, 29 Jul 2019 10:37:57 +0200 (CEST) Received: from localhost (mail.m.i2n [127.0.0.1]) by localhost (Postfix) with ESMTP id 8B3397DE; Mon, 29 Jul 2019 10:37:57 +0200 (CEST) X-Virus-Scanned: by Intra2net Mail Security (AVE=8.3.54.68,VDF=8.16.19.170) Received: from rocinante.m.i2n (rocinante.m.i2n [172.16.1.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: smtp-auth-user) by mail.m.i2n (Postfix) with ESMTPSA id 0AC9D5C6; Mon, 29 Jul 2019 10:37:56 +0200 (CEST) From: Juliana Rodrigueiro To: pablo@netfilter.org, netfilter-devel@vger.kernel.org Subject: [PATCH] netfilter: nfacct: Fix alignment mismatch in xt_nfacct_match_info Date: Mon, 29 Jul 2019 10:37:55 +0200 Message-ID: <2781693.KLf3iWz6jR@rocinante.m.i2n> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org 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 Trying to append nfacct related rules results in an unhelpful message. Although it is suggested to look for more information in dmesg, nothing can be found there. # iptables -A -m nfacct --nfacct-name iptables: Invalid argument. Run `dmesg' for more information. This patch fixes the memory misalignment by enforcing 8-byte alignment within the struct. This solution is often used in many other uapi netfilter headers. Signed-off-by: Juliana Rodrigueiro --- include/uapi/linux/netfilter/xt_nfacct.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/netfilter/xt_nfacct.h b/include/uapi/linux/netfilter/xt_nfacct.h index 5c8a4d760ee3..576948f9bb6f 100644 --- a/include/uapi/linux/netfilter/xt_nfacct.h +++ b/include/uapi/linux/netfilter/xt_nfacct.h @@ -8,7 +8,7 @@ struct nf_acct; struct xt_nfacct_match_info { char name[NFACCT_NAME_MAX]; - struct nf_acct *nfacct; + struct nf_acct *nfacct __attribute__((aligned(8))); }; #endif /* _XT_NFACCT_MATCH_H */ -- 2.20.1