linux/drivers/staging
Pavel Skripkin faec2c68ea staging: rtl8712: error handling refactoring
commit e9e6aa51b2 upstream.

There was strange error handling logic in case of fw load failure. For
some reason fw loader callback was doing clean up stuff when fw is not
available. I don't see any reason behind doing this. Since this driver
doesn't have EEPROM firmware let's just disconnect it in case of fw load
failure. Doing clean up stuff in 2 different place which can run
concurently is not good idea and syzbot found 2 bugs related to this
strange approach.

So, in this pacth I deleted all clean up code from fw callback and made
a call to device_release_driver() under device_lock(parent) in case of fw
load failure. This approach is more generic and it defend driver from UAF
bugs, since all clean up code is moved to one place.

Fixes: e02a3b9458 ("staging: rtl8712: fix memory leak in rtl871x_load_fw_cb")
Fixes: 8c213fa591 ("staging: r8712u: Use asynchronous firmware loading")
Cc: stable <stable@vger.kernel.org>
Reported-and-tested-by: syzbot+5872a520e0ce0a7c7230@syzkaller.appspotmail.com
Reported-and-tested-by: syzbot+cc699626e48a6ebaf295@syzkaller.appspotmail.com
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/d49ecc56e97c4df181d7bd4d240b031f315eacc3.1626895918.git.paskripkin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 13:22:14 +02:00
..
android
axis-fifo
board
clocking-wizard
comedi staging: comedi: tests: ni_routes_test: Fix compilation error 2021-05-14 09:50:15 +02:00
emxx_udc staging: emxx_udc: fix loop in _nbu2ss_nuke() 2021-06-03 09:00:49 +02:00
fbtft staging: fbtft: Don't spam logs when probe is deferred 2021-07-14 16:56:32 +02:00
fieldbus
fsl-dpaa2
fwserial staging: fwserial: fix TIOCGSERIAL implementation 2021-05-14 09:50:15 +02:00
gasket
gdm724x staging: gdm724x: check for overflow in gdm_lte_netif_rx() 2021-07-14 16:56:45 +02:00
goldfish
greybus staging: greybus: uart: fix unprivileged TIOCCSERIAL 2021-05-14 09:50:15 +02:00
gs_fpgaboot
hikey9xx
iio staging: iio: cdc: ad7746: avoid overwrite of num_channels 2021-06-03 09:00:32 +02:00
kpc2000
ks7010 staging: ks7010: prevent buffer overflow in ks_wlan_set_scan() 2021-03-17 17:06:32 +01:00
media media: v4l2-async: Clean v4l2_async_notifier_add_fwnode_remote_subdev 2021-07-14 16:56:11 +02:00
most staging: most: sound: add sanity check for function argument 2021-03-07 12:34:10 +01:00
mt7621-dma staging/mt7621-dma: mtk-hsdma.c->hsdma-mt7621.c 2021-03-04 11:38:33 +01:00
mt7621-dts staging: mt7621-dts: fix pci address for PCI memory range 2021-07-14 16:56:46 +02:00
mt7621-pci
mt7621-pci-phy
mt7621-pinctrl pinctrl: ralink: rt2880: avoid to error in calls is pin is already enabled 2021-06-23 14:42:49 +02:00
netlogic
nvec
octeon
octeon-usb
olpc_dcon
pi433
qlge
ralink-gdma
rtl8188eu staging: rtl8188eu: fix potential memory corruption in rtw_check_beacon_data() 2021-03-17 17:06:31 +01:00
rtl8192e staging: rtl8192e: Change state information from u16 to u8 2021-04-07 15:00:13 +02:00
rtl8192u staging: rtl8192u: Fix potential infinite loop 2021-05-14 09:50:15 +02:00
rtl8712 staging: rtl8712: error handling refactoring 2021-08-12 13:22:14 +02:00
rtl8723bs staging: rtl8723bs: Fix a resource leak in sd_int_dpc 2021-08-12 13:22:13 +02:00
rts5208
sm750fb
unisys
vc04_services staging: mmal-vchiq: Fix incorrect static vchiq_instance. 2021-07-14 16:56:39 +02:00
vme
vt6655
vt6656
wfx
wlan-ng
Kconfig
Makefile