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: <CAJ8uoz03-AcOwMj3-20ritbYQT9CSJMQ8oz6OuhyE-U=2F7+Gg@mail.gmail.com>
Date: Tue, 6 Feb 2024 10:55:39 +0100
From: Magnus Karlsson <magnus.karlsson@...il.com>
To: Toke Høiland-Jørgensen <toke@...hat.com>
Cc: magnus.karlsson@...el.com, bjorn@...nel.org, ast@...nel.org, 
	daniel@...earbox.net, netdev@...r.kernel.org, maciej.fijalkowski@...el.com, 
	kuba@...nel.org, pabeni@...hat.com, davem@...emloft.net, j.vosburgh@...il.com, 
	andy@...yhouse.net, hawk@...nel.org, john.fastabend@...il.com, 
	edumazet@...gle.com, bpf@...r.kernel.org, 
	Prashant Batra <prbatra.mail@...il.com>, Lorenzo Bianconi <lorenzo@...nel.org>
Subject: Re: [PATCH net] bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY

On Mon, 5 Feb 2024 at 14:08, Toke Høiland-Jørgensen <toke@...hat.com> wrote:
>
> Magnus Karlsson <magnus.karlsson@...il.com> writes:
>
> > From: Magnus Karlsson <magnus.karlsson@...el.com>
> >
> > Do not report the XDP capability NETDEV_XDP_ACT_XSK_ZEROCOPY as the
> > bonding driver does not support XDP and AF_XDP in zero-copy mode even
> > if the real NIC drivers do.
> >
> > Fixes: cb9e6e584d58 ("bonding: add xdp_features support")
> > Reported-by: Prashant Batra <prbatra.mail@...il.com>
> > Link: https://lore.kernel.org/all/CAJ8uoz2ieZCopgqTvQ9ZY6xQgTbujmC6XkMTamhp68O-h_-rLg@mail.gmail.com/T/
> > Signed-off-by: Magnus Karlsson <magnus.karlsson@...el.com>
> > ---
> >  drivers/net/bonding/bond_main.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> > index 4e0600c7b050..79a37bed097b 100644
> > --- a/drivers/net/bonding/bond_main.c
> > +++ b/drivers/net/bonding/bond_main.c
> > @@ -1819,6 +1819,8 @@ void bond_xdp_set_features(struct net_device *bond_dev)
> >       bond_for_each_slave(bond, slave, iter)
> >               val &= slave->dev->xdp_features;
> >
> > +     val &= ~NETDEV_XDP_ACT_XSK_ZEROCOPY;
> > +
> >       xdp_set_features_flag(bond_dev, val);
> >  }
> >
> > @@ -5910,8 +5912,10 @@ void bond_setup(struct net_device *bond_dev)
> >               bond_dev->features |= BOND_XFRM_FEATURES;
> >  #endif /* CONFIG_XFRM_OFFLOAD */
> >
> > -     if (bond_xdp_check(bond))
> > +     if (bond_xdp_check(bond)) {
> >               bond_dev->xdp_features = NETDEV_XDP_ACT_MASK;
> > +             bond_dev->xdp_features &= ~NETDEV_XDP_ACT_XSK_ZEROCOPY;
> > +     }
>
> Shouldn't we rather drop this assignment completely? It makes no sense
> to default to all features, it should default to none...

Good point. Seems the bond device defaults to supporting everything
before a device is bonded to it, but I might have misunderstood
something. Lorenzo, could you enlighten us please?

Thanks: Magnus

> -Toke
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ