diff options
author | Takashi Iwai <tiwai@suse.de> | 2016-02-04 17:06:13 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-17 12:34:37 -0800 |
commit | 3a43ddb85acf2bfb892cf29dd7a7ee3f8427d1fb (patch) | |
tree | b47b8e1782788d108668263de4d5202bb9be22c1 /firmware | |
parent | 5886e7b59075f4702015ba66cdacdc897e6e284a (diff) | |
download | lwn-3a43ddb85acf2bfb892cf29dd7a7ee3f8427d1fb.tar.gz lwn-3a43ddb85acf2bfb892cf29dd7a7ee3f8427d1fb.zip |
ALSA: timer: Fix leftover link at closing
commit 094fd3be87b0f102589e2d5c3fa5d06b7e20496d upstream.
In ALSA timer core, the active timer instance is managed in
active_list linked list. Each element is added / removed dynamically
at timer start, stop and in timer interrupt. The problem is that
snd_timer_interrupt() has a thinko and leaves the element in
active_list when it's the last opened element. This eventually leads
to list corruption or use-after-free error.
This hasn't been revealed because we used to delete the list forcibly
in snd_timer_stop() in the past. However, the recent fix avoids the
double-stop behavior (in commit [f784beb75ce8: ALSA: timer: Fix link
corruption due to double start or stop]), and this leak hits reality.
This patch fixes the link management in snd_timer_interrupt(). Now it
simply unlinks no matter which stream is.
BugLink: http://lkml.kernel.org/r/CACT4Y+Yy2aukHP-EDp8-ziNqNNmb-NTf=jDWXMP7jB8HDa2vng@mail.gmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'firmware')
0 files changed, 0 insertions, 0 deletions