Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp228236ybl; Wed, 4 Dec 2019 01:34:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxzs+chAvk4RXi1TmCmOnap9IRO9GyFFevpmWS0Mb/bovTvLokghyp/2y8PWpvu3aZm5GpC X-Received: by 2002:aca:1e02:: with SMTP id m2mr1778203oic.81.1575452071409; Wed, 04 Dec 2019 01:34:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575452071; cv=none; d=google.com; s=arc-20160816; b=dJgXMRDKspsQ4Op7CDpyQmSsDDlE1mMkfK5QnyxDwFrmNmQFewWgdK/iABE7MSed+9 2JlhvUcLdSVbZO0T5VbDRG5WOpVCZ6GnKMRMzCUnodHl5CxFxlof7bsgVa8sY+ZHVUVl 8PUNnJrke9VnL67sJsdYHLa/W95qa8/xuFuf99w0GU9bBudIQ/qPw5JBCJueZzwuTBC1 MjqWKAmSg6pH8OThb4aC0pcDRV57tRy0FFWedfqezySO7UMRvf/HMz4s68Nthle0wTpE uT4erw5VASDvoS/fdo3YM74umjLraAg57K16xXSy1ugg0NKkGcZvFja9+XcF7PYExd5E pvqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=UwDYfwrDvgM3ngH+c6C353GXGY3QuaTH0qyatAQOGVk=; b=wCUXVl/n72XEtL4joVVO5hGww3bl7n3YfkAAOKMHIMOhP5rbb/LIzTDl603wUXFePt cPk212Qv5Fxi1x5EXqzgkXrcLGnHFziz9le1AIWRK1Bw07NoKQ+btJguc24Z4Jxg1/+E N60CghCeY+7YebdtPzHNykJbGSHBWyp2MOthiL92Xaf9ViLyMegUrPsRWRkiZHNjNATR UmuUEPRvcXEJP2jl6S6GsRU1Ad0/y88/PXgc9MmE+A9WgLHpmw7wg6YJVt4jugwWVc9b LTHDhbOf+pmevg4M9Tuzpn06hZaptu6kGOha1yChpF7BZPEt5+6/7rwxYphmaWk4Aa+c /lLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l20si3279713otb.285.2019.12.04.01.34.18; Wed, 04 Dec 2019 01:34:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727370AbfLDJdf (ORCPT + 99 others); Wed, 4 Dec 2019 04:33:35 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:54582 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726899AbfLDJdf (ORCPT ); Wed, 4 Dec 2019 04:33:35 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id ABFCD1C25F4; Wed, 4 Dec 2019 10:33:33 +0100 (CET) Date: Wed, 4 Dec 2019 10:33:33 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Xiaojun Sang , Srinivas Kandagatla , Vinod Koul , Mark Brown , Sasha Levin Subject: Re: [PATCH 4.19 004/321] ASoC: compress: fix unsigned integer overflow check Message-ID: <20191204093332.GA7678@amd> References: <20191203223427.103571230@linuxfoundation.org> <20191203223427.350424112@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline In-Reply-To: <20191203223427.350424112@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue 2019-12-03 23:31:10, Greg Kroah-Hartman wrote: > From: Xiaojun Sang >=20 > [ Upstream commit d3645b055399538415586ebaacaedebc1e5899b0 ] >=20 > Parameter fragments and fragment_size are type of u32. U32_MAX is > the correct check. Why is this in stable? I doubt raising limit from 2GB to 4GB can be called bugfix... kmalloc() will have problems allocating huge ammount of memory, anyway. Best regards, Pavel > +++ b/sound/core/compress_offload.c > @@ -529,7 +529,7 @@ static int snd_compress_check_input(struct snd_compr_= params *params) > { > /* first let's check the buffer parameter's */ > if (params->buffer.fragment_size =3D=3D 0 || > - params->buffer.fragments > INT_MAX / params->buffer.fragment_size || > + params->buffer.fragments > U32_MAX / params->buffer.fragment_size || > params->buffer.fragments =3D=3D 0) > return -EINVAL; > =20 --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl3nfWwACgkQMOfwapXb+vKhbwCeOnJceAMnvxw3Jj0PQwdln5jf WtAAmgLH4ATryXReAWBdS2wEKCl+xohc =rTAe -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ--