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: <20241216180300.23a54f27@kernel.org>
Date: Mon, 16 Dec 2024 18:03:00 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: longli@...uxonhyperv.com
Cc: Jason Gunthorpe <jgg@...pe.ca>, Leon Romanovsky <leon@...nel.org>, Ajay
 Sharma <sharmaajay@...rosoft.com>, Konstantin Taranov
 <kotaranov@...rosoft.com>, "David S. Miller" <davem@...emloft.net>, Eric
 Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Stephen
 Hemminger <stephen@...workplumber.org>, linux-rdma@...r.kernel.org,
 netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-hyperv@...r.kernel.org, Long Li <longli@...rosoft.com>
Subject: Re: [Patch net-next v2] hv_netvsc: Set device flags for properly
 indicating bonding in Hyper-V

On Fri, 13 Dec 2024 12:06:01 -0800 longli@...uxonhyperv.com wrote:
> Other kernel APIs (e.g those in "include/linux/netdevice.h") check for
> IFF_MASTER, IFF_SLAVE and IFF_BONDING for determing if those are used
> in a master/slave bonded setup. RDMA uses those APIs extensively when
> looking for master/slave devices. Netvsc's bonding setup with its slave
> device falls into this category.
> 
> Make hv_netvsc properly indicate bonding with its slave and change the
> API to reflect this bonding setup.

This is severely lacking in terms of safety analysis.

> @@ -2204,6 +2204,10 @@ static int netvsc_vf_join(struct net_device *vf_netdev,
>  		goto rx_handler_failed;
>  	}
>  
> +	vf_netdev->permanent_bond = 1;
> +	ndev->permanent_bond = 1;
> +	ndev->flags |= IFF_MASTER;

> @@ -2484,7 +2488,15 @@ static int netvsc_unregister_vf(struct net_device *vf_netdev)
>  
>  	reinit_completion(&net_device_ctx->vf_add);
>  	netdev_rx_handler_unregister(vf_netdev);
> +
> +	/* Unlink the slave device and clear flag */
> +	vf_netdev->permanent_bond = 0;
> +	ndev->permanent_bond = 0;

> + *	@permanent_bond: device is permanently bonded to another device

I think we have been taught a definition of the word "permanent"

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ