Re: [PATCH AUTOSEL 5.10 13/15] net: vlan: don't propagate flags on open

Pavel Machek
2025-04-18T17:01:35Z

[-- Attachment #1: Type: text/plain, Size: 2522 bytes --]

On Thu 2025-04-03 15:10:00, Sasha Levin wrote:
> From: Stanislav Fomichev <sdf@fomichev.me>
>
> [ Upstream commit 27b918007d96402aba10ed52a6af8015230f1793 ]
>
> With the device instance lock, there is now a possibility of a deadlock:

"now". Does the same problem exist in 5.10?

Best regards,
Pavel

> --- a/net/8021q/vlan_dev.c
> +++ b/net/8021q/vlan_dev.c
> @@ -272,17 +272,6 @@ static int vlan_dev_open(struct net_device *dev)
> goto out;
> }
>
> - if (dev->flags & IFF_ALLMULTI) {
> - err = dev_set_allmulti(real_dev, 1);
> - if (err < 0)
> - goto del_unicast;
> - }
> - if (dev->flags & IFF_PROMISC) {
> - err = dev_set_promiscuity(real_dev, 1);
> - if (err < 0)
> - goto clear_allmulti;
> - }
> -
> ether_addr_copy(vlan->real_dev_addr, real_dev->dev_addr);
>
> if (vlan->flags & VLAN_FLAG_GVRP)
> @@ -296,12 +285,6 @@ static int vlan_dev_open(struct net_device *dev)
> netif_carrier_on(dev);
> return 0;
>
> -clear_allmulti:
> - if (dev->flags & IFF_ALLMULTI)
> - dev_set_allmulti(real_dev, -1);
> -del_unicast:
> - if (!ether_addr_equal(dev->dev_addr, real_dev->dev_addr))
> - dev_uc_del(real_dev, dev->dev_addr);
> out:
> netif_carrier_off(dev);
> return err;
> @@ -314,10 +297,6 @@ static int vlan_dev_stop(struct net_device *dev)
>
> dev_mc_unsync(real_dev, dev);
> dev_uc_unsync(real_dev, dev);
> - if (dev->flags & IFF_ALLMULTI)
> - dev_set_allmulti(real_dev, -1);
> - if (dev->flags & IFF_PROMISC)
> - dev_set_promiscuity(real_dev, -1);
>
> if (!ether_addr_equal(dev->dev_addr, real_dev->dev_addr))
> dev_uc_del(real_dev, dev->dev_addr);
> @@ -474,12 +453,10 @@ static void vlan_dev_change_rx_flags(struct net_device *dev, int change)
> {
> struct net_device *real_dev = vlan_dev_priv(dev)->real_dev;
>
> - if (dev->flags & IFF_UP) {
> - if (change & IFF_ALLMULTI)
> - dev_set_allmulti(real_dev, dev->flags & IFF_ALLMULTI ? 1 : -1);
> - if (change & IFF_PROMISC)
> - dev_set_promiscuity(real_dev, dev->flags & IFF_PROMISC ? 1 : -1);
> - }
> + if (change & IFF_ALLMULTI)
> + dev_set_allmulti(real_dev, dev->flags & IFF_ALLMULTI ? 1 : -1);
> + if (change & IFF_PROMISC)
> + dev_set_promiscuity(real_dev, dev->flags & IFF_PROMISC ? 1 : -1);
> }
>
> static void vlan_dev_set_rx_mode(struct net_device *vlan_dev)

--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]