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, 27 Oct 2021 06:28:45 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Jason Wang <jasowang@...hat.com>
Cc:     davem <davem@...emloft.net>, netdev <netdev@...r.kernel.org>,
        mst <mst@...hat.com>,
        virtualization <virtualization@...ts.linux-foundation.org>
Subject: Re: [PATCH net-next] net: virtio: use eth_hw_addr_set()

On Wed, 27 Oct 2021 10:45:18 +0800 Jason Wang wrote:
> On Wed, Oct 27, 2021 at 1:56 AM Jakub Kicinski <kuba@...nel.org> wrote:
> >
> > Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
> > of VLANs...") introduced a rbtree for faster Ethernet address look
> > up. To maintain netdev->dev_addr in this tree we need to make all
> > the writes to it go through appropriate helpers.  
> 
> I think the title should be "net: virtio: use eth_hw_addr_set()"

Sorry about that, will fix.

> > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> > index c501b5974aee..b7f35aff8e82 100644
> > --- a/drivers/net/virtio_net.c
> > +++ b/drivers/net/virtio_net.c
> > @@ -3177,12 +3177,16 @@ static int virtnet_probe(struct virtio_device *vdev)
> >         dev->max_mtu = MAX_MTU;
> >
> >         /* Configuration may specify what MAC to use.  Otherwise random. */
> > -       if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC))
> > +       if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC)) {
> > +               u8 addr[MAX_ADDR_LEN];
> > +
> >                 virtio_cread_bytes(vdev,
> >                                    offsetof(struct virtio_net_config, mac),
> > -                                  dev->dev_addr, dev->addr_len);
> > -       else
> > +                                  addr, dev->addr_len);
> > +               dev_addr_set(dev, addr);
> > +       } else {
> >                 eth_hw_addr_random(dev);
> > +       }  
> 
> Do we need to change virtnet_set_mac_address() as well?

It uses eth_commit_mac_addr_change() which DTRT internally.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ