diff options
author | Takashi Iwai <[email protected]> | 2023-07-03 13:24:30 +0200 |
---|---|---|
committer | Takashi Iwai <[email protected]> | 2023-07-03 14:52:27 +0200 |
commit | bd55842ed998a622ba6611fe59b3358c9f76773d (patch) | |
tree | 10854a48c3a5c0a0eec4320a4cdec33d8f98a7ef /tools/perf/util/trace-event-scripting.c | |
parent | 1f4a08fed450db87fbb5ff5105354158bdbe1a22 (diff) |
ALSA: pcm: Fix potential data race at PCM memory allocation helpers
The PCM memory allocation helpers have a sanity check against too many
buffer allocations. However, the check is performed without a proper
lock and the allocation isn't serialized; this allows user to allocate
more memories than predefined max size.
Practically seen, this isn't really a big problem, as it's more or
less some "soft limit" as a sanity check, and it's not possible to
allocate unlimitedly. But it's still better to address this for more
consistent behavior.
The patch covers the size check in do_alloc_pages() with the
card->memory_mutex, and increases the allocated size there for
preventing the further overflow. When the actual allocation fails,
the size is decreased accordingly.
Reported-by: BassCheck <[email protected]>
Reported-by: Tuo Li <[email protected]>
Link: https://lore.kernel.org/r/CADm8Tek6t0WedK+3Y6rbE5YEt19tML8BUL45N2ji4ZAz1KcN_A@mail.gmail.com
Reviewed-by: Jaroslav Kysela <[email protected]>
Cc: <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions