* patch "xhci: Fix use-after-free in xhci_free_virt_device" causes kernel crashes on 4.16.8 on unplug
@ 2018-05-11 23:15 Jacob Saunders
2018-05-12 4:32 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Jacob Saunders @ 2018-05-11 23:15 UTC (permalink / raw)
To: stable
On Linux kernel 4.16.8 (using Arch Linux) if I eject a USB 3.0 device
from my system (unplug or "udisksctl power-off --block-device /dev/sde),
it freezes instantly with a null pointer error in XHCI. I've been unable
to successfully capture a kernel log of the error (and my cameras did
not return usable results) and the screen begins scrolling
near-immediately with hung processors in a VT. I have done a git
bisection (between 4.16.7 and 4.16.7) narrowing it down to the following
commit:
commit f5331826b0b7a5f2db56a9020ddbb8ce16acdfc0
Author: Mathias Nyman <mathias.nyman@linux.intel.com>
Date: Thu May 3 17:30:07 2018 +0300
xhci: Fix use-after-free in xhci_free_virt_device
commit 44a182b9d17765514fa2b1cc911e4e65134eef93 upstream.
KASAN found a use-after-free in xhci_free_virt_device+0x33b/0x38e
where xhci_free_virt_device() sets slot id to 0 if udev exists:
if (dev->udev && dev->udev->slot_id)
dev->udev->slot_id = 0;
dev->udev will be true even if udev is freed because dev->udev is
not set to NULL.
set dev->udev pointer to NULL in xhci_free_dev()
The original patch went to stable so this fix needs to be applied
there as well.
Fixes: a400efe455f7 ("xhci: zero usb device slot_id member when
disabling and freeing a xhci slot")
Cc: <stable@vger.kernel.org>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
:040000 040000 356ecdc13bf252535bd51b8558a8173dae546f19
d28f201228652e87e51ba48f5a0ad4539cca5c29 M drivers
Can I be CC'd on future responses to this? I am not subscribed to the list.
Jacob Saunders
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: patch "xhci: Fix use-after-free in xhci_free_virt_device" causes kernel crashes on 4.16.8 on unplug
2018-05-11 23:15 patch "xhci: Fix use-after-free in xhci_free_virt_device" causes kernel crashes on 4.16.8 on unplug Jacob Saunders
@ 2018-05-12 4:32 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2018-05-12 4:32 UTC (permalink / raw)
To: Jacob Saunders; +Cc: stable
On Fri, May 11, 2018 at 07:15:08PM -0400, Jacob Saunders wrote:
> On Linux kernel 4.16.8 (using Arch Linux) if I eject a USB 3.0 device from
> my system (unplug or "udisksctl power-off --block-device /dev/sde), it
> freezes instantly with a null pointer error in XHCI. I've been unable to
> successfully capture a kernel log of the error (and my cameras did not
> return usable results) and the screen begins scrolling near-immediately with
> hung processors in a VT.� I have done a git bisection (between 4.16.7 and
> 4.16.7) narrowing it down to the following commit:
As discussed on the linux-usb mailing list, there's a fix for this
coming.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-05-12 4:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-11 23:15 patch "xhci: Fix use-after-free in xhci_free_virt_device" causes kernel crashes on 4.16.8 on unplug Jacob Saunders
2018-05-12 4:32 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.