linux/drivers/staging/rtl8723bs
Jia-Ju Bai 05e540b277 staging: rtl8723bs: Fix two possible sleep-in-atomic-context bugs in translate_scan()
The driver may sleep with holding a spinlock.
The function call paths (from bottom to top) in Linux-4.16.7 are:

[FUNC] kzalloc(GFP_KERNEL)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 323:
		kzalloc in translate_scan
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 1554:
		translate_scan in rtw_wx_get_scan
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 1533:
		spin_lock_bh in rtw_wx_get_scan

[FUNC] kzalloc(GFP_KERNEL)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 455:
		kzalloc in translate_scan
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 1554:
		translate_scan in rtw_wx_get_scan
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c, 1533:
		spin_lock_bh in rtw_wx_get_scan

To fix these bugs, GFP_KERNEL is replaced with GFP_ATOMIC.

These bugs are found by my static analysis tool (DSAC-2) and checked by
my code review.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28 22:05:05 +09:00
..
core treewide: Use array_size() in vzalloc() 2018-06-12 16:19:22 -07:00
hal staging: rtl8723bs: Add missing curly braces on else statement. 2018-06-28 22:03:16 +09:00
include staging: rtl8723bs: Rename PHY_GetTxPowerLimit(). 2018-06-28 22:03:16 +09:00
os_dep staging: rtl8723bs: Fix two possible sleep-in-atomic-context bugs in translate_scan() 2018-06-28 22:05:05 +09:00
Kconfig
Makefile staging: rtl8723bs: Rename 'Hal8723BPwrSeq.{c, h}' to 'hal_pwr_seq.*'. 2018-05-25 18:47:22 +02:00
TODO