From: Simon Horman <horms@kernel.org>
To: Stanislav Fomichev <sdf@fomichev.me>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org,
aleksander.lobakin@intel.com,
syzbot+b0c03d76056ef6cd12a6@syzkaller.appspotmail.com
Subject: Re: [PATCH net-next] net: vlan: don't propagate flags on open
Date: Tue, 18 Mar 2025 17:25:45 +0000 [thread overview]
Message-ID: <20250318172545.GR688833@kernel.org> (raw)
In-Reply-To: <20250313100657.2287455-1-sdf@fomichev.me>
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@netdevsim1 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@syzkaller.appspotmail.com
> Closes: https://lore.kernel.org/netdev/Z9CfXjLMKn6VLG5d@mini-arch/T/#m15ba130f53227c883e79fb969687d69d670337a0
> Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2025-03-18 17:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-13 10:06 [PATCH net-next] net: vlan: don't propagate flags on open Stanislav Fomichev
2025-03-18 17:25 ` Simon Horman [this message]
2025-03-20 9:00 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250318172545.GR688833@kernel.org \
--to=horms@kernel.org \
--cc=aleksander.lobakin@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=syzbot+b0c03d76056ef6cd12a6@syzkaller.appspotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).