d99a36f472
When multiple concurrent writes happen on the ALSA sequencer device right after the open, it may try to allocate vmalloc buffer for each write and leak some of them. It's because the presence check and the assignment of the buffer is done outside the spinlock for the pool. The fix is to move the check and the assignment into the spinlock. (The current implementation is suboptimal, as there can be multiple unnecessary vmallocs because the allocation is done before the check in the spinlock. But the pool size is already checked beforehand, so this isn't a big problem; that is, the only possible path is the multiple writes before any pool assignment, and practically seen, the current coverage should be "good enough".) The issue was triggered by syzkaller fuzzer. BugLink: http://lkml.kernel.org/r/CACT4Y+bSzazpXNvtAr=WXaL8hptqjHwqEyFA+VN2AWEx=aurkg@mail.gmail.com Reported-by: Dmitry Vyukov <dvyukov@google.com> Tested-by: Dmitry Vyukov <dvyukov@google.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> |
||
---|---|---|
.. | ||
oss | ||
Kconfig | ||
Makefile | ||
seq_clientmgr.c | ||
seq_clientmgr.h | ||
seq_compat.c | ||
seq_device.c | ||
seq_dummy.c | ||
seq_fifo.c | ||
seq_fifo.h | ||
seq_info.c | ||
seq_info.h | ||
seq_lock.c | ||
seq_lock.h | ||
seq_memory.c | ||
seq_memory.h | ||
seq_midi_emul.c | ||
seq_midi_event.c | ||
seq_midi.c | ||
seq_ports.c | ||
seq_ports.h | ||
seq_prioq.c | ||
seq_prioq.h | ||
seq_queue.c | ||
seq_queue.h | ||
seq_system.c | ||
seq_system.h | ||
seq_timer.c | ||
seq_timer.h | ||
seq_virmidi.c | ||
seq.c |