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: <20230131170923-mutt-send-email-mst@kernel.org>
Date:   Tue, 31 Jan 2023 17:09:30 -0500
From:   "Michael S. Tsirkin" <mst@...hat.com>
To:     Laurent Vivier <lvivier@...hat.com>
Cc:     linux-kernel@...r.kernel.org,
        "David S. Miller" <davem@...emloft.net>,
        virtualization@...ts.linux-foundation.org,
        Cindy Lu <lulu@...hat.com>, Eli Cohen <elic@...dia.com>,
        Gautam Dawar <gautam.dawar@...inx.com>,
        Eugenio PĂ©rez <eperezma@...hat.com>,
        Jason Wang <jasowang@...hat.com>, netdev@...r.kernel.org,
        Parav Pandit <parav@...dia.com>
Subject: Re: [PATCH v3 1/2] virtio_net: disable VIRTIO_NET_F_STANDBY if
 VIRTIO_NET_F_MAC is not set

On Fri, Jan 27, 2023 at 09:44:59PM +0100, Laurent Vivier wrote:
> failover relies on the MAC address to pair the primary and the standby
> devices:
> 
>   "[...] the hypervisor needs to enable VIRTIO_NET_F_STANDBY
>    feature on the virtio-net interface and assign the same MAC address
>    to both virtio-net and VF interfaces."
> 
>   Documentation/networking/net_failover.rst
> 
> This patch disables the STANDBY feature if the MAC address is not
> provided by the hypervisor.
> 
> Signed-off-by: Laurent Vivier <lvivier@...hat.com>

Acked-by: Michael S. Tsirkin <mst@...hat.com>

> ---
>  drivers/net/virtio_net.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 7723b2a49d8e..7d700f8e545a 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -3688,6 +3688,12 @@ static int virtnet_validate(struct virtio_device *vdev)
>  			__virtio_clear_bit(vdev, VIRTIO_NET_F_MTU);
>  	}
>  
> +	if (virtio_has_feature(vdev, VIRTIO_NET_F_STANDBY) &&
> +	    !virtio_has_feature(vdev, VIRTIO_NET_F_MAC)) {
> +		dev_warn(&vdev->dev, "device advertises feature VIRTIO_NET_F_STANDBY but not VIRTIO_NET_F_MAC, disabling standby");
> +		__virtio_clear_bit(vdev, VIRTIO_NET_F_STANDBY);
> +	}
> +
>  	return 0;
>  }
>  
> -- 
> 2.39.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ