[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250318172545.GR688833@kernel.org>
Date: Tue, 18 Mar 2025 17:25:45 +0000
From: Simon Horman <horms@...nel.org>
To: Stanislav Fomichev <sdf@...ichev.me>
Cc: netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, linux-kernel@...r.kernel.org,
aleksander.lobakin@...el.com,
syzbot+b0c03d76056ef6cd12a6@...kaller.appspotmail.com
Subject: Re: [PATCH net-next] net: vlan: don't propagate flags on open
On Thu, Mar 13, 2025 at 03:06:57AM -0700, Stanislav Fomichev wrote:
> With the device instance lock, there is now a possibility of a deadlock:
...
> Device setup:
>
> netdevsim0 (down)
> ^ ^
> bond netdevsim1.100@...devsim1 allmulticast=on (down)
>
> When we enslave the lower device (netdevsim0) which has a vlan, we
> propagate vlan's allmuti/promisc flags during ndo_open. This causes
> (re)locking on of the real_dev.
>
> Propagate allmulti/promisc on flags change, not on the open. There
> is a slight semantics change that vlans that are down now propagate
> the flags, but this seems unlikely to result in the real issues.
>
> Reproducer:
>
> echo 0 1 > /sys/bus/netdevsim/new_device
>
> dev_path=$(ls -d /sys/bus/netdevsim/devices/netdevsim0/net/*)
> dev=$(echo $dev_path | rev | cut -d/ -f1 | rev)
>
> ip link set dev $dev name netdevsim0
> ip link set dev netdevsim0 up
>
> ip link add link netdevsim0 name netdevsim0.100 type vlan id 100
> ip link set dev netdevsim0.100 allmulticast on down
> ip link add name bond1 type bond mode 802.3ad
> ip link set dev netdevsim0 down
> ip link set dev netdevsim0 master bond1
> ip link set dev bond1 up
> ip link show
>
> Reported-by: syzbot+b0c03d76056ef6cd12a6@...kaller.appspotmail.com
> Closes: https://lore.kernel.org/netdev/Z9CfXjLMKn6VLG5d@mini-arch/T/#m15ba130f53227c883e79fb969687d69d670337a0
> Signed-off-by: Stanislav Fomichev <sdf@...ichev.me>
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists