]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt()
authorJia-Ju Bai <baijiaju1990@gmail.com>
Sat, 1 Sep 2018 08:12:10 +0000 (16:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Sep 2018 12:48:40 +0000 (14:48 +0200)
commit6e22e3af7bb3a7b9dc53cb4687659f6e63fca427
treefc60e292ccb57a85d6dc205b2f55c80abbfe7d38
parentbc8acc214d3f1cafebcbcd101a695bbac716595d
usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt()

wdm_in_callback() is a completion handler function for the USB driver.
So it should not sleep. But it calls service_outstanding_interrupt(),
which calls usb_submit_urb() with GFP_KERNEL.

To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC.

This bug is 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>
drivers/usb/class/cdc-wdm.c