All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] kaweth: a possible sleep-in-atomic bug in kaweth_start_xmit
@ 2017-12-13  8:57 Jia-Ju Bai
  2017-12-13  9:21 ` Oliver Neukum
  0 siblings, 1 reply; 2+ messages in thread
From: Jia-Ju Bai @ 2017-12-13  8:57 UTC (permalink / raw)
  To: David Miller, tklauser, johannes.berg, arvind.yadav.cs, edumazet
  Cc: linux-usb, netdev, Linux Kernel Mailing List

According to drivers/net/usb/kaweth.c, the driver may sleep under a 
spinlock.
The function call path is:
kaweth_start_xmit (acquire the spinlock)
   kaweth_async_set_rx_mode
     kaweth_control
       kaweth_internal_control_msg
         usb_start_wait_urb
           wait_event_timeout --> may sleep
           usb_kill_urb --> may sleep

I do not find a good way to fix it, so I only report.
This possible bug is found by my static analysis tool (DSAC) and checked 
by my code review.


Thanks,
Jia-Ju Bai

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

* Re: [BUG] kaweth: a possible sleep-in-atomic bug in kaweth_start_xmit
  2017-12-13  8:57 [BUG] kaweth: a possible sleep-in-atomic bug in kaweth_start_xmit Jia-Ju Bai
@ 2017-12-13  9:21 ` Oliver Neukum
  0 siblings, 0 replies; 2+ messages in thread
From: Oliver Neukum @ 2017-12-13  9:21 UTC (permalink / raw)
  To: Jia-Ju Bai, David Miller, tklauser, arvind.yadav.cs, edumazet,
	johannes.berg
  Cc: Linux Kernel Mailing List, linux-usb, netdev

Am Mittwoch, den 13.12.2017, 16:57 +0800 schrieb Jia-Ju Bai:
> According to drivers/net/usb/kaweth.c, the driver may sleep under a 
> spinlock.
> The function call path is:
> kaweth_start_xmit (acquire the spinlock)
>    kaweth_async_set_rx_mode
>      kaweth_control
>        kaweth_internal_control_msg
>          usb_start_wait_urb
>            wait_event_timeout --> may sleep
>            usb_kill_urb --> may sleep
> 
> I do not find a good way to fix it, so I only report.
> This possible bug is found by my static analysis tool (DSAC) and checked 
> by my code review.
> 

Hi,

thanks for reporting. I need to get out my old test device.
It will take a few days. The obvious fix would be to set this
filter only on initialization. Unfortunately this needs to
be tested.

	Regards
		Oliver

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

end of thread, other threads:[~2017-12-13  9:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-13  8:57 [BUG] kaweth: a possible sleep-in-atomic bug in kaweth_start_xmit Jia-Ju Bai
2017-12-13  9:21 ` Oliver Neukum

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.