Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4337980pxj; Tue, 8 Jun 2021 11:52:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD/wPfx6On6nmftspwWEZltw+q2CnVDtqWM6MIXa0NfyxMK3Tfl+bApSU6/aRU/1BYRyEa X-Received: by 2002:aa7:dd0b:: with SMTP id i11mr26483001edv.51.1623178345318; Tue, 08 Jun 2021 11:52:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623178345; cv=none; d=google.com; s=arc-20160816; b=v3WCEIx5ZvhGVPN9FBTHCqsb7Sy7hFmL1TmHeOu/8tGa+umUZnVbYLbZoyBtR5uP8e 2B6bVDb8ugBUCJo/JiVDJqRBHm3IQPeJaNb2QFbF3FoAD1GhoEEQgB+SKViM/weAN7Re oCFzf7HGBSmk69bStz/J/FnJiwyd9Ys+9cj2ZkCe1WPzGC6nEadut5RgSXlhMKJthvP+ oVogo9FJUw+dkaD0ew09aJsT9kxwIKPuWE0TyfiFhtoCPCLiXMlCsnDBhtPyLVyLIBUv Hyrbp2Cl8kaL32655hcea31FQMMDifcVlz26CUIRVdpGcpd9rF9cY/+JGaof6aFCPmH4 H4HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=itFsi2Vnrz1jcUmazFyx5maRPxKI97LNGF5sDHvOwUE=; b=d0adVVOaC8ON+a3AN89VGe7q2A9Q5XBKLQ75ByxtxVXWfIsb6zS7cZjMEvsZdmbeMd 5GeBC4Z/BmXler5h5WolEwLcQOxMyJQOXBiSwMO4VOCIr1h5lvgdaI2tXK19MXtE+y92 xpJlLErfquOOhvarHr4smNhTvtfieQug/Ru5U8HuTLfuJOe/51/dAzFIzJVEVoQmchMY 6Ngdkd+NC+CZ35C++4TrKy2KfXx7A74elvrE4gbYeblD6lOxsDuFuKqAgvS3wjP4bQkm aK0j4tF0D0nFqsMBxRhZGplxZJRjvkjaG7KQ5iClUAWwkG9LtS+eldW/BfFC8nr0VYAY AvgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oTfrx03U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n9si376412edw.373.2021.06.08.11.52.01; Tue, 08 Jun 2021 11:52:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oTfrx03U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236269AbhFHSuM (ORCPT + 99 others); Tue, 8 Jun 2021 14:50:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:44434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235876AbhFHSpb (ORCPT ); Tue, 8 Jun 2021 14:45:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A6A4561450; Tue, 8 Jun 2021 18:37:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177424; bh=2QiJxsg5maSu709tFu6uIJUCW/la+Evv/N/OLyJRUjg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oTfrx03UY9Uz8LgeFICPClD1p2vbzebycTjJKICpjXqD3MsBXWrJ3x2ci+GZ8FP1S 0YA4r6PWGmdz/beGoxYTkCO0AiBaLzSXkEPnN3peEewb/k060ir16BBjRa5LjHQpvo ml2tY6cK+MdEXfhhpeseTofOlgqQsVCKJvwJA7/w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+d102fa5b35335a7e544e@syzkaller.appspotmail.com, Jaroslav Kysela , Takashi Iwai Subject: [PATCH 5.4 47/78] ALSA: timer: Fix master timer notification Date: Tue, 8 Jun 2021 20:27:16 +0200 Message-Id: <20210608175936.865312515@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175935.254388043@linuxfoundation.org> References: <20210608175935.254388043@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai commit 9c1fe96bded935369f8340c2ac2e9e189f697d5d upstream. 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: syzbot+d102fa5b35335a7e544e@syzkaller.appspotmail.com Reviewed-by: Jaroslav Kysela Cc: Link: https://lore.kernel.org/r/000000000000e5560e05c3bd1d63@google.com Link: https://lore.kernel.org/r/20210602113823.23777-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/core/timer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -491,9 +491,10 @@ static void snd_timer_notify1(struct snd 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 */