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: Tue, 19 Dec 2023 16:02:24 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, 
	Willem de Bruijn <willemb@...gle.com>, netdev@...r.kernel.org, eric.dumazet@...il.com
Subject: Re: [PATCH net] net: check dev->gso_max_size in gso_features_check()

On Tue, Dec 19, 2023 at 3:42 PM Paolo Abeni <pabeni@...hat.com> wrote:
>
> On Tue, 2023-12-19 at 12:53 +0000, Eric Dumazet wrote:
> > diff --git a/net/core/dev.c b/net/core/dev.c
> > index 0432b04cf9b000628497345d9ec0e8a141a617a3..b55d539dca153f921260346a4f23bcce0e888227 100644
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> > @@ -3471,6 +3471,9 @@ static netdev_features_t gso_features_check(const struct sk_buff *skb,
> >       if (gso_segs > READ_ONCE(dev->gso_max_segs))
> >               return features & ~NETIF_F_GSO_MASK;
> >
> > +     if (unlikely(skb->len >= READ_ONCE(dev->gso_max_size)))
>
> Since we are checking vs the limit supported by the NIC, should the
> above be 'tso_max_size'?
>
> My understanding is that 'gso{,_ipv4}_max_size' is the max aggregate
> size the device asks for, and 'tso_max_size' is the actual limit
> supported by the NIC.
>

Problem is tso_max_size has been added very recently, depending on
this would make backports tricky.

I think the fix using gso_max_size is more portable to stable
versions, and allows the user to tweak the value,
and build tests.

As a bonus, dev->gso_max_size is in the net_device_read_tx cacheline,
while tso_max_size is currently far away.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ