]> Git Repo - J-linux.git/commitdiff
ALSA: timer: Fix master timer notification
authorTakashi Iwai <[email protected]>
Wed, 2 Jun 2021 11:38:23 +0000 (13:38 +0200)
committerTakashi Iwai <[email protected]>
Thu, 3 Jun 2021 07:39:58 +0000 (09:39 +0200)
snd_timer_notify1() calls the notification to each slave for a master
event, but it passes a wrong event number.  It should be +10 offset,
corresponding to SNDRV_TIMER_EVENT_MXXX, but it's incorrectly with
+100 offset.  Casually this was spotted by UBSAN check via syzkaller.

Reported-by: [email protected]
Reviewed-by: Jaroslav Kysela <[email protected]>
Cc: <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
sound/core/timer.c

index 6898b1ac0d7f4572e36958834d6c602f4c937c70..92b7008fcdb86a57b91fd90d02474303943db9c2 100644 (file)
@@ -520,9 +520,10 @@ static void snd_timer_notify1(struct snd_timer_instance *ti, int event)
                return;
        if (timer->hw.flags & SNDRV_TIMER_HW_SLAVE)
                return;
+       event += 10; /* convert to SNDRV_TIMER_EVENT_MXXX */
        list_for_each_entry(ts, &ti->slave_active_head, active_list)
                if (ts->ccallback)
-                       ts->ccallback(ts, event + 100, &tstamp, resolution);
+                       ts->ccallback(ts, event, &tstamp, resolution);
 }
 
 /* start/continue a master timer */
This page took 0.059954 seconds and 4 git commands to generate.