]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: nl80211: re-check wiphy netns in nl80211_prepare_wdev_dump() continuation
authorMaoyi Xie <maoyi.xie@ntu.edu.sg>
Wed, 6 May 2026 06:48:54 +0000 (14:48 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 6 May 2026 09:08:41 +0000 (11:08 +0200)
commit79240f3f6d766b342b57c32397d643e1cfa26b81
tree4c8b6a50859545d9573fb2f741fc037a63873bd1
parent15994bb0cbb8fc4879da7552ddd08c1896261c39
wifi: nl80211: re-check wiphy netns in nl80211_prepare_wdev_dump() continuation

NL80211_CMD_GET_SCAN is implemented as a multi-call dumpit. The first
invocation of nl80211_prepare_wdev_dump() validates the requested wdev
against the caller's netns via __cfg80211_wdev_from_attrs(). Subsequent
invocations look up the same wiphy by its global index and do not check
that the wiphy is still in the caller's netns.

Add the same filter to the continuation path. If the wiphy's netns no
longer matches the caller's, return -ENODEV and the netlink dump
machinery terminates the walk cleanly.

Signed-off-by: Maoyi Xie <maoyi.xie@ntu.edu.sg>
Link: https://patch.msgid.link/20260506064854.2207105-3-maoyixie.tju@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c