]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: core: Add async signal helpers
authorTakashi Iwai <tiwai@suse.de>
Thu, 28 Jul 2022 12:59:42 +0000 (14:59 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 29 Jul 2022 10:57:10 +0000 (12:57 +0200)
commitaa0aa8b611882b73d9de036b28bbf6ceebb49259
tree3444d3d9264ced511f8378bf656b276fe800cc97
parent84d459cd709b018da2bfa81baf46b5762a9a60eb
ALSA: core: Add async signal helpers

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>
include/sound/core.h
sound/core/misc.c