Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2563991lkm; Mon, 20 Sep 2021 18:49:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxdOUt0EahVJ+mg05M95NMFIw2t7xuYJbZkzy/V19Md28CIlk5KHgwcd65yYU/AzmOLmnw X-Received: by 2002:a92:c26f:: with SMTP id h15mr19176003ild.271.1632188900604; Mon, 20 Sep 2021 18:48:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188900; cv=none; d=google.com; s=arc-20160816; b=dHDMlDGbXSwNaowK/YrWSJ5ZGG6JwlATdjuOBhj8I9mNNSEwE60+BhA/xhnnFNkJj4 98us2hsKeERkr5UR+YNZIIUIQCVRSNzkkiSrWldJynadOi4vcd2uuq3VGADxjYBvaorP iNyUkEateM5upEZSo32ezYTThQCdTAkBUBN7TnpDKDt/hNgRFfDC6PzASExVJgaa3tx5 ih4wX0HpCfyDgq1l2KwPgJqnFUQi+5/pX2nj/RqAEXyD1/eRYegGf3HquI87OH1aycMm xKS8hzlYB49csa4gQaN0zKnPjHbIO6Q8vE8CSQw+dsalP0R3dzt60faZBleEe6SbDTNx wt0Q== 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=aM6LJ908Deo+BvrUxYsLvZ9N/By9fLjgbBZ/VikunVo=; b=Ie9aGPZLRX8BIQFKQRKcfmuam4Z9oWlIBefD6AA7MG5nOTEWN+n3cGS5zKgatyC7+C vPtWFjkIrcwd3hwy7jiK6CmzpoVZpw8Q7bmgTFcDI1fox2/IY3AWH7a2Z8BhvQjbeyKL eWpcCxLJ5nnNwZMtH5yzeEAOdUfQbYJhGTAWNcLRluWi88l8GMrr0zdhjZthypf4B8cj 5FXsWTTn4qUFgz4CSTB2Q4U8XOIs9MxUj6m4FynEHBSiAKKCHwb4fc/AEaSD2yILEp4s I2mAQ/PlSNcpBAH8BvHRqX4o9k6MF/Pm2UF+t7htoZTnvL5lxLbe5WIZ+jhSGRL0Ip6n Be5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BrmjW968; 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 s11si15523141ild.14.2021.09.20.18.48.09; Mon, 20 Sep 2021 18:48:20 -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=BrmjW968; 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 S1351466AbhITReE (ORCPT + 99 others); Mon, 20 Sep 2021 13:34:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:35282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351065AbhITRbw (ORCPT ); Mon, 20 Sep 2021 13:31:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C4A7B61AFD; Mon, 20 Sep 2021 17:04:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157481; bh=IQ0GRxPKZgRWF4RaUTjIIlMapSGGrifwxjWwwFgWhKU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BrmjW968qotMDLw+uwadLX0pTTy4XIZy0YzgiFE6JQ75mP8BK66NLYSzTYp47vp9r 9YBj6e+fJN3LQcLc4Tko7CuuTyAxugr/mVD2Xf/ew8s0FDPUjtUsuAfhiRZm+c59mO Aq1H57o/ZuVg+/T0eAaxDyjz1ywxF7KxfcoAjWD0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zubin Mithra , Guenter Roeck , Takashi Iwai Subject: [PATCH 4.19 011/293] ALSA: pcm: fix divide error in snd_pcm_lib_ioctl Date: Mon, 20 Sep 2021 18:39:33 +0200 Message-Id: <20210920163933.645576817@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@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: Zubin Mithra commit f3eef46f0518a2b32ca1244015820c35a22cfe4a upstream. Syzkaller reported a divide error in snd_pcm_lib_ioctl. fifo_size is of type snd_pcm_uframes_t(unsigned long). If frame_size is 0x100000000, the error occurs. Fixes: a9960e6a293e ("ALSA: pcm: fix fifo_size frame calculation") Signed-off-by: Zubin Mithra Reviewed-by: Guenter Roeck Cc: Link: https://lore.kernel.org/r/20210827153735.789452-1-zsm@chromium.org Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/core/pcm_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -1751,7 +1751,7 @@ static int snd_pcm_lib_ioctl_fifo_size(s channels = params_channels(params); frame_size = snd_pcm_format_size(format, channels); if (frame_size > 0) - params->fifo_size /= (unsigned)frame_size; + params->fifo_size /= frame_size; } return 0; }