linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: perex@perex.cz, tiwai@suse.com, allison@lohutok.net,
	rfontana@redhat.com, tglx@linutronix.de
Cc: alsa-devel@alsa-project.org, LKML <linux-kernel@vger.kernel.org>
Subject: [BUG] ALSA: ice1712: a possible sleep-in-atomic-context bug in snd_vt1724_set_pro_rate()
Date: Wed, 18 Dec 2019 20:25:42 +0800	[thread overview]
Message-ID: <5d43135e-73b9-a46a-2155-9e91d0dcdf83@gmail.com> (raw)

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

             reply	other threads:[~2019-12-18 12:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18 12:25 Jia-Ju Bai [this message]
2019-12-18 19:24 ` [BUG] ALSA: ice1712: a possible sleep-in-atomic-context bug in snd_vt1724_set_pro_rate() Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d43135e-73b9-a46a-2155-9e91d0dcdf83@gmail.com \
    --to=baijiaju1990@gmail.com \
    --cc=allison@lohutok.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=rfontana@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).