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]
Message-ID: <ff7e60bf-13c9-44fe-b9e0-0f1ef4904745@gmail.com>
Date:   Thu, 2 Nov 2023 11:43:25 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Linus Walleij <linus.walleij@...aro.org>,
        Andrew Lunn <andrew@...n.ch>,
        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>,
        Luiz Angelo Daros de Luca <luizluca@...il.com>
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net v3] net: dsa: tag_rtl4_a: Bump min packet size

On 11/1/23 13:18, Linus Walleij wrote:
> On Tue, Oct 31, 2023 at 11:45 PM Linus Walleij <linus.walleij@...aro.org> wrote:
> 
>> It was reported that the "LuCI" web UI was not working properly
>> with a device using the RTL8366RB switch. Disabling the egress
>> port tagging code made the switch work again, but this is not
>> a good solution as we want to be able to direct traffic to a
>> certain port.
> 
> Luiz is not seeing this on his ethernet controller so:
> 
> pw-bot: cr
> 
> (I've seen Vladmir do this, I don't know what it means, but seems
> to be how to hold back patches.)

Looking at drivers/net/ethernet/cortina/gemini.c, should not we account 
for when the MAC is used as a conduit and include the right amount of 
"MTU" bytes? Something like this (compile tested only):

diff --git a/drivers/net/ethernet/cortina/gemini.c 
b/drivers/net/ethernet/cortina/gemini.c
index 5423fe26b4ef..5143f3734c3b 100644
--- a/drivers/net/ethernet/cortina/gemini.c
+++ b/drivers/net/ethernet/cortina/gemini.c
@@ -36,6 +36,7 @@
  #include <linux/ethtool.h>
  #include <linux/tcp.h>
  #include <linux/u64_stats_sync.h>
+#include <net/dsa.h>

  #include <linux/in.h>
  #include <linux/ip.h>
@@ -1151,6 +1152,13 @@ static int gmac_map_tx_bufs(struct net_device 
*netdev, struct sk_buff *skb,
         if (skb->protocol == htons(ETH_P_8021Q))
                 mtu += VLAN_HLEN;

+#if IS_ENABLED(CONFIG_NET_DSA)
+       if (netdev_uses_dsa(netdev)) {
+               const struct dsa_device_ops *ops = 
skb->dev->dsa_ptr->tag_ops;
+               mtu += ops->needed_headroom;
+       }
+#endif
+
         word1 = skb->len;
         word3 = SOF_BIT;

Also, as a separate check, might be worth annotating the various 
descriptor words with __le32 and appropriate le32_to_cpu() and 
cpu_to_le32() accessors for each of those fields.
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ