Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4734805pxj; Wed, 9 Jun 2021 00:04:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOncW49wN97uFS1lgYTvIG8o9uvdMzkBgDxiQzg26rQ3N6Crg3HYfWk0XwFkJGZWYotN8S X-Received: by 2002:a17:906:5f93:: with SMTP id a19mr27085646eju.18.1623222265942; Wed, 09 Jun 2021 00:04:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623222265; cv=none; d=google.com; s=arc-20160816; b=hoU9cwkbh7daLSk90D7CZaeig2y2hxaNvfeuMq4Sn3FjwWYgPNNIjhyzYVYidkPyL2 uKZpX5AMmJ9UcYsLI8lD7jgDrMsnqIagIPvSfhSZPx9j8J3UB0WhNOPP68ylQUxPCv0S QNusZFUXipNDA4HE2SGemihrpF0Xuqyw2jQP+1mc3F73g+bRJclcn/4zFqMw+ls03Seg bWNgBRV8p+8OxAcE/44WxFbmhrMZyTUPKwjvmtapPCb3UNOYeOoOPvwSiEhZbfo4lKC0 rHFNFbxErippu9wlW6BoC5xQAusi1PotGM7plekZoQwDdw4dkcrl0FcD2Z27Hp1PT/YF 89pg== 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=X7S2D83O5/sRnx9IPk1aFIiXKWesobg9eqKstIWVnAU=; b=Ijf3hEdScaUu/4FyzVy3huL8DlF8gnE/Lno4Yhr87McGq7xSaWPMMWfluxIpkLiA0t C23l8fEOBYQDI/tsOwqXM7GkTZBrEGYc4yYb/YzHgDLX52q21UHBRqe6sVnGkAYt7hUK 9qwAsRPFE6LemomuggokkgTIru9zRk2Vl/QeVZWTEJVGZFMlEqrvVHkV0rDE1b1CAzO6 6iWwulTPC2lMpxZW+MJpNd7hJi13QQqcZ2Udyn80/9LSmPahmhWFnVVUAn1GyvGTSZr5 J3LhOhTogXXkETD8rPfQnhMiLc70ufIdsA3R1MuIaEdqTIid8bsBSIdGrfPGfFMxoVh5 JdNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w1PdAhxV; 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 f22si1696855ejl.264.2021.06.09.00.04.02; Wed, 09 Jun 2021 00:04: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=w1PdAhxV; 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 S234888AbhFHSh5 (ORCPT + 99 others); Tue, 8 Jun 2021 14:37:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:58040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234062AbhFHSfo (ORCPT ); Tue, 8 Jun 2021 14:35:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0A3A3613D3; Tue, 8 Jun 2021 18:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177152; bh=O5BdJl3WeIOn6QpxB+u21wKOHY+i9erEeapxL+UVtGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w1PdAhxVDYOLRgEGXXjdMNVzSikMS7K1C1GUfGTXXy+g1hOWvWpE8sWz235AloA7a /Zy83sQn1KTCzl/01EIwVpr43Ok2Bjx04G/6UiAwuKxDbrYFrxy2+2Yw5RRQe0HRhg PdH3hTl8SEhD3nlDaRusisevfAPbHUsLAyk0xD2k= 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 4.14 19/47] ALSA: timer: Fix master timer notification Date: Tue, 8 Jun 2021 20:27:02 +0200 Message-Id: <20210608175931.108778852@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175930.477274100@linuxfoundation.org> References: <20210608175930.477274100@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 @@ -490,9 +490,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 */