All of lore.kernel.org
 help / color / mirror / Atom feed
* Kernel null dereference race condition fix.
@ 2020-11-12 11:00 John Boero
  2020-11-12 16:12 ` Alan Stern
  0 siblings, 1 reply; 2+ messages in thread
From: John Boero @ 2020-11-12 11:00 UTC (permalink / raw)
  To: linux-usb

Hi for months Linux users have been reporting random USB crashes with
certain webcams.  It happens randomly and mostly with Logitech webcams
(which claim no Linux support).  I'm pretty sure I've tracked it down
to a simple pointer check before dereference but it completely crashes
USB subsystems until reboot and is really frustrating.

PR and explanation can be found here.  Please have a look.  It won't
fix any race condition but at least it won't Oops the kernel.
https://github.com/torvalds/linux/commit/a40519014549f60969c8e67a2fd91426db05fe04

Thank you!
John Boero

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Kernel null dereference race condition fix.
  2020-11-12 11:00 Kernel null dereference race condition fix John Boero
@ 2020-11-12 16:12 ` Alan Stern
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Stern @ 2020-11-12 16:12 UTC (permalink / raw)
  To: John Boero; +Cc: linux-usb

On Thu, Nov 12, 2020 at 11:00:16AM +0000, John Boero wrote:
> Hi for months Linux users have been reporting random USB crashes with
> certain webcams.  It happens randomly and mostly with Logitech webcams
> (which claim no Linux support).  I'm pretty sure I've tracked it down
> to a simple pointer check before dereference but it completely crashes
> USB subsystems until reboot and is really frustrating.
> 
> PR and explanation can be found here.  Please have a look.  It won't
> fix any race condition but at least it won't Oops the kernel.
> https://github.com/torvalds/linux/commit/a40519014549f60969c8e67a2fd91426db05fe04

Are you saying that some webcam driver is calling usb_ifnum_to_if() with 
dev set to NULL?  If it is, that's a bug in the webcam driver.  It needs 
to be fixed by patching the driver, not by patching usbcore.

Can you test this by replacing your patch with the following code in 
usb_ifnum_to_if()?

	if (!dev) {
		WARN(1, "dev is NULL in usb_ifnum_to_if");
		return;
	}

Alan Stern

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-12 16:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12 11:00 Kernel null dereference race condition fix John Boero
2020-11-12 16:12 ` Alan Stern

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.