diff options
author | 2022-03-22 18:07:17 +0100 | |
---|---|---|
committer | 2022-03-22 20:56:07 +0100 | |
commit | 92ee3c60ec9fe64404dc035e7c41277d74aa26cb (patch) | |
tree | 495dbd456ef721512b0113483cc62e34879e6d6c /tools/perf/scripts/python/export-to-postgresql.py | |
parent | Merge tag 'asoc-v5.18' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus (diff) | |
download | linux-dev-92ee3c60ec9fe64404dc035e7c41277d74aa26cb.tar.xz linux-dev-92ee3c60ec9fe64404dc035e7c41277d74aa26cb.zip |
ALSA: pcm: Fix races among concurrent hw_params and hw_free calls
Currently we have neither proper check nor protection against the
concurrent calls of PCM hw_params and hw_free ioctls, which may result
in a UAF. Since the existing PCM stream lock can't be used for
protecting the whole ioctl operations, we need a new mutex to protect
those racy calls.
This patch introduced a new mutex, runtime->buffer_mutex, and applies
it to both hw_params and hw_free ioctl code paths. Along with it, the
both functions are slightly modified (the mmap_count check is moved
into the state-check block) for code simplicity.
Reported-by: Hu Jiahui <kirin.say@gmail.com>
Cc: <stable@vger.kernel.org>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20220322170720.3529-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions