Jia-Ju Bai
cb1083af77
usb: gadget: udc: fotg210-udc: Fix a sleep-in-atomic-context bug in fotg210_get_status()
...
[ Upstream commit 2337a77c1c ]
The driver may sleep in an interrupt handler.
The function call path (from bottom to top) in Linux-4.17 is:
[FUNC] fotg210_ep_queue(GFP_KERNEL)
drivers/usb/gadget/udc/fotg210-udc.c, 744:
fotg210_ep_queue in fotg210_get_status
drivers/usb/gadget/udc/fotg210-udc.c, 768:
fotg210_get_status in fotg210_setup_packet
drivers/usb/gadget/udc/fotg210-udc.c, 949:
fotg210_setup_packet in fotg210_irq (interrupt handler)
To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC.
If possible, spin_unlock() and spin_lock() around fotg210_ep_queue()
can be also removed.
This bug is found by my static analysis tool DSAC.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com >
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2019-11-25 09:53:23 +01:00
..
2019-11-25 09:52:26 +01:00
2019-10-07 18:53:19 +02:00
2019-11-25 09:53:22 +01:00
2019-09-21 07:14:13 +02:00
2019-11-25 09:52:23 +01:00
2019-10-29 09:15:09 +01:00
2019-11-16 10:29:34 +01:00
2018-12-05 19:42:41 +01:00
2019-04-05 22:29:12 +02:00
2019-10-07 18:53:10 +02:00
2019-10-07 18:53:14 +02:00
2019-08-04 09:33:22 +02:00
2019-10-29 09:15:25 +01:00
2019-02-12 19:44:55 +01:00
2019-11-25 09:53:01 +01:00
2019-10-05 12:30:29 +02:00
2019-11-25 09:52:11 +01:00
2019-10-05 12:30:20 +02:00
2019-05-31 06:48:26 -07:00
2019-11-06 12:18:09 +01:00
2019-11-06 12:18:07 +01:00
2019-11-12 19:16:24 +01:00
2019-11-12 19:15:55 +01:00
2018-12-29 13:40:15 +01:00
2019-10-05 12:30:26 +02:00
2019-11-25 09:52:53 +01:00
2019-10-05 12:30:36 +02:00
2018-12-21 14:11:37 +01:00
2019-05-14 19:19:34 +02:00
2019-11-25 09:51:59 +01:00
2019-11-25 09:53:09 +01:00
2019-11-25 09:51:56 +01:00
2019-10-05 12:30:25 +02:00
2019-10-05 12:30:10 +02:00
2019-10-05 12:30:14 +02:00
2019-10-05 12:30:17 +02:00
2018-10-20 09:51:32 +02:00
2019-08-04 09:33:41 +02:00
2019-11-06 12:18:01 +01:00
2019-11-25 09:52:48 +01:00
2019-05-25 18:26:49 +02:00
2019-10-29 09:15:25 +01:00
2019-10-07 18:53:16 +02:00
2019-11-25 09:52:54 +01:00
2019-11-25 09:51:58 +01:00
2019-10-05 12:30:07 +02:00
2019-11-25 09:53:22 +01:00
2019-11-12 19:15:40 +01:00
2019-08-04 09:33:29 +02:00
2019-10-05 12:30:25 +02:00
2019-11-25 09:52:16 +01:00
2019-11-25 09:52:08 +01:00
2019-10-05 12:30:31 +02:00
2019-07-10 09:55:29 +02:00
2019-11-12 19:15:54 +01:00
2018-11-13 11:16:46 -08:00
2019-08-06 18:29:41 +02:00
2019-11-25 09:52:50 +01:00
2019-11-25 09:52:20 +01:00
2019-06-22 08:17:16 +02:00
2019-11-25 09:52:32 +01:00
2019-05-14 19:19:34 +02:00
2019-08-04 09:33:45 +02:00
2019-02-12 19:44:52 +01:00
2019-06-22 08:17:17 +02:00
2019-08-06 18:29:38 +02:00
2019-11-10 11:23:09 +01:00
2018-12-08 13:05:08 +01:00
2018-11-13 11:17:03 -08:00
2019-11-06 12:18:04 +01:00
2019-11-25 09:52:25 +01:00
2018-12-21 14:11:36 +01:00
2019-11-25 09:53:05 +01:00
2019-06-22 08:17:15 +02:00
2019-11-25 09:52:43 +01:00
2019-05-31 06:48:12 -07:00
2019-11-06 12:18:06 +01:00
2019-11-10 11:23:18 +01:00
2018-11-13 11:17:02 -08:00
2019-10-17 13:42:12 -07:00
2019-11-06 12:18:14 +01:00
2019-11-25 09:52:27 +01:00
2018-11-27 16:09:41 +01:00
2019-11-25 09:53:23 +01:00
2018-10-03 17:01:42 -07:00
2019-11-25 09:52:55 +01:00
2019-09-16 08:19:34 +02:00
2019-11-25 09:53:14 +01:00
2019-05-16 19:43:47 +02:00
2019-04-17 08:36:47 +02:00
2019-05-31 06:48:15 -07:00
2019-10-17 13:42:07 -07:00
2019-10-17 13:42:10 -07:00