From: Alexander Aring Date: Fri, 22 May 2015 15:43:51 +0000 (+0200) Subject: mac802154: fix hold rtnl while ioctl X-Git-Tag: v4.9.8~4072^2~183^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a669f7d72535017dd03cbcdf5af6e85edfdf90c;p=platform%2Fkernel%2Flinux-rpi3.git mac802154: fix hold rtnl while ioctl This patch fixes an issue to set address configuration with ioctl. Accessing the mib requires rtnl lock and the ndo_do_ioctl doesn't hold the rtnl lock while this callback is called. This patch do that manually. Signed-off-by: Alexander Aring Reported-by: Matteo Petracca Reviewed-by: Stefan Schmidt Signed-off-by: Marcel Holtmann --- diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c index 91b75ab..2a58788 100644 --- a/net/mac802154/iface.c +++ b/net/mac802154/iface.c @@ -62,8 +62,7 @@ mac802154_wpan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) (struct sockaddr_ieee802154 *)&ifr->ifr_addr; int err = -ENOIOCTLCMD; - ASSERT_RTNL(); - + rtnl_lock(); spin_lock_bh(&sdata->mib_lock); switch (cmd) { @@ -90,6 +89,7 @@ mac802154_wpan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) case SIOCSIFADDR: if (netif_running(dev)) { spin_unlock_bh(&sdata->mib_lock); + rtnl_unlock(); return -EBUSY; } @@ -112,6 +112,7 @@ mac802154_wpan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) } spin_unlock_bh(&sdata->mib_lock); + rtnl_unlock(); return err; }