]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ALSA: core: Add async signal helpers
authorTakashi Iwai <tiwai@suse.de>
Thu, 28 Jul 2022 12:59:42 +0000 (14:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:09:31 +0000 (11:09 +0200)
commit6cc1e76104fdc3768dbdd790a4d84303c585f86f
treecec8b8c55043d0ff7a8c866988b8fd62b8f42765
parent9d1afa0169a84dcd5b79901d792edeb8403684ab
ALSA: core: Add async signal helpers

[ Upstream commit ef34a0ae7a2654bc9e58675e36898217fb2799d8 ]

Currently the call of kill_fasync() from an interrupt handler might
lead to potential spin deadlocks, as spotted by syzkaller.
Unfortunately, it's not so trivial to fix this lock chain as it's
involved with the tasklist_lock that is touched in allover places.

As a temporary workaround, this patch provides the way to defer the
async signal notification in a work.  The new helper functions,
snd_fasync_helper() and snd_kill_faync() are replacements for
fasync_helper() and kill_fasync(), respectively.  In addition,
snd_fasync_free() needs to be called at the destructor of the relevant
file object.

Link: https://lore.kernel.org/r/20220728125945.29533-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/sound/core.h
sound/core/misc.c