From: Takashi Iwai Date: Wed, 13 Jan 2016 20:35:06 +0000 (+0100) Subject: ALSA: timer: Fix double unlink of active_list X-Git-Tag: v4.1.12-92~150^2~381 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=86230d1152c644e9a939b8730ac5137cd85c1d96;p=users%2Fjedix%2Flinux-maple.git ALSA: timer: Fix double unlink of active_list Orabug: 23330530 commit ee8413b01045c74340aa13ad5bdf905de32be736 upstream. ALSA timer instance object has a couple of linked lists and they are unlinked unconditionally at snd_timer_stop(). Meanwhile snd_timer_interrupt() unlinks it, but it calls list_del() which leaves the element list itself unchanged. This ends up with unlinking twice, and it was caught by syzkaller fuzzer. The fix is to use list_del_init() variant properly there, too. Reported-by: Dmitry Vyukov Tested-by: Dmitry Vyukov Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman (cherry picked from commit dc5697eb3297920e20b53fdf4c40891e1ed0eafd) Signed-off-by: Dan Duval --- diff --git a/sound/core/timer.c b/sound/core/timer.c index f5ec1ba4c4bb5..3d2ba526093a6 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -704,7 +704,7 @@ void snd_timer_interrupt(struct snd_timer * timer, unsigned long ticks_left) } else { ti->flags &= ~SNDRV_TIMER_IFLG_RUNNING; if (--timer->running) - list_del(&ti->active_list); + list_del_init(&ti->active_list); } if ((timer->hw.flags & SNDRV_TIMER_HW_TASKLET) || (ti->flags & SNDRV_TIMER_IFLG_FAST))