linux/drivers/net/wireless/ath/ath6kl
Hui Peng 39d170b3cb ath6kl: fix a NULL-ptr-deref bug in ath6kl_usb_alloc_urb_from_pipe()
The `ar_usb` field of `ath6kl_usb_pipe_usb_pipe` objects
are initialized to point to the containing `ath6kl_usb` object
according to endpoint descriptors read from the device side, as shown
below in `ath6kl_usb_setup_pipe_resources`:

for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
	endpoint = &iface_desc->endpoint[i].desc;

	// get the address from endpoint descriptor
	pipe_num = ath6kl_usb_get_logical_pipe_num(ar_usb,
						endpoint->bEndpointAddress,
						&urbcount);
	......
	// select the pipe object
	pipe = &ar_usb->pipes[pipe_num];

	// initialize the ar_usb field
	pipe->ar_usb = ar_usb;
}

The driver assumes that the addresses reported in endpoint
descriptors from device side  to be complete. If a device is
malicious and does not report complete addresses, it may trigger
NULL-ptr-deref `ath6kl_usb_alloc_urb_from_pipe` and
`ath6kl_usb_free_urb_to_pipe`.

This patch fixes the bug by preventing potential NULL-ptr-deref
(CVE-2019-15098).

Signed-off-by: Hui Peng <benquike@gmail.com>
Reported-by: Hui Peng <benquike@gmail.com>
Reported-by: Mathias Payer <mathias.payer@nebelwelt.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-09-04 09:23:26 +03:00
..
bmi.c ath6kl: replace GFP_ATOMIC with GFP_KERNEL in ath6kl_bmi_init() 2018-07-31 10:48:45 +03:00
bmi.h
cfg80211.c net: ipv4: provide __rcu annotation for ifa_list 2019-06-02 18:08:36 -07:00
cfg80211.h
common.h ath6kl: add ath6kl_ prefix to crypto_type 2018-12-13 09:58:52 +01:00
core.c
core.h ath6kl: fix ath6kl_data_tx()'s return type 2018-04-27 14:34:32 +03:00
debug.c ath6kl: debug: Use struct_size() helper 2019-04-29 17:43:35 +03:00
debug.h ath6kl: add __printf verification to ath6kl_dbg 2017-04-13 15:43:39 +03:00
hif-ops.h
hif.c
hif.h
htc_mbox.c ath6kl: Fix a possible null-pointer dereference in ath6kl_htc_mbox_create() 2019-09-04 09:21:19 +03:00
htc_pipe.c ath6kl: remove redundant check of status != 0 2019-04-29 17:50:10 +03:00
htc-ops.h
htc.h
init.c wireless: remove unneeded semicolon 2019-02-01 14:25:41 +02:00
Kconfig ath: fix SPDX tags 2019-06-26 18:11:06 +03:00
main.c ath6kl: Mark expected switch fall-through 2018-11-05 13:22:13 +02:00
Makefile
recovery.c timer: Remove init_timer_deferrable() in favor of timer_setup() 2017-10-05 15:01:18 +02:00
sdio.c ath6kl: add support for Dell Wireless 1537 2018-06-13 14:42:54 +03:00
target.h
testmode.c netlink: make validation more configurable for future strictness 2019-04-27 17:07:21 -04:00
testmode.h
trace.c
trace.h ath: fix SPDX tags 2019-06-26 18:11:06 +03:00
txrx.c ath6kl: remove redundant variables netlen, orig_buf, orig_len, dropped and stats 2018-07-30 20:57:05 +03:00
usb.c ath6kl: fix a NULL-ptr-deref bug in ath6kl_usb_alloc_urb_from_pipe() 2019-09-04 09:23:26 +03:00
wmi.c ath6kl: add some bounds checking 2019-04-29 17:49:16 +03:00
wmi.h ath6kl: add ath6kl_ prefix to crypto_type 2018-12-13 09:58:52 +01:00