diff options
author | Takashi Iwai <[email protected]> | 2022-03-22 18:07:18 +0100 |
---|---|---|
committer | Takashi Iwai <[email protected]> | 2022-03-22 20:56:27 +0100 |
commit | dca947d4d26dbf925a64a6cfb2ddbc035e831a3d (patch) | |
tree | 40a130d5cec20aa161a3b9a853602fa66af29533 /net/lapb/lapb_subr.c | |
parent | 92ee3c60ec9fe64404dc035e7c41277d74aa26cb (diff) |
ALSA: pcm: Fix races among concurrent read/write and buffer changes
In the current PCM design, the read/write syscalls (as well as the
equivalent ioctls) are allowed before the PCM stream is running, that
is, at PCM PREPARED state. Meanwhile, we also allow to re-issue
hw_params and hw_free ioctl calls at the PREPARED state that may
change or free the buffers, too. The problem is that there is no
protection against those mix-ups.
This patch applies the previously introduced runtime->buffer_mutex to
the read/write operations so that the concurrent hw_params or hw_free
call can no longer interfere during the operation. The mutex is
unlocked before scheduling, so we don't take it too long.
Cc: <[email protected]>
Reviewed-by: Jaroslav Kysela <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Diffstat (limited to 'net/lapb/lapb_subr.c')
0 files changed, 0 insertions, 0 deletions