From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: perex@perex.cz, tiwai@suse.com, rfontana@redhat.com,
gregkh@linuxfoundation.org, allison@lohutok.net,
tglx@linutronix.de, alsa-devel@alsa-project.org,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] ALSA: seq: a possible sleep-in-atomic-context bug in snd_virmidi_dev_receive_event()
Date: Tue, 17 Dec 2019 21:39:01 +0800 [thread overview]
Message-ID: <1583e474-55e3-ec13-f8c9-029bb23971bb@gmail.com> (raw)
In-Reply-To: <s5hh81z9iob.wl-tiwai@suse.de>
On 2019/12/17 21:37, Takashi Iwai wrote:
> On Tue, 17 Dec 2019 14:24:21 +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/core/seq/seq_memory.c, 96:
>> copy_from_user in snd_seq_dump_var_event
>> sound/core/seq/seq_virmidi.c, 97:
>> snd_seq_dump_var_event in snd_virmidi_dev_receive_event
>> sound/core/seq/seq_virmidi.c, 88:
>> _raw_read_lock in snd_virmidi_dev_receive_event
> This can't happen. snd_virmidi_dev_receive_event() takes
> conditionally either read_lock or rw_sem depending on the atomic
> argument. And the data including user-space pointer is handled always
> with atomic=1, hence down_read() is used instead of read_lock() here.
>
Okay, thanks for the explanation.
Best wishes,
Jia-Ju Bai
prev parent reply other threads:[~2019-12-17 13:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-17 13:24 Jia-Ju Bai
2019-12-17 13:30 ` Greg KH
2019-12-17 13:37 ` Takashi Iwai
2019-12-17 13:39 ` Jia-Ju Bai [this message]
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=1583e474-55e3-ec13-f8c9-029bb23971bb@gmail.com \
--to=baijiaju1990@gmail.com \
--cc=allison@lohutok.net \
--cc=alsa-devel@alsa-project.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=rfontana@redhat.com \
--cc=tglx@linutronix.de \
--cc=tiwai@suse.com \
--cc=tiwai@suse.de \
/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®