Check protocol number in nl80211 netlink socket release notification handler.
PATCH 2/2 Check protocol number in nl80211 netlink socket release notification handler.
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.
--- net/wireless/nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/nl80211.c +1 -1
@@ -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 ();
Signature · 1 line
2.1.4
Quoted 12 lines · Dmitry Ivanov
This patch corrects the problem where non-privileged user can create netlink socket with the same
port_idas used by hostapd but different protocol number. Uponclose()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 becauseport_idis unique within particular
protocol number only.
Applied.
johannes