summaryrefslogtreecommitdiffstats
path: root/sound/ppc/beep.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2023-07-03 13:24:30 +0200
committerTakashi Iwai <tiwai@suse.de>2023-07-03 14:52:27 +0200
commitbd55842ed998a622ba6611fe59b3358c9f76773d (patch)
tree10854a48c3a5c0a0eec4320a4cdec33d8f98a7ef /sound/ppc/beep.c
parent1f4a08fed450db87fbb5ff5105354158bdbe1a22 (diff)
downloadlinux-stable-bd55842ed998a622ba6611fe59b3358c9f76773d.tar.gz
linux-stable-bd55842ed998a622ba6611fe59b3358c9f76773d.tar.bz2
linux-stable-bd55842ed998a622ba6611fe59b3358c9f76773d.zip
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 <bass@buaa.edu.cn> Reported-by: Tuo Li <islituo@gmail.com> Link: https://lore.kernel.org/r/CADm8Tek6t0WedK+3Y6rbE5YEt19tML8BUL45N2ji4ZAz1KcN_A@mail.gmail.com Reviewed-by: Jaroslav Kysela <perex@perex.cz> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20230703112430.30634-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/ppc/beep.c')
0 files changed, 0 insertions, 0 deletions