Skip to content

Commit

Permalink
UPSTREAM: ALSA: timer: Fix wrong instance passed to slave callbacks
Browse files Browse the repository at this point in the history
commit 117159f0b9d392fb433a7871426fad50317f06f7 upstream.

In snd_timer_notify1(), the wrong timer instance was passed for slave
ccallback function.  This leads to the access to the wrong data when
an incompatible master is handled (e.g. the master is the sequencer
timer and the slave is a user timer), as spotted by syzkaller fuzzer.

This patch fixes that wrong assignment.

Bug: 37240993
Change-Id: I7a9f258f13d500776725f2383136dabcb563a0d3
BugLink: http://lkml.kernel.org/r/CACT4Y+Y_Bm+7epAb=8Wi=AaWd+DYS7qawX52qxdCfOfY49vozQ@mail.gmail.com
Reported-by: Dmitry Vyukov <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Siqi Lin <[email protected]>
Signed-off-by: Francisco Franco <[email protected]>
  • Loading branch information
tiwai authored and franciscofranco committed May 11, 2018
1 parent 0ec79e8 commit ccbb058
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/core/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ static void snd_timer_notify1(struct snd_timer_instance *ti, int event)
spin_lock_irqsave(&timer->lock, flags);
list_for_each_entry(ts, &ti->slave_active_head, active_list)
if (ts->ccallback)
ts->ccallback(ti, event + 100, &tstamp, resolution);
ts->ccallback(ts, event + 100, &tstamp, resolution);
spin_unlock_irqrestore(&timer->lock, flags);
}

Expand Down

0 comments on commit ccbb058

Please sign in to comment.