Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2566388lkm; Mon, 20 Sep 2021 18:53:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXvSB2hdg7IQIN17DU0JvAQM8loq4PKboDW6rmMlIYsUBF8RzvWePxi+79xZmS+1VIZWu7 X-Received: by 2002:a6b:c3cb:: with SMTP id t194mr21250929iof.50.1632188711757; Mon, 20 Sep 2021 18:45:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188711; cv=none; d=google.com; s=arc-20160816; b=A9jC+NGZK5Wwsjnssk0s3I/Apxq1mmhyJvqDInHFRW4c+f+iQppJnulQA68lt+1LYI wDmA3Q7PvtiPM0/hbKg1asAR+ZvpXVU2o/E251SW3CjhB6SzERMBLXysFyC3XRBtKrft x5NUo5t4uBn2HygJ5K/C3p42jJrtmvdG6gGjFaYhDLWVckpCaUST0xNPbq7nCd5OGHrl mQ2Kn3Qn+Yu/3z4G2LVTdSAfGsoLZtIb3RT2wTZMAnnNSdt5R658YnL6TMdcelbMA4KU 6o65Nw/zKs2vqBZOJbcvN1dr+cPWJokyJbcMw7BBl1Ps13wHD3uNrVSXNppT1fOCLFPi 61Ew== 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=hzciZjkzj4QtEzIfPVulem9ZVgvMhPpOj705AqsTOnc=; b=hdqk3iAy+O/fD8BSWzNVA8n5VXMaaVnY4i2VBLPqIPKcAKTk0q8f0AUTHUnvYD3xrt O5EZiqW1cPzN+1uooYWuGWZZUXg0UFUEfI6DC0wN2COPiZOis79Qr/eM4nLlqHsDP+xF 5H1JnI5n9nq/PR7X6HTgCWzpI2lBih5FlNECtRNbVND+s277mJl6yRh9UgPvhasXcQvg CFcaYNhcuIHtn5TKs6x3jibLQD1Pmcw0aDNat0ayQ8y1++hwDuxTlUq21Uar6JdqAvHl RLZAcS+ywnlX8D+u1phBuCvZmhWdspl6OeRhcc6LE9pak7Eyux5TML5qS/TfKNZukCSm pi8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rIIzT9Bq; 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 z11si8750469iom.108.2021.09.20.18.45.00; Mon, 20 Sep 2021 18:45:11 -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=rIIzT9Bq; 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 S1345742AbhITRNE (ORCPT + 99 others); Mon, 20 Sep 2021 13:13:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:33538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345831AbhITRK7 (ORCPT ); Mon, 20 Sep 2021 13:10:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5CC2E61353; Mon, 20 Sep 2021 16:56:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632157004; bh=aN2cU1wklIRNpnUj5osZUpNdfq0GB0ZZ7CVsvd9fctA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rIIzT9BqiwHJmKV5n6uLeFAlgwqUEjyeGEa4yYVl5mXEldee//r0wexfodpWr0/QW WFuu/SST5cp0KAobOujMTMxNmIDcRUELrUfAfPjZpzfINXmS/+ZpjvECDlh+HR5ONS UFPyN9qHM0ME3syq16gHGaVTmyf/+ZuILkHQjblY= 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.14 010/217] ALSA: pcm: fix divide error in snd_pcm_lib_ioctl Date: Mon, 20 Sep 2021 18:40:31 +0200 Message-Id: <20210920163924.967717721@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163924.591371269@linuxfoundation.org> References: <20210920163924.591371269@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 @@ -1757,7 +1757,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; }