ALSA: pcm: Fix ioctl races
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | ALSA: pcm: Fix races among concurrent hw_params and hw_free callsinclude/ sound/ sound/ | +42 | 0 replies | |
| 2/4 | ALSA: pcm: Fix races among concurrent read/write and buffer changessound/ | +4 | 0 replies | |
| 3/4 | ALSA: pcm: Fix races among concurrent prepare and hw_params/hw_free callssound/ | +18 | 3 replies | |
| 4/4 | ALSA: pcm: Fix races among concurrent prealloc proc writessound/ | +7 | 0 replies |
Reviews trailers per patch
None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Jaroslav Kysela |
|---|---|
| Series | R-b |
| 1/4 | |
| 2/4 | |
| 3/4 | |
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/4] ALSA: pcm: Fix ioctl races
Hi,
this is a patch set to address the recently reported bug for the racy PCM ioctls. In short, the current ALSA PCM core doesn't take enough care of concurrent ioctl calls, and the concurrent calls may result in a use-after-free. The reported problem was the concurrent hw_free calls, but there can be similar cases with other code paths like hw_params, prepare, etc, too.
The patch set introduces the new runtime->buffer_mutex for protecting those. The first patch is the fix for the reported issue (the races with hw_free), while the rest three are more hardening for the other similar executions.
[ Note that the patch 3 was slightly modified from the version I sent
to distros list, as I noticed possible lockdep (false-positive) warnings. The behavior is almost same, just written differently. ]
thanks,
Takashi
===
Takashi Iwai (4):
ALSA: pcm: Fix races among concurrent hw_params and hw_free calls
ALSA: pcm: Fix races among concurrent read/write and buffer changes
ALSA: pcm: Fix races among concurrent prepare and hw_params/hw_free
calls
ALSA: pcm: Fix races among concurrent prealloc proc writes
include/sound/pcm.h | 1 + sound/core/pcm.c | 2 + sound/core/pcm_lib.c | 4 ++ sound/core/pcm_memory.c | 11 +++-- sound/core/pcm_native.c | 93 +++++++++++++++++++++++++---------------- 5 files changed, 71 insertions(+), 40 deletions(-)
Signature · 1 line
2.31.1