Commit 0e8f916d authored by Takashi Iwai's avatar Takashi Iwai Committed by Ben Hutchings

ALSA: timer: Fix double unlink of active_list

commit ee8413b0 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: default avatarDmitry Vyukov <dvyukov@google.com>
Tested-by: default avatarDmitry Vyukov <dvyukov@google.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent e68624cb
...@@ -692,7 +692,7 @@ void snd_timer_interrupt(struct snd_timer * timer, unsigned long ticks_left) ...@@ -692,7 +692,7 @@ void snd_timer_interrupt(struct snd_timer * timer, unsigned long ticks_left)
} else { } else {
ti->flags &= ~SNDRV_TIMER_IFLG_RUNNING; ti->flags &= ~SNDRV_TIMER_IFLG_RUNNING;
if (--timer->running) if (--timer->running)
list_del(&ti->active_list); list_del_init(&ti->active_list);
} }
if ((timer->hw.flags & SNDRV_TIMER_HW_TASKLET) || if ((timer->hw.flags & SNDRV_TIMER_HW_TASKLET) ||
(ti->flags & SNDRV_TIMER_IFLG_FAST)) (ti->flags & SNDRV_TIMER_IFLG_FAST))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment