* [PATCH 2/2] Check protocol number in nl80211 netlink socket release notification handler.
@ 2016-04-06 14:23 Dmitry Ivanov
2016-04-07 7:36 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Ivanov @ 2016-04-06 14:23 UTC (permalink / raw)
To: linux-wireless
This patch corrects the problem where non-privileged user can create
netlink socket with the same port_id as used by hostapd but different
protocol number. Upon close() or process termination, a notification is
sent to nl80211 subsystem which will destroy virtual wireless network
interfaces created by hostapd like it just died but in fact hostapd is
still running. This is possible because port_id is unique within particular
protocol number only.
Fixes: 026331c4d9b5 ("cfg80211/mac80211: allow registering for and sending action frames")
Signed-off-by: Dmitry Ivanov <dima@ubnt.com>
---
net/wireless/nl80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 98c9242..056a730 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -13216,7 +13216,7 @@ static int nl80211_netlink_notify(struct notifier_block * nb,
struct wireless_dev *wdev;
struct cfg80211_beacon_registration *reg, *tmp;
- if (state != NETLINK_URELEASE)
+ if (state != NETLINK_URELEASE || notify->protocol != NETLINK_GENERIC)
return NOTIFY_DONE;
rcu_read_lock();
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/2] Check protocol number in nl80211 netlink socket release notification handler.
2016-04-06 14:23 [PATCH 2/2] Check protocol number in nl80211 netlink socket release notification handler Dmitry Ivanov
@ 2016-04-07 7:36 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2016-04-07 7:36 UTC (permalink / raw)
To: Dmitry Ivanov, linux-wireless
On Wed, 2016-04-06 at 17:23 +0300, Dmitry Ivanov wrote:
> This patch corrects the problem where non-privileged user can create
> netlink socket with the same port_id as used by hostapd but different
> protocol number. Upon close() or process termination, a notification
> is
> sent to nl80211 subsystem which will destroy virtual wireless
> network
> interfaces created by hostapd like it just died but in fact hostapd
> is
> still running. This is possible because port_id is unique within
> particular
> protocol number only.
>
Applied.
johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-07 7:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-06 14:23 [PATCH 2/2] Check protocol number in nl80211 netlink socket release notification handler Dmitry Ivanov
2016-04-07 7:36 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).