Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1418419pxb; Fri, 10 Sep 2021 05:37:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxZOrON2XjFwWgI7Bx+FlZqwx/AMK1DKkXuc4lnCZi0HLAFsEZ8hupduNi6f2mhpjRKaIS X-Received: by 2002:a6b:6a14:: with SMTP id x20mr6668681iog.177.1631277473591; Fri, 10 Sep 2021 05:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631277473; cv=none; d=google.com; s=arc-20160816; b=Rltr1IDBaxvNAsPb3e8IjT+FTekC4IZVv+qVT6dr0MBpAqIMM2VQyIzg+z2AA1jiJC zYWNO3kGYBTNvzf22hye9dpPYRiJFRMeCVPvnzRMqGZfNiZy+J6P79n1bs6tWql3Mpo4 KkBOYGyeHy1SMiMmK0N2dGxq5YfUMu6oVWaLbPHbNld1YtNCHirI+ZQsUAHRWGqkv92p 73it8FBzZRTzLNEF3ESZQvsss1gwLEKZtr6VPpq2tpa//BlwZqt8Qgsfktky5v7satuc 0Zvgf7cQX4wwUfcj2THG7tf7HiijqdPOiNXpljkl2i1IpQ7sKV8Xsz2QM/NECYwLNIHv v5jQ== 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=CiBuu7DIs4Qqai64ijleDgo/L5BmcAAlzKBwC9Bc0CU=; b=1FWUC8r1MEad0vHmm/OxcPR7t4KPIdgG18ozgTJl23lKABP+2ZkFpTwuqsdJu6vQw+ g8zu35BqmYsprRFIqdIdlTUCfqitfMAIcb2DeXTv5piYcuFdVmEE55LtBfggkOX1jRae 92TSmtmPerMXUw472VSWuph5Jd0qLPPNAv6UWDUHI84jUiKp3xV/8i0jektZCr/k+jPx 67p4FiC3o5hyV0zQcHX8cFgyZMzVRSGTuNtkYUQ7b0O9uG/r2jV5Xye7y2LCi4kuYtZT tGuJJfR2EPGaVSTiyDHPR2k9h1pI8n+BJmYIPkJJMyOWZkLPycaut8lvCbjGGp5Rpu/e +2uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LN2tqWyL; 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 e2si4601698jaa.68.2021.09.10.05.37.40; Fri, 10 Sep 2021 05:37:53 -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=LN2tqWyL; 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 S234818AbhIJMhJ (ORCPT + 99 others); Fri, 10 Sep 2021 08:37:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:54670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234449AbhIJMfw (ORCPT ); Fri, 10 Sep 2021 08:35:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C110C6120A; Fri, 10 Sep 2021 12:34:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631277281; bh=F24TdFUH5CQsnKq46FZSuduUQiyheaZt3lDooekJxnY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LN2tqWyLIhRdXB607ZZwWgFD5GZQtsU+c8wj5YzZdAoNeq5y+vTBstdisP1NF1OcA O5jmVedxJPeJJV0Q9HnD5rHIUyq+MOCIFnEpizXroMI5sifRSUimeOCKbFQa+y6h8i cHxil1oFlbncqmO55A4bzGtZYomkVT2/vnllNicE= 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 5.4 19/37] ALSA: pcm: fix divide error in snd_pcm_lib_ioctl Date: Fri, 10 Sep 2021 14:30:22 +0200 Message-Id: <20210910122917.800179513@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210910122917.149278545@linuxfoundation.org> References: <20210910122917.149278545@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 @@ -1736,7 +1736,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; }