diff options
author | Takashi Iwai <tiwai@suse.de> | 2016-02-15 16:20:24 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-02-15 16:26:52 +0100 |
commit | d99a36f4728fcbcc501b78447f625bdcce15b842 (patch) | |
tree | 689289667f313d07b1778575a10ba315dc8a3dbb /firmware | |
parent | 07d86ca93db7e5cdf4743564d98292042ec21af7 (diff) | |
download | linux-d99a36f4728fcbcc501b78447f625bdcce15b842.tar.bz2 |
ALSA: seq: Fix leak of pool buffer at concurrent writes
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>
Diffstat (limited to 'firmware')
0 files changed, 0 insertions, 0 deletions