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: <47315.1747327157@vermin>
Date: Thu, 15 May 2025 18:39:17 +0200
From: Jay Vosburgh <jv@...sburgh.net>
To: Stanislav Fomichev <stfomichev@...il.com>
cc: Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
    davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
    jiri@...nulli.us, andrew+netdev@...n.ch, sdf@...ichev.me,
    linux-kernel@...r.kernel.org,
    syzbot+53485086a41dbb43270a@...kaller.appspotmail.com
Subject: Re: [PATCH net] team: grab team lock during team_change_rx_flags

Stanislav Fomichev <stfomichev@...il.com> wrote:

>On 05/15, Stanislav Fomichev wrote:
>> On 05/15, Jakub Kicinski wrote:
>> > On Wed, 14 May 2025 15:03:19 -0700 Stanislav Fomichev wrote:
>> > > --- a/drivers/net/team/team_core.c
>> > > +++ b/drivers/net/team/team_core.c
>> > > @@ -1778,8 +1778,8 @@ static void team_change_rx_flags(struct net_device *dev, int change)
>> > >  	struct team_port *port;
>> > >  	int inc;
>> > >  
>> > > -	rcu_read_lock();
>> > > -	list_for_each_entry_rcu(port, &team->port_list, list) {
>> > > +	mutex_lock(&team->lock);
>> > > +	list_for_each_entry(port, &team->port_list, list) {
>> > 
>> > I'm not sure if change_rx_flags is allowed to sleep.
>> > Could you try to test it on a bond with a child without IFF_UNICAST_FLT,
>> > add an extra unicast address to the bond and remove it?
>> > That should flip promisc on and off IIUC.
>> 
>> I see, looks like you're concerned about addr_list_lock spin lock in
>> dev_set_rx_mode? (or other callers of __dev_set_rx_mode) Let me try
>> to reproduce with your example, but seems like it's an issue, yes
>> and we have a lot of ndo_change_rx_flags callbacks that are sleepable :-(
>
>Hmm, both bond and team set IFF_UNICAST_FLT, so it seems adding/removing uc
>address on the bonding device should not flip promisc. But still will
>verify for real.

	I think Jakub is saying that adding a unicast address to the
bond would change promisc on the underlying device that's part of the
bond (a not-IFF_UNICAST_FLT interface), not on the bond itself.  The
question is whether that change of promisc in turn generates a sleeping
function warning.

	FWIW, I think an easy way to add a unicast MAC to a bond is to
configure a VLAN above the bond, then change the MAC address of the VLAN
interface (so it doesn't match the bond's).

	-J

---
	-Jay Vosburgh, jv@...sburgh.net

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ