[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z3tSCOJH4fQ99cBe@fedora>
Date: Mon, 6 Jan 2025 03:46:16 +0000
From: Hangbin Liu <liuhangbin@...il.com>
To: Octavian Purdila <tavip@...gle.com>
Cc: jiri@...nulli.us, andrew+netdev@...n.ch, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, netdev@...r.kernel.org,
syzbot+3c47b5843403a45aef57@...kaller.appspotmail.com
Subject: Re: [PATCH net-next] team: prevent adding a device which is already
a team device lower
On Thu, Jan 02, 2025 at 11:50:25AM -0800, Octavian Purdila wrote:
> > I didn't test, what if enslave veth0 first and then add enslave veth0.1 later.
> >
>
> Hi Hangbin,
>
> Thanks for the review!
>
> I was not able to reproduce the crash with this scenario. I think this
> is because adding veth0.1 does not affect the link state for veth0,
> while in the original scenario bringing up veth0 would also bring up
> veth0.1.
>
> Regardless, allowing this setup seems risky and syzkaller may find
> other ways to trigger it, so maybe a more generic check like below
> would be better?
>
> list_for_each_entry(tmp, &team->port_list, list) {
> if (netdev_has_upper_dev(tmp->dev, port_dev) ||
> netdev_has_upper_dev(port_dev, tmp->dev)) {
> NL_SET_ERR_MSG(extack, "Device is a lower or
> upper of an enslaved device");
> netdev_err(dev, "Device %s is a lower or upper
> device of enslaved device %s\n",
> portname, tmp->dev->name);
> return -EBUSY;
> }
> }
>
> Although I am not sure if there are legitimate use-cases that this may restrict?
The logic makes sense to me. Let's see if Jiri has any comments.
Thanks
Hangbin
Powered by blists - more mailing lists