* [PATCH] wifi: cfg80211: Fix error pointer dereference in nl80211_pre_doit()
@ 2026-10-15 15:22 Ethan Tidmore
0 siblings, 0 replies; only message in thread
From: Ethan Tidmore @ 2026-10-15 15:22 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, linux-kernel, Ethan Tidmore
nl80211_lock_and_recheck() can return an ERR_PTR on failure. If this
happens, 'wdev' holds an error pointer that bypasses the non-NULL
check at 'out' and gets passed into wdev_put(), resulting in a
dereference. Clear 'wdev' to NULL before jumping to 'out' to prevent
this.
Fixes: 8e3d9039d280 ("wifi: nl80211: avoid rtnl for commands that don't want it")
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
---
net/wireless/nl80211.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index d790e204aee3..7a5f7000fbaa 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -20192,6 +20192,7 @@ static int nl80211_pre_doit(const struct genl_split_ops *ops,
wdev = nl80211_lock_and_recheck(rdev, netns, wdev_id);
if (IS_ERR(wdev)) {
err = PTR_ERR(wdev);
+ wdev = NULL;
goto out;
}
}
--
Thanks,
ET
https://github.com/sponsors/ethantidmore
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-15 15:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-15 15:22 [PATCH] wifi: cfg80211: Fix error pointer dereference in nl80211_pre_doit() Ethan Tidmore
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox