Daehwan Jung
aaaba1c86d
usb: gadget: rndis: add spinlock for rndis response list
There's no lock for rndis response list. It could cause list corruption
if there're two different list_add at the same time like below.
It's better to add in rndis_add_response / rndis_free_response
/ rndis_get_next_response to prevent any race condition on response list.
[ 361.894299] [1: irq/191-dwc3:16979] list_add corruption.
next->prev should be prev (ffffff80651764d0),
but was ffffff883dc36f80. (next=ffffff80651764d0).
[ 361.904380] [1: irq/191-dwc3:16979] Call trace:
[ 361.904391] [1: irq/191-dwc3:16979] __list_add_valid+0x74/0x90
[ 361.904401] [1: irq/191-dwc3:16979] rndis_msg_parser+0x168/0x8c0
[ 361.904409] [1: irq/191-dwc3:16979] rndis_command_complete+0x24/0x84
[ 361.904417] [1: irq/191-dwc3:16979] usb_gadget_giveback_request+0x20/0xe4
[ 361.904426] [1: irq/191-dwc3:16979] dwc3_gadget_giveback+0x44/0x60
[ 361.904434] [1: irq/191-dwc3:16979] dwc3_ep0_complete_data+0x1e8/0x3a0
[ 361.904442] [1: irq/191-dwc3:16979] dwc3_ep0_interrupt+0x29c/0x3dc
[ 361.904450] [1: irq/191-dwc3:16979] dwc3_process_event_entry+0x78/0x6cc
[ 361.904457] [1: irq/191-dwc3:16979] dwc3_process_event_buf+0xa0/0x1ec
[ 361.904465] [1: irq/191-dwc3:16979] dwc3_thread_interrupt+0x34/0x5c
Fixes: f6281af9d6 ("usb: gadget: rndis: use list_for_each_entry_safe")
Cc: stable <stable@kernel.org>
Signed-off-by: Daehwan Jung <dh10.jung@samsung.com>
Link: https://lore.kernel.org/r/1645507768-77687-1-git-send-email-dh10.jung@samsung.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-24 11:16:57 +01:00
..
2022-02-08 12:15:04 +01:00
2022-02-11 11:55:26 -08:00
2022-01-03 13:44:38 +01:00
2022-02-08 17:06:14 +09:00
2022-01-13 12:50:48 +00:00
2022-02-07 21:02:31 +01:00
2022-02-11 05:51:23 -07:00
2022-01-18 10:05:48 +02:00
2022-02-06 13:19:46 +01:00
2022-01-22 08:33:35 +02:00
2022-02-04 19:22:32 +01:00
2022-01-21 09:16:11 +02:00
2022-02-07 17:42:44 +01:00
2022-01-26 18:57:09 -08:00
2022-01-26 19:40:33 +01:00
2022-01-06 18:31:33 +01:00
2022-01-05 18:31:17 +01:00
2022-01-31 11:22:53 +11:00
2022-01-04 17:29:31 -08:00
2022-01-15 20:37:06 +02:00
2022-01-18 14:03:34 +02:00
2022-02-01 13:18:09 +05:30
2022-01-30 01:06:35 +01:00
2021-12-24 15:27:52 +09:00
2022-01-23 10:31:27 +01:00
2022-02-09 11:41:29 +01:00
2022-02-12 10:16:32 -08:00
2022-01-21 15:10:02 +01:00
2022-01-23 22:31:23 +00:00
2022-01-24 14:32:47 -08:00
2022-01-18 10:05:48 +02:00
2022-01-13 02:05:50 +01:00
2022-02-11 12:13:22 +01:00
2022-02-01 10:12:26 -04:00
2022-02-01 16:52:54 +01:00
2022-02-04 12:57:26 +01:00
2022-02-02 10:49:29 +00:00
2021-12-30 12:12:12 -08:00
2022-01-12 16:59:22 -08:00
2022-01-22 08:33:35 +02:00
2022-01-13 11:19:07 -08:00
2022-02-02 10:14:07 -08:00
2022-01-23 06:20:44 +02:00
2022-01-11 11:35:28 -08:00
2022-01-10 10:33:52 -05:00
2022-01-12 11:11:34 -08:00
2022-02-04 16:27:44 +01:00
2022-01-31 15:36:34 +01:00
2022-01-14 15:08:36 +01:00
2022-02-12 09:56:18 -08:00
2022-01-12 14:17:45 +00:00
2022-01-17 08:14:18 +02:00
2022-01-22 08:33:37 +02:00
2022-01-18 10:05:48 +02:00
2022-02-09 14:50:42 +01:00
2022-01-22 09:52:17 +02:00
2022-01-22 11:28:23 +02:00
2022-02-11 12:55:17 -08:00
2022-01-16 08:08:11 +02:00
2022-01-13 09:05:29 -08:00
2022-02-02 10:33:04 +05:30
2022-01-31 12:07:31 +01:00
2022-02-01 15:37:00 +01:00
2022-01-22 08:33:37 +02:00
2022-01-11 11:26:57 -08:00
2021-12-27 16:51:12 +01:00
2022-01-06 12:18:08 +00:00
2022-01-20 13:25:01 +02:00
2022-01-19 16:47:39 +00:00
2022-01-17 16:44:26 -06:00
2022-01-10 08:32:37 -08:00
2022-01-27 11:23:26 +02:00
2022-01-16 23:50:34 +01:00
2022-02-09 22:55:01 +01:00
2022-02-07 23:45:02 -05:00
2022-02-08 09:52:59 +01:00
2022-01-14 16:02:28 +01:00
2022-02-01 12:39:37 -08:00
2022-01-25 16:36:49 +01:00
2022-01-24 23:30:24 -05:00
2022-02-08 09:48:44 +01:00
2022-01-17 19:48:07 +01:00
2021-12-28 10:43:56 +03:00
2022-02-04 15:36:02 +01:00
2021-12-29 10:54:50 +01:00
2022-02-24 11:16:57 +01:00
2022-01-18 10:05:48 +02:00
2022-01-20 13:31:46 +02:00
2022-01-14 18:50:54 -05:00
2022-02-11 12:06:15 +10:00
2022-01-23 06:20:44 +02:00
2022-01-14 18:50:53 -05:00
2022-01-17 08:07:57 +02:00
2022-02-10 11:10:23 +01:00
2022-01-22 08:33:37 +02:00