WSL2-Linux-Kernel/net
Mohammed Shafi Shajakhan 21a8e9dd52 mac80211: Fix possible sband related NULL pointer de-reference
Existing API 'ieee80211_get_sdata_band' returns default 2 GHz band even
if the channel context configuration is NULL. This crashes for chipsets
which support 5 Ghz alone when it tries to access members of 'sband'.
Channel context configuration can be NULL in multivif case and when
channel switch is in progress (or) when it fails. Fix this by replacing
the API 'ieee80211_get_sdata_band' with  'ieee80211_get_sband' which
returns a NULL pointer for sband when the channel configuration is NULL.

An example scenario is as below:

In multivif mode (AP + STA) with drivers like ath10k, when we do a
channel switch in the AP vif (which has a number of clients connected)
and a STA vif which is connected to some other AP, when the channel
switch in AP vif fails, while the STA vifs tries to connect to the
other AP, there is a window where the channel context is NULL/invalid
and this results in a crash  while the clients connected to the AP vif
tries to reconnect and this race is very similar to the one investigated
by Michal in https://patchwork.kernel.org/patch/3788161/ and this does
happens with hardware that supports 5Ghz alone after long hours of
testing with continuous channel switch on the AP vif

ieee80211 phy0: channel context reservation cannot be finalized because
some interfaces aren't switching
wlan0: failed to finalize CSA, disconnecting
wlan0-1: deauthenticating from 8c:fd:f0:01:54:9c by local choice
	(Reason: 3=DEAUTH_LEAVING)

	WARNING: CPU: 1 PID: 19032 at net/mac80211/ieee80211_i.h:1013 sta_info_alloc+0x374/0x3fc [mac80211]
	[<bf77272c>] (sta_info_alloc [mac80211])
	[<bf78776c>] (ieee80211_add_station [mac80211]))
	[<bf73cc50>] (nl80211_new_station [cfg80211])

	Unable to handle kernel NULL pointer dereference at virtual
	address 00000014
	pgd = d5f4c000
	Internal error: Oops: 17 [#1] PREEMPT SMP ARM
	PC is at sta_info_alloc+0x380/0x3fc [mac80211]
	LR is at sta_info_alloc+0x37c/0x3fc [mac80211]
	[<bf772738>] (sta_info_alloc [mac80211])
	[<bf78776c>] (ieee80211_add_station [mac80211])
	[<bf73cc50>] (nl80211_new_station [cfg80211]))

Cc: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-04-28 12:28:44 +02:00
..
6lowpan 6lowpan: Don't set IFF_NO_QUEUE 2017-04-12 22:02:40 +02:00
9p
802
8021q netlink: pass extended ACK struct to parsing functions 2017-04-13 13:58:22 -04:00
appletalk
atm
ax25
batman-adv This feature/cleanup patchset includes the following patches: 2017-04-06 14:37:50 -07:00
bluetooth bluetooth: Do not set IFF_POINTOPOINT 2017-04-12 22:02:41 +02:00
bpf
bridge net: rtnetlink: plumb extended ack to doit function 2017-04-17 15:35:38 -04:00
caif
can can: network namespace support for CAN gateway 2017-04-25 09:04:30 +02:00
ceph
core net: Generic XDP 2017-04-25 13:33:49 -04:00
dcb net: rtnetlink: plumb extended ack to doit function 2017-04-17 15:35:38 -04:00
dccp
decnet net: rtnetlink: plumb extended ack to doit function 2017-04-17 15:35:38 -04:00
dns_resolver
dsa net: dsa: Remove redundant NULL dst check 2017-04-21 10:41:24 -04:00
ethernet
hsr netlink: extended ACK reporting 2017-04-13 13:58:20 -04:00
ieee802154 netlink: pass extended ACK struct where available 2017-04-13 13:58:22 -04:00
ife
ipv4 net/tcp_fastopen: Remove mss check in tcp_write_timeout() 2017-04-24 14:27:17 -04:00
ipv6 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-04-21 20:23:53 -07:00
ipx
irda
iucv
kcm kcm: remove a useless copy_from_user() 2017-04-17 13:28:48 -04:00
key Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-04-21 20:23:53 -07:00
l2tp l2tp: define "l2tpeth" device type 2017-04-25 11:41:56 -04:00
l3mdev
lapb
llc
mac80211 mac80211: Fix possible sband related NULL pointer de-reference 2017-04-28 12:28:44 +02:00
mac802154
mpls net: rtnetlink: plumb extended ack to doit function 2017-04-17 15:35:38 -04:00
ncsi
netfilter Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-04-15 21:16:30 -04:00
netlabel netlink: pass extended ACK struct to parsing functions 2017-04-13 13:58:22 -04:00
netlink netlink: pass extended ACK struct where available 2017-04-13 13:58:22 -04:00
netrom
nfc NFC 4.12 pull request 2017-04-21 15:29:40 -04:00
openvswitch openvswitch: Add eventmask support to CT action. 2017-04-24 13:53:25 -04:00
packet packet: add PACKET_FANOUT_FLAG_UNIQUEID to assign new fanout group id. 2017-04-24 12:46:00 -04:00
phonet net: rtnetlink: plumb extended ack to doit function 2017-04-17 15:35:38 -04:00
psample
qrtr Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-04-21 20:23:53 -07:00
rds
rfkill
rose
rxrpc
sched net sched actions: Complete the JUMPX opcode 2017-04-25 11:30:06 -04:00
sctp sctp: process duplicated strreset asoc request correctly 2017-04-18 13:39:50 -04:00
smc net/smc: do not use IB_SEND_INLINE together with mapped data 2017-04-11 23:01:14 -04:00
strparser
sunrpc
switchdev netlink: pass extended ACK struct to parsing functions 2017-04-13 13:58:22 -04:00
tipc tipc: check return value of nlmsg_new 2017-04-24 15:51:30 -04:00
unix af_unix: Use designated initializers 2017-04-06 12:43:04 -07:00
vmw_vsock VSOCK: Add virtio vsock vsockmon hooks 2017-04-24 12:35:56 -04:00
wimax
wireless cfg80211: add request id parameter to .sched_scan_stop() signature 2017-04-26 23:17:40 +02:00
x25
xfrm Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next 2017-04-21 15:11:28 -04:00
Kconfig
Makefile
compat.c
socket.c l2tp: device MTU setup, tunnel socket needs a lock 2017-04-17 13:01:48 -04:00
sysctl_net.c