Zhengjun Xing
fa2dfd0ec2
xhci: Fix NULL pointer in xhci debugfs
Commit dde634057d ("xhci: Fix use-after-free in xhci debugfs") causes a
null pointer dereference while fixing xhci-debugfs usage of ring pointers
that were freed during hibernate.
The fix passed addresses to ring pointers instead, but forgot to do this
change for the xhci_ring_trb_show function.
The address of the ring pointer passed to xhci-debugfs was of a temporary
ring pointer "new_ring" instead of the actual ring "ring" pointer. The
temporary new_ring pointer will be set to NULL later causing the NULL
pointer dereference.
This issue was seen when reading xhci related files in debugfs:
cat /sys/kernel/debug/usb/xhci/*/devices/*/ep*/trbs
[ 184.604861] BUG: unable to handle kernel NULL pointer dereference at (null)
[ 184.613776] IP: xhci_ring_trb_show+0x3a/0x890
[ 184.618733] PGD 264193067 P4D 264193067 PUD 263238067 PMD 0
[ 184.625184] Oops: 0000 [#1] SMP
[ 184.726410] RIP: 0010:xhci_ring_trb_show+0x3a/0x890
[ 184.731944] RSP: 0018:ffffba8243c0fd90 EFLAGS: 00010246
[ 184.737880] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00000000000295d6
[ 184.746020] RDX: 00000000000295d5 RSI: 0000000000000001 RDI: ffff971a6418d400
[ 184.754121] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
[ 184.762222] R10: ffff971a64c98a80 R11: ffff971a62a00e40 R12: ffff971a62a85500
[ 184.770325] R13: 0000000000020000 R14: ffff971a6418d400 R15: ffff971a6418d400
[ 184.778448] FS: 00007fe725a79700(0000) GS:ffff971a6ec00000(0000) knlGS:0000000000000000
[ 184.787644] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 184.794168] CR2: 0000000000000000 CR3: 000000025f365005 CR4: 00000000003606f0
[ 184.802318] Call Trace:
[ 184.805094] ? seq_read+0x281/0x3b0
[ 184.809068] seq_read+0xeb/0x3b0
[ 184.812735] full_proxy_read+0x4d/0x70
[ 184.817007] __vfs_read+0x23/0x120
[ 184.820870] vfs_read+0x91/0x130
[ 184.824538] SyS_read+0x42/0x90
[ 184.828106] entry_SYSCALL_64_fastpath+0x1a/0x7d
Fixes: dde634057d ("xhci: Fix use-after-free in xhci debugfs")
Cc: <stable@vger.kernel.org> # v4.15
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-02-15 18:36:19 +01:00
..
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-06 09:59:40 -08:00
2018-02-08 15:05:16 -05:00
2018-02-09 09:40:33 -08:00
2018-01-19 22:59:33 -05:00
2018-02-08 11:38:59 -08:00
2018-02-11 14:34:03 -08:00
2018-02-01 16:35:31 -08:00
2018-02-11 14:34:03 -08:00
2018-02-07 11:22:44 -08:00
2018-02-08 10:21:39 +01:00
2018-02-02 10:01:04 -08:00
2018-02-10 13:16:35 -08:00
2018-02-03 00:26:10 -07:00
2018-02-02 09:50:51 -08:00
2018-02-11 14:34:03 -08:00
2018-01-23 09:04:10 +01:00
2018-02-11 14:34:03 -08:00
2018-02-08 10:44:25 -08:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-01-27 09:34:22 -08:00
2018-02-01 10:31:17 -08:00
2018-02-04 10:57:43 -08:00
2018-02-06 09:59:40 -08:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-08 12:03:54 -08:00
2018-02-06 09:59:40 -08:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-01 16:35:31 -08:00
2018-01-17 01:19:38 -05:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-09 19:32:41 -08:00
2018-01-31 11:32:27 -08:00
2018-02-01 10:31:17 -08:00
2018-02-11 14:34:03 -08:00
2018-01-28 22:17:24 -05:00
2018-01-16 16:47:29 +01:00
2018-02-03 00:26:26 -07:00
2018-02-04 11:16:35 -08:00
2018-02-06 09:59:40 -08:00
2018-02-11 14:34:03 -08:00
2018-02-08 11:48:49 -08:00
2018-02-06 18:32:44 -08:00
2018-02-01 09:40:49 -08:00
2018-02-02 14:22:53 -08:00
2018-02-11 14:34:03 -08:00
2018-01-31 12:55:31 -08:00
2018-01-17 12:56:24 +01:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-01-23 12:17:42 -06:00
2018-01-30 12:25:59 +00:00
2018-02-05 10:07:40 -08:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-06 09:59:40 -08:00
2018-02-11 14:34:03 -08:00
2018-02-08 10:21:39 +01:00
2018-02-01 16:35:31 -08:00
2018-01-22 16:45:26 +01:00
2018-01-26 17:57:34 +00:00
2018-02-01 10:37:39 +02:00
2018-02-11 14:34:03 -08:00
2018-02-09 14:49:46 -08:00
2018-01-11 18:05:06 -08:00
2018-02-06 15:04:58 -08:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-15 18:36:19 +01:00
2018-02-11 14:34:03 -08:00
2018-02-11 14:34:03 -08:00
2018-02-09 19:32:41 -08:00
2018-02-11 14:34:03 -08:00
2018-02-01 16:26:45 +02:00
2018-01-31 19:25:25 -08:00
2018-02-07 11:54:34 -08:00
2018-02-11 14:34:03 -08:00
2018-02-01 10:31:17 -08:00
2018-02-06 09:59:40 -08:00