mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: arnaud.pouliquen@st.com, lgirdwood@gmail.com, broonie@kernel.org,
	perex@perex.cz, tiwai@suse.com
Cc: alsa-devel@alsa-project.org, LKML <linux-kernel@vger.kernel.org>
Subject: [BUG] ALSA: soc: sti: a possible sleep-in-atomic-context bug in uni_player_ctl_iec958_put()
Date: Wed, 18 Dec 2019 20:51:42 +0800	[thread overview]
Message-ID: <739176c9-d889-0093-129c-25ff9c57b63b@gmail.com> (raw)

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

sound/soc/sti/uniperif_player.c, 229:
     mutex_lock in uni_player_set_channel_status
sound/soc/sti/uniperif_player.c, 608:
     uni_player_set_channel_status in uni_player_ctl_iec958_put
sound/soc/sti/uniperif_player.c, 603:
     _raw_spin_lock_irqsave in uni_player_ctl_iec958_put

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:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18 12:51 Jia-Ju Bai [this message]
2019-12-18 13:24 ` Arnaud POULIQUEN

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=739176c9-d889-0093-129c-25ff9c57b63b@gmail.com \
    --to=baijiaju1990@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnaud.pouliquen@st.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --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

all inboxes | Powered by JetHome®