diff options
author | Takashi Iwai <tiwai@suse.de> | 2016-01-14 16:30:58 +0100 |
---|---|---|
committer | Simon Shields <keepcalm444@gmail.com> | 2016-05-03 22:55:13 +1000 |
commit | 046fdefc1dfbbc9f34b569ae77b3258c4eb588a5 (patch) | |
tree | 1ae4dc03d7220537b06eb844cf1615881649a973 /fs/pipe.c | |
parent | fcc7980348b57d7d18f4ca486ed8d36a9ada3665 (diff) | |
download | kernel_samsung_smdk4412-046fdefc1dfbbc9f34b569ae77b3258c4eb588a5.zip kernel_samsung_smdk4412-046fdefc1dfbbc9f34b569ae77b3258c4eb588a5.tar.gz kernel_samsung_smdk4412-046fdefc1dfbbc9f34b569ae77b3258c4eb588a5.tar.bz2 |
ALSA: timer: Harden slave timer list handling
A slave timer instance might be still accessible in a racy way while
operating the master instance as it lacks of locking. Since the
master operation is mostly protected with timer->lock, we should cope
with it while changing the slave instance, too. Also, some linked
lists (active_list and ack_list) of slave instances aren't unlinked
immediately at stopping or closing, and this may lead to unexpected
accesses.
This patch tries to address these issues. It adds spin lock of
timer->lock (either from master or slave, which is equivalent) in a
few places. For avoiding a deadlock, we ensure that the global
slave_active_lock is always locked at first before each timer lock.
Also, ack and active_list of slave instances are properly unlinked at
snd_timer_stop() and snd_timer_close().
Last but not least, remove the superfluous call of _snd_timer_stop()
at removing slave links. This is a noop, and calling it may confuse
readers wrt locking. Further cleanup will follow in a later patch.
Actually we've got reports of use-after-free by syzkaller fuzzer, and
this hopefully fixes these issues.
Change-Id: I572878b909dda522dbedc84633414185802bc974
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'fs/pipe.c')
0 files changed, 0 insertions, 0 deletions