Zhengjun Xing
716382f1c1
xhci: Fix kernel oops in trace_xhci_free_virt_device
commit d850c16583 upstream.
commit 44a182b9d1 ("xhci: Fix use-after-free in xhci_free_virt_device")
set dev->udev pointer to NULL in xhci_free_dev(), it will cause kernel
panic in trace_xhci_free_virt_device. This patch reimplement the trace
function trace_xhci_free_virt_device, remove dev->udev dereference and
added more useful parameters to show in the trace function,it also makes
sure dev->udev is not NULL before calling trace_xhci_free_virt_device.
This issue happened when xhci-hcd trace is enabled and USB devices hot
plug test. Original use-after-free patch went to stable so this needs so
be applied there as well.
[ 1092.022457] usb 2-4: USB disconnect, device number 6
[ 1092.092772] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
[ 1092.101694] PGD 0 P4D 0
[ 1092.104601] Oops: 0000 [#1] SMP
[ 1092.207734] Workqueue: usb_hub_wq hub_event
[ 1092.212507] RIP: 0010:trace_event_raw_event_xhci_log_virt_dev+0x6c/0xf0
[ 1092.220050] RSP: 0018:ffff8c252e883d28 EFLAGS: 00010086
[ 1092.226024] RAX: ffff8c24af86fa84 RBX: 0000000000000003 RCX: ffff8c25255c2a01
[ 1092.234130] RDX: 0000000000000000 RSI: 00000000aef55009 RDI: ffff8c252e883d28
[ 1092.242242] RBP: ffff8c252550e2c0 R08: ffff8c24af86fa84 R09: 0000000000000a70
[ 1092.250364] R10: 0000000000000a70 R11: 0000000000000000 R12: ffff8c251f21a000
[ 1092.258468] R13: 000000000000000c R14: ffff8c251f21a000 R15: ffff8c251f432f60
[ 1092.266572] FS: 0000000000000000(0000) GS:ffff8c252e880000(0000) knlGS:0000000000000000
[ 1092.275757] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1092.282281] CR2: 0000000000000000 CR3: 0000000154209001 CR4: 00000000003606e0
[ 1092.290384] Call Trace:
[ 1092.293156] <IRQ>
[ 1092.295439] xhci_free_virt_device.part.34+0x182/0x1a0
[ 1092.301288] handle_cmd_completion+0x7ac/0xfa0
[ 1092.306336] ? trace_event_raw_event_xhci_log_trb+0x6e/0xa0
[ 1092.312661] xhci_irq+0x3e8/0x1f60
[ 1092.316524] __handle_irq_event_percpu+0x75/0x180
[ 1092.321876] handle_irq_event_percpu+0x20/0x50
[ 1092.326922] handle_irq_event+0x36/0x60
[ 1092.331273] handle_edge_irq+0x6d/0x180
[ 1092.335644] handle_irq+0x16/0x20
[ 1092.339417] do_IRQ+0x41/0xc0
[ 1092.342782] common_interrupt+0xf/0xf
[ 1092.346955] </IRQ>
Fixes: 44a182b9d1 ("xhci: Fix use-after-free in xhci_free_virt_device")
Cc: <stable@vger.kernel.org>
Signed-off-by: Zhengjun Xing <zhengjun.xing@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-08 15:30:47 +02:00
..
2017-07-30 07:26:52 -07:00
2016-09-27 12:20:17 +02:00
2016-03-03 20:37:41 -08:00
2017-12-10 13:40:44 +01:00
2017-06-13 10:48:24 +02:00
2017-08-31 18:08:46 +02:00
2015-07-22 16:44:35 -07:00
2015-01-09 12:31:53 -08:00
2017-03-16 18:03:31 +09:00
2018-02-28 10:19:42 +01:00
2017-03-23 08:20:21 +01:00
2016-06-07 22:15:25 -07:00
2014-11-07 09:01:50 -08:00
2014-11-07 09:01:50 -08:00
2017-08-10 11:36:50 -07:00
2017-03-17 13:32:59 +09:00
2016-10-24 14:36:25 +02:00
2017-05-17 11:52:44 +02:00
2015-01-09 12:31:53 -08:00
2015-01-09 12:31:53 -08:00
2016-11-03 10:38:24 +02:00
2017-05-17 12:20:53 +02:00
2015-01-09 12:31:53 -08:00
2016-04-28 12:35:36 -07:00
2016-06-30 07:44:21 +01:00
2015-08-18 10:05:23 -07:00
2016-06-07 22:15:25 -07:00
2015-01-09 12:31:53 -08:00
2017-06-03 18:08:04 +09:00
2016-11-29 17:36:43 +01:00
2015-01-09 12:31:53 -08:00
2016-12-05 15:13:58 +01:00
2016-08-30 19:17:37 +02:00
2015-12-22 17:12:56 -06:00
2016-05-09 13:08:46 +02:00
2015-12-04 08:25:58 -08:00
2015-12-22 17:12:56 -06:00
2017-06-03 18:08:04 +09:00
2017-11-02 11:10:55 +01:00
2017-07-22 15:56:53 +02:00
2017-08-10 11:31:26 -07:00
2017-08-31 18:08:46 +02:00
2017-07-30 07:26:52 -07:00
2017-11-02 11:10:55 +01:00
2017-07-30 07:26:51 -07:00
2017-11-02 11:10:55 +01:00
2018-02-22 15:42:31 +01:00
2017-11-02 11:10:55 +01:00
2017-07-30 07:26:51 -07:00
2017-03-09 10:22:08 +01:00
2016-11-29 17:31:36 +01:00
2015-05-10 16:01:11 +02:00
2017-01-10 17:00:42 +01:00
2018-05-25 16:17:38 +02:00
2018-02-28 10:19:41 +01:00
2016-11-21 17:33:40 +01:00
2016-12-08 17:50:09 +01:00
2017-08-15 08:27:22 +01:00
2017-03-23 08:13:21 +01:00
2017-06-03 18:08:04 +09:00
2015-01-09 12:31:53 -08:00
2017-06-29 14:49:06 +02:00
2018-02-28 10:19:42 +01:00
2016-12-05 16:32:51 +01:00
2016-08-30 19:24:59 +02:00
2017-09-01 11:59:17 +02:00
2015-10-04 10:51:58 +01:00
2016-06-30 07:44:20 +01:00
2015-01-09 12:31:53 -08:00
2017-09-01 11:59:17 +02:00
2017-03-23 08:13:21 +01:00
2017-03-16 18:03:31 +09:00
2017-11-02 11:10:55 +01:00
2018-05-30 07:51:56 +02:00
2018-05-30 07:51:56 +02:00
2017-07-30 07:26:51 -07:00
2017-07-30 07:26:51 -07:00
2017-11-02 11:10:55 +01:00
2015-06-08 14:26:22 -07:00
2017-07-30 07:26:52 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-05-25 14:30:13 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-04-08 12:17:42 +02:00
2017-01-25 10:59:06 +01:00
2018-05-30 07:51:56 +02:00
2018-07-08 15:30:47 +02:00
2016-11-03 10:38:22 +02:00
2017-08-31 18:08:46 +02:00
2017-01-19 10:37:16 +01:00
2016-04-26 16:08:02 -07:00
2016-04-26 16:08:02 -07:00
2018-05-30 07:51:56 +02:00
2018-05-25 16:17:38 +02:00
2017-04-19 19:59:17 +02:00
2018-03-19 08:42:45 +01:00
2017-04-19 19:59:17 +02:00
2017-12-20 10:10:19 +01:00
2017-03-09 18:00:39 +01:00
2014-10-03 14:44:45 -07:00
2018-07-08 15:30:47 +02:00
2018-07-03 11:25:05 +02:00
2018-05-30 07:51:56 +02:00