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=-8.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 BB2CDC433E5 for ; Thu, 25 Jun 2020 11:54:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9583820702 for ; Thu, 25 Jun 2020 11:54:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cumulusnetworks.com header.i=@cumulusnetworks.com header.b="dxn3mon9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404543AbgFYLyJ (ORCPT ); Thu, 25 Jun 2020 07:54:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404530AbgFYLyH (ORCPT ); Thu, 25 Jun 2020 07:54:07 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07AF6C061573 for ; Thu, 25 Jun 2020 04:54:07 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id 17so5628232wmo.1 for ; Thu, 25 Jun 2020 04:54:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cumulusnetworks.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=A+8DNTwPTrqWV9XPKAnnx4MrDkAfz5yRU2Rp9COzdPI=; b=dxn3mon9w6eseYb+gRQ3Op7xYvzJMstrGkYMYGq9ssAiklqMjA6dIPlJzlAO8kTMOM 7OfABoG7fcZguaTgR5jVnroL+UaRBunY42V9Ei8PFjS4N/R+i6yHPFXwU8Hl12ncM8EK TTIPMp9qQbZdqGqZhNpMUMPDgDgTWWOWo9MKQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=A+8DNTwPTrqWV9XPKAnnx4MrDkAfz5yRU2Rp9COzdPI=; b=BHdrI+uaLM44DoJ3lX3rVPK74Ek3WgrstMu5jZ4enVRHJiS/Rzhcs5J6/hF4JTlbN6 ivWCGW2fGxlemA/HjneORHMfDpJjFUDTaSQ3O0RuiYxKrik/tD7KZnRHqalxmjE+62c4 PCe5FFv4XKAEZeDu1bDx+f/TyM9UIqXfIpvcN/fO+1zexS+G7I05wGKBI1hfWe/QtDp9 EF281a52CQHRXubgJ4KSIEXN8fpwl+7XGNK4NTEQe26wabgENtAoTD5/slhuBL3xusmW SPgv9yPnX8XjtGo4t39Z1Wsz7CYS/fDZLxUzLT9qDwsZNKSUL37372OQRoBH4jb2NZDD Mzyw== X-Gm-Message-State: AOAM533ZIvV+BR9yJhGt4/7x+J0fyruTemxwCVN+fNZz//P6iTifcDs/ tcqkeiTiMXJhg7hc7g6sNC/XLA== X-Google-Smtp-Source: ABdhPJwn+XSqv+8QmTLeaF/shei+HCIPInxytmOVyfHe2owPXKtIpbIHfDTy9bkg0qZARd/9cnuOYg== X-Received: by 2002:a1c:7f81:: with SMTP id a123mr2952428wmd.107.1593086045745; Thu, 25 Jun 2020 04:54:05 -0700 (PDT) Received: from [192.168.0.109] (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id b17sm22128105wrp.32.2020.06.25.04.54.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Jun 2020 04:54:03 -0700 (PDT) Subject: Re: [PATCH] net: bridge: enfore alignment for ethernet address To: Thomas Martitz , netdev@vger.kernel.org Cc: Roopa Prabhu , "David S . Miller" , Jakub Kicinski , Felix Fietkau , stable@vger.kernel.org References: <20200625065407.1196147-1-t.martitz@avm.de> From: Nikolay Aleksandrov Message-ID: Date: Thu, 25 Jun 2020 14:54:02 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200625065407.1196147-1-t.martitz@avm.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 25/06/2020 09:54, Thomas Martitz wrote: > The eth_addr member is passed to ether_addr functions that require > 2-byte alignment, therefore the member must be properly aligned > to avoid unaligned accesses. > > The problem is in place since the initial merge of multicast to unicast: > commit 6db6f0eae6052b70885562e1733896647ec1d807 bridge: multicast to unicast > > Fixes: 6db6f0eae605 ("bridge: multicast to unicast") > Cc: Roopa Prabhu > Cc: Nikolay Aleksandrov > Cc: David S. Miller > Cc: Jakub Kicinski > Cc: Felix Fietkau > Cc: stable@vger.kernel.org > Signed-off-by: Thomas Martitz > --- > net/bridge/br_private.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h > index 7501be4eeba0..22cb2f1993ef 100644 > --- a/net/bridge/br_private.h > +++ b/net/bridge/br_private.h > @@ -217,8 +217,8 @@ struct net_bridge_port_group { > struct rcu_head rcu; > struct timer_list timer; > struct br_ip addr; > + unsigned char eth_addr[ETH_ALEN]; /* 2-byte aligned */ > unsigned char flags; > - unsigned char eth_addr[ETH_ALEN]; > }; > > struct net_bridge_mdb_entry { > Hi Thomas, To document it and guarantee that future struct changes won't break it I think it'd be a good idea to add __aligned(2) for that member instead of the comment. Other than that the patch looks good. Thanks, Nik