Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1011464lqh; Sun, 5 May 2024 11:43:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWOT1cKRV0xkF3rj4saE5F0JnwBvmL5jGsCdmF7jJlALXaT47tV0Enztg3Tpn3Y9HnQZC+tkpBZLoRq9vFUy9wKrj1l0N075Na/7Xj+aA== X-Google-Smtp-Source: AGHT+IHWGeoFDaE7kjQKj9v+GK6gAx6I2g9zLzPkP2j134Roi6x47H9fzVGLzBBbY1BhcI7YsUVe X-Received: by 2002:a05:6358:b00f:b0:183:f7cb:af75 with SMTP id l15-20020a056358b00f00b00183f7cbaf75mr9303303rwn.32.1714934590766; Sun, 05 May 2024 11:43:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714934590; cv=pass; d=google.com; s=arc-20160816; b=Fqkv7FG09FBdUqhJy34IUXFq8zYMl6H+ovDhkiEporzSpWAiq/tNM/IBUT/1gy0cHj TJEMsClr65qw+/fl9gMog4NYRCW13bI9uc2LuTnhqGHzxsrlxraPL8enXEtX1h4UrIVH rJvRjInHP+BxuZW1QqCXu6gIcJCNrqN373TnocDgbENuoZQWwyY7zXGoJpDj3x5XSW1F BGZaaOCalTi6RO9HefJLxI9lH68+V2ZzdGNceMtKyy+T9HvNne72jwDKiPdni69DH0jq WJimv6SPbOYqu09a/zLYXBfhY8Hxn2TwtadBxJCkfJXbYr6Fk3/NB4t8Dipfoqgxjs55 AC9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=TxMEun4WM8Bf7pKsihOkB1y9YtAU4T5UBt+gopLdKEM=; fh=6Ka+qYlsGrq5W+yEf22Wi8syKotyQA/bCeZg9ZRCx/g=; b=eecp5Kn+ix0zGq+q7TGRfoXlj++Kv5qDcnjv2lDCWDkKsNIgBhBCYOfX1iKG4y3Tt+ uUO4GtcxXySZpTN/3mCFeRU2oekf7Q56ROfG9mncP9hjPvy3YgJU5Fd/QrquJDopQFAx nbrlqTWu2VK60yQGyPUqmPvUjEPSP6nSF+8xfce1VgRGpxjxroFmHEa6G74MG9/pDXMj rOezNz7y0ItMmvmFfhfEGWsRZK0Soim46K5aUZGEt5fJC3ykB9m2uAvUwh/G+yk0oR7k /ZfK6lNGp/1eEJSlRoH/cD9owE9hUBDk4/og8vDHzMyEGqeFYz88spy0XOCdUnGJZurj 7QkQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=iTpVhqVh; arc=pass (i=1 dkim=pass dkdomain=nbd.name dmarc=pass fromdomain=nbd.name); spf=pass (google.com: domain of linux-kernel+bounces-169098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id mr23-20020a17090b239700b002a6aa10da05si6937767pjb.156.2024.05.05.11.43.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 11:43:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=iTpVhqVh; arc=pass (i=1 dkim=pass dkdomain=nbd.name dmarc=pass fromdomain=nbd.name); spf=pass (google.com: domain of linux-kernel+bounces-169098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 00091B20E86 for ; Sun, 5 May 2024 18:43:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 86F536CDD0; Sun, 5 May 2024 18:42:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b="iTpVhqVh" Received: from nbd.name (nbd.name [46.4.11.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C28A225569; Sun, 5 May 2024 18:42:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.4.11.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714934578; cv=none; b=rg37YGh0RZS6ewYRxc/FfSCnU+QC0FlxMSifZ6Mh6buL5s07/0wIcHP1VsXH60icLYdFD/t3fjt39RjG4BGGVm/+pfW793oHbAolCsTfzcVLQK1TRilXOVV1T2VcYd7kFhIxa+y4dad5o6oiWp4QyJr6xTipRUPShKWif+syAGI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714934578; c=relaxed/simple; bh=G5DPjNlDALLX+7ggljBcHdccInr82HLwhv0mrQTkjU8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WZGNYtT6VlIyh9UI1w4I2eTVcA7F5Zq88bByl6XezlfNTHGldCzFEza/QC1cTCEJCcDhfmwctWNLlPoz0GZ5VaLAuhi5h/fZ9SCU8R9VE+O5BXjMXQpSRN4hIDDRvnVumWUbZY75gauUzrhDLa7z3BUHi9G1jCQyE3Qr2kdmV2A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name; spf=none smtp.mailfrom=nbd.name; dkim=pass (1024-bit key) header.d=nbd.name header.i=@nbd.name header.b=iTpVhqVh; arc=none smtp.client-ip=46.4.11.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nbd.name Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=nbd.name DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=TxMEun4WM8Bf7pKsihOkB1y9YtAU4T5UBt+gopLdKEM=; b=iTpVhqVhUVT8ek+sNxcvaiUNL7 yNsO61wAYS3k1/h1DmckHZhWk06Lt/8el1NYSJQqB5nuD/IiACf8J2A8im6ZUv1XELAna2PUr0rpT XEcsgaIc+YD9GWxM46tdz8zlIsgHQN6iB52ORQjVjBwGnfBWqNnWShoMUytWTkpIHym0=; Received: from p54ae9c93.dip0.t-ipconnect.de ([84.174.156.147] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.96) (envelope-from ) id 1s3goq-00DAxa-0D; Sun, 05 May 2024 20:42:40 +0200 From: Felix Fietkau To: netdev@vger.kernel.org, Roopa Prabhu , Nikolay Aleksandrov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: bridge@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH net] net: bridge: fix corrupted ethernet header on multicast-to-unicast Date: Sun, 5 May 2024 20:42:38 +0200 Message-ID: <20240505184239.15002-1-nbd@nbd.name> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The change from skb_copy to pskb_copy unfortunately changed the data copying to omit the ethernet header, since it was pulled before reaching this point. Fix this by calling __skb_push/pull around pskb_copy. Fixes: 59c878cbcdd8 ("net: bridge: fix multicast-to-unicast with fraglist GSO") Signed-off-by: Felix Fietkau --- net/bridge/br_forward.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c index d7c35f55bd69..d97064d460dc 100644 --- a/net/bridge/br_forward.c +++ b/net/bridge/br_forward.c @@ -258,6 +258,7 @@ static void maybe_deliver_addr(struct net_bridge_port *p, struct sk_buff *skb, { struct net_device *dev = BR_INPUT_SKB_CB(skb)->brdev; const unsigned char *src = eth_hdr(skb)->h_source; + struct sk_buff *nskb; if (!should_deliver(p, skb)) return; @@ -266,12 +267,16 @@ static void maybe_deliver_addr(struct net_bridge_port *p, struct sk_buff *skb, if (skb->dev == p->dev && ether_addr_equal(src, addr)) return; - skb = pskb_copy(skb, GFP_ATOMIC); - if (!skb) { + __skb_push(skb, ETH_HLEN); + nskb = pskb_copy(skb, GFP_ATOMIC); + __skb_pull(skb, ETH_HLEN); + if (!nskb) { DEV_STATS_INC(dev, tx_dropped); return; } + skb = nskb; + __skb_pull(skb, ETH_HLEN); if (!is_broadcast_ether_addr(addr)) memcpy(eth_hdr(skb)->h_dest, addr, ETH_ALEN); -- 2.44.0