linux-stable/net/wireless
Johannes Berg d16c5dfe93 wext: fix NULL-ptr-dereference with cfg80211's lack of commit()
commit 5122565188 upstream.

Since cfg80211 doesn't implement commit, we never really cared about
that code there (and it's configured out w/o CONFIG_WIRELESS_EXT).
After all, since it has no commit, it shouldn't return -EIWCOMMIT to
indicate commit is needed.

However, EIWCOMMIT is actually an alias for EINPROGRESS, which _can_
happen if e.g. we try to change the frequency but we're already in
the process of connecting to some network, and drivers could return
that value (or even cfg80211 itself might).

This then causes us to crash because dev->wireless_handlers is NULL
but we try to check dev->wireless_handlers->standard[0].

Fix this by also checking dev->wireless_handlers. Also simplify the
code a little bit.

Cc: stable@vger.kernel.org
Reported-by: syzbot+444248c79e117bc99f46@syzkaller.appspotmail.com
Reported-by: syzbot+8b2a88a09653d4084179@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/20210121171621.2076e4a37d5a.I5d9c72220fe7bb133fb718751da0180a57ecba4e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-03 23:28:38 +01:00
..
certs
.gitignore
ap.c
chan.c
core.c
core.h nl80211: validate key indexes for cfg80211_registered_device 2020-12-26 16:02:45 +01:00
debugfs.c
debugfs.h
ethtool.c
ibss.c
Kconfig cfg80211: select CONFIG_CRC32 2021-01-19 18:27:28 +01:00
lib80211.c
lib80211_crypt_ccmp.c
lib80211_crypt_tkip.c
lib80211_crypt_wep.c
Makefile
mesh.c
mlme.c
nl80211.c nl80211: validate key indexes for cfg80211_registered_device 2020-12-26 16:02:45 +01:00
nl80211.h
ocb.c
of.c
pmsr.c
radiotap.c
rdev-ops.h
reg.c
reg.h
scan.c nl80211/cfg80211: fix potential infinite loop 2020-12-30 11:53:03 +01:00
sme.c
sysfs.c
sysfs.h
trace.c
trace.h
util.c nl80211: validate key indexes for cfg80211_registered_device 2020-12-26 16:02:45 +01:00
wext-compat.c
wext-compat.h
wext-core.c wext: fix NULL-ptr-dereference with cfg80211's lack of commit() 2021-02-03 23:28:38 +01:00
wext-priv.c
wext-proc.c
wext-sme.c
wext-spy.c