kernel_optimize_test/drivers/usb/misc
Jia-Ju Bai bc8acc214d usb: misc: uss720: Fix two sleep-in-atomic-context bugs
async_complete() in uss720.c is a completion handler function for the
USB driver. So it should not sleep, but it is can sleep according to the
function call paths (from bottom to top) in Linux-4.16.

[FUNC] set_1284_register(GFP_KERNEL)
drivers/usb/misc/uss720.c, 372:
  set_1284_register in parport_uss720_frob_control
drivers/parport/ieee1284.c, 560:
  [FUNC_PTR]parport_uss720_frob_control in parport_ieee1284_ack_data_avail
drivers/parport/ieee1284.c, 577:
  parport_ieee1284_ack_data_avail in parport_ieee1284_interrupt
./include/linux/parport.h, 474:
  parport_ieee1284_interrupt in parport_generic_irq
drivers/usb/misc/uss720.c, 116:
  parport_generic_irq in async_complete

[FUNC] get_1284_register(GFP_KERNEL)
drivers/usb/misc/uss720.c, 382:
  get_1284_register in parport_uss720_read_status
drivers/parport/ieee1284.c, 555:
  [FUNC_PTR]parport_uss720_read_status in parport_ieee1284_ack_data_avail
drivers/parport/ieee1284.c, 577:
  parport_ieee1284_ack_data_avail in parport_ieee1284_interrupt
./include/linux/parport.h, 474:
  parport_ieee1284_interrupt in parport_generic_irq
drivers/usb/misc/uss720.c, 116:
  parport_generic_irq in async_complete

Note that [FUNC_PTR] means a function pointer call is used.

To fix these bugs, GFP_KERNEL is replaced with GFP_ATOMIC.

These bugs are found by my static analysis tool DSAC.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-05 14:36:53 +02:00
..
sisusbvga usb-misc: sisusbvga: remove redundant variable modey 2018-07-13 15:41:56 +02:00
adutux.c usb: adutux: use irqsave() in USB's complete callback 2018-06-28 19:36:06 +09:00
appledisplay.c USB: mark expected switch fall-throughs 2018-07-02 18:08:19 +02:00
chaoskey.c USB: chaoskey: Use kasprintf() over strcpy()/strcat() 2018-02-22 15:17:05 +01:00
cypress_cy7c63.c
cytherm.c
ehset.c
emi26.c
emi62.c
ezusb.c
ftdi-elan.c
idmouse.c
iowarrior.c usb: iowarrior: remove intr_idx_lock 2018-06-28 19:36:06 +09:00
isight_firmware.c
Kconfig
ldusb.c usb: ldusb: use irqsave() in USB's complete callback 2018-06-28 19:36:06 +09:00
legousbtower.c usb: legousbtower: use irqsave() in USB's complete callback 2018-06-28 19:36:07 +09:00
lvstest.c
Makefile
rio500_usb.h
rio500.c
trancevibrator.c
usb_u132.h
usb251xb.c
usb3503.c
usb4604.c
usblcd.c
usbsevseg.c
usbtest.c usb: usbtest: use irqsave() in USB's complete callback 2018-07-06 16:36:19 +02:00
uss720.c usb: misc: uss720: Fix two sleep-in-atomic-context bugs 2018-09-05 14:36:53 +02:00
yurex.c USB: yurex: Check for truncation in yurex_read() 2018-09-05 13:27:06 +02:00