From: Alexander Aring <alex.aring@gmail.com>
To: linux-wpan@vger.kernel.org
Cc: kernel@pengutronix.de, Alexander Aring <alex.aring@gmail.com>
Subject: [PATCH bluetooth-next 1/4] mac802154: fix hold rtnl while ioctl
Date: Fri, 22 May 2015 10:57:08 +0200 [thread overview]
Message-ID: <1432285031-3360-2-git-send-email-alex.aring@gmail.com> (raw)
In-Reply-To: <1432285031-3360-1-git-send-email-alex.aring@gmail.com>
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 <alex.aring@gmail.com>
Reported-by: Matteo Petracca <matteo.petracca@sssup.it>
---
net/mac802154/iface.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
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;
}
--
2.4.1
next prev parent reply other threads:[~2015-05-22 8:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-22 8:57 [PATCH bluetooth-next 0/4] mac802154: remove pib/mib locks and locking fixes Alexander Aring
2015-05-22 8:57 ` Alexander Aring [this message]
2015-05-22 12:15 ` [PATCH bluetooth-next 1/4] mac802154: fix hold rtnl while ioctl Stefan Schmidt
2015-05-22 8:57 ` [PATCH bluetooth-next 2/4] mac802154: remove pib lock Alexander Aring
2015-05-22 12:19 ` Stefan Schmidt
2015-05-22 12:41 ` Alexander Aring
2015-05-22 12:48 ` Stefan Schmidt
2015-05-22 8:57 ` [PATCH bluetooth-next 3/4] mac802154: remove mib lock Alexander Aring
2015-05-22 12:25 ` Stefan Schmidt
2015-05-22 8:57 ` [PATCH bluetooth-next 4/4] mac802154: use atomic ops for sequence incrementation Alexander Aring
2015-05-22 8:59 ` Marc Kleine-Budde
2015-05-22 10:30 ` Stefan Schmidt
2015-05-22 10:34 ` Marc Kleine-Budde
2015-05-22 10:40 ` Stefan Schmidt
2015-05-22 12:12 ` Alexander Aring
2015-05-22 12:33 ` Stefan Schmidt
2015-05-22 12:27 ` Stefan Schmidt
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=1432285031-3360-2-git-send-email-alex.aring@gmail.com \
--to=alex.aring@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-wpan@vger.kernel.org \
/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