Skip to content

Commit f624bb6

Browse files
committed
wifi: nl80211: fix NULL-ptr deref in offchan check
If, e.g. in AP mode, the link was already created by userspace but not activated yet, it has a chandef but the chandef isn't valid and has no channel. Check for this and ignore this link. Fixes: 7b0a0e3 ("wifi: cfg80211: do some rework towards MLO link APIs") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Gregory Greenman <[email protected]> Link: https://lore.kernel.org/r/20230301115906.71bd4803fbb9.Iee39c0f6c2d3a59a8227674dc55d52e38b1090cf@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 44889ba commit f624bb6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/wireless/nl80211.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8901,7 +8901,7 @@ static bool cfg80211_off_channel_oper_allowed(struct wireless_dev *wdev,
89018901
struct cfg80211_chan_def *chandef;
89028902

89038903
chandef = wdev_chandef(wdev, link_id);
8904-
if (!chandef)
8904+
if (!chandef || !chandef->chan)
89058905
continue;
89068906

89078907
/*

0 commit comments

Comments
 (0)