linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] ALSA: ice1712: a possible sleep-in-atomic-context bug in snd_vt1724_set_pro_rate()
@ 2019-12-18 12:25 Jia-Ju Bai
  2019-12-18 19:24 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Jia-Ju Bai @ 2019-12-18 12:25 UTC (permalink / raw)
  To: perex, tiwai, allison, rfontana, tglx; +Cc: alsa-devel, LKML

The driver may sleep while holding a read lock.
The function call path (from bottom to top) in Linux 4.19 is:

sound/pci/ice1712/quartet.c, 414:
     mutex_lock in reg_write
sound/pci/ice1712/quartet.c, 485:
     reg_write in set_cpld
sound/pci/ice1712/quartet.c, 876:
     set_cpld in qtet_set_rate
sound/pci/ice1712/ice1724.c, 687:
     (FUNC_PTR) qtet_set_rate in snd_vt1724_set_pro_rate
sound/pci/ice1712/ice1724.c, 668:
     _raw_spin_lock_irqsave in snd_vt1724_set_pro_rate

(FUNC_PTR) means a function pointer is called.
mutex_lock() can sleep at runtime.

I am not sure how to properly fix this possible bug, so I only report it.

This bug is found by a static analysis tool STCheck written by myself.


Best wishes,
Jia-Ju Bai

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

* Re: [BUG] ALSA: ice1712: a possible sleep-in-atomic-context bug in snd_vt1724_set_pro_rate()
  2019-12-18 12:25 [BUG] ALSA: ice1712: a possible sleep-in-atomic-context bug in snd_vt1724_set_pro_rate() Jia-Ju Bai
@ 2019-12-18 19:24 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2019-12-18 19:24 UTC (permalink / raw)
  To: Jia-Ju Bai; +Cc: perex, tiwai, allison, rfontana, tglx, alsa-devel, LKML

On Wed, 18 Dec 2019 13:25:42 +0100,
Jia-Ju Bai wrote:
> 
> The driver may sleep while holding a read lock.
> The function call path (from bottom to top) in Linux 4.19 is:
> 
> sound/pci/ice1712/quartet.c, 414:
>     mutex_lock in reg_write
> sound/pci/ice1712/quartet.c, 485:
>     reg_write in set_cpld
> sound/pci/ice1712/quartet.c, 876:
>     set_cpld in qtet_set_rate
> sound/pci/ice1712/ice1724.c, 687:
>     (FUNC_PTR) qtet_set_rate in snd_vt1724_set_pro_rate
> sound/pci/ice1712/ice1724.c, 668:
>     _raw_spin_lock_irqsave in snd_vt1724_set_pro_rate
> 
> (FUNC_PTR) means a function pointer is called.
> mutex_lock() can sleep at runtime.
> 
> I am not sure how to properly fix this possible bug, so I only report it.
> 
> This bug is found by a static analysis tool STCheck written by myself.

Thanks for the report.  I'll submitted the fix.


Takashi

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

end of thread, other threads:[~2019-12-18 19:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 12:25 [BUG] ALSA: ice1712: a possible sleep-in-atomic-context bug in snd_vt1724_set_pro_rate() Jia-Ju Bai
2019-12-18 19:24 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).