lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 11 May 2022 18:14:28 +0300
From:   Vladimir Oltean <vladimir.oltean@....com>
To:     netdev@...r.kernel.org
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>
Subject: [PATCH net-next 2/5] net: dsa: tag_brcm: do not account for tag length twice when padding

brcm_tag_xmit_ll() explains in the comment that the skb length
(sans FCS) must be at least 60 octets before adding the tag, and 64
octets after adding the tag.

But it pads the skb to 64 octets, then pushes a Broadcom tag which
increases the length to 68. With FCS, this length would be 72.

According to the comment, this is not what the minimum length is,
so just pad small packets up to 60 octets to bring them in sync.

Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
---
 net/dsa/tag_brcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c
index 96dbb8ee2fee..6cc4c4859a41 100644
--- a/net/dsa/tag_brcm.c
+++ b/net/dsa/tag_brcm.c
@@ -93,7 +93,7 @@ static struct sk_buff *brcm_tag_xmit_ll(struct sk_buff *skb,
 	 *
 	 * Let dsa_slave_xmit() free the SKB
 	 */
-	if (__skb_put_padto(skb, ETH_ZLEN + BRCM_TAG_LEN, false))
+	if (__skb_put_padto(skb, ETH_ZLEN, false))
 		return NULL;
 
 	skb_push(skb, BRCM_TAG_LEN);
@@ -223,7 +223,7 @@ static struct sk_buff *brcm_leg_tag_xmit(struct sk_buff *skb,
 	 *
 	 * Let dsa_slave_xmit() free the SKB
 	 */
-	if (__skb_put_padto(skb, ETH_ZLEN + BRCM_LEG_TAG_LEN, false))
+	if (__skb_put_padto(skb, ETH_ZLEN, false))
 		return NULL;
 
 	skb_push(skb, BRCM_LEG_TAG_LEN);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ