Re: [PATCH net v4 00/12] net: fix nested device bugs

From
Johannes Berg <johannes@sipsolutions.net>
Date
2019-09-28 19:20:38
Also in
linux-wireless
Reply to
Taehee Yoo, 2019-09-28
VLAN, BONDING, TEAM, MACSEC, MACVLAN, IPVLAN, VIRT_WIFI and VXLAN.
But I couldn't test all interface types so there could be more device
types which have similar problems.
Did you test virt_wifi? I don't see how it *doesn't* have the nesting
problem, and you didn't change it?

No, I see. You're limiting the nesting generally now in patch 1, and the
others are just lockdep fixups (I guess it's surprising virt_wifi
doesn't do this at all?).

FWIW I don't think virt_wifi really benefits at all from stacking, so we
could just do something like
--- a/drivers/net/wireless/virt_wifi.c
+++ b/drivers/net/wireless/virt_wifi.c
@@ -508,6 +508,9 @@ static int virt_wifi_newlink(struct net *src_net, struct net_device *dev,
        else if (dev->mtu > priv->lowerdev->mtu)
                return -EINVAL;
 
+       if (priv->lowerdev->ieee80211_ptr)
+               return -EINVAL;
+
        err = netdev_rx_handler_register(priv->lowerdev, virt_wifi_rx_handler,
                                         priv);
        if (err) {


IMHO, but of course generally limiting the stack depth is needed anyway
and solves the problem well enough for virt_wifi.


johannes
Thread (37 messages) 37 messages, 4 authors, last reply 2019-10-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help