Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18763053ybl; Fri, 3 Jan 2020 08:34:59 -0800 (PST) X-Google-Smtp-Source: APXvYqx/c5DAKypovb7DtUxpKXvxvslfbW5U6k7vbUfzG2s5foDyYKcoTsZah0x43sHxIachh59y X-Received: by 2002:a9d:53cb:: with SMTP id i11mr101857151oth.158.1578069299178; Fri, 03 Jan 2020 08:34:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578069299; cv=none; d=google.com; s=arc-20160816; b=or05Ajgw0jVVyUgQcxyNWUhMGf09zknS+DcR2AF0o7idUCnXHmtPQyD+U4dGWYT1/f 9W3jroGEAL8UuNh09TbwvXpTyMOmt/4UQlPJc0FrqNcubWhHIXOe6yRJBbdX4LSem6B1 yzng2CNgDVpxggXW77H8lBOh4xU5RqxylSjyObQlN73tnh1C1CKPMvkxER/doYvocsvI 28Qfx7GZcePkAmdk2XK6xet+MCb5/oDUSjbx+TaPcJv9V0OIFWtLN3pnDkJNkCJhOWcw Rwm+rfcK0tjsJFLCkKdbfoVsw9TTvy4TkBFXvbkt8H4LSBcKDURsGvh3ADhse9Zv+mIS 1M0A== 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=WXeu1H/KzNsnaOE8LudeAc8eAQxR0Us8ZrHwY3SHBes=; b=NeLJ7PSvXNXLdg9J4fhl3F/XF8IPGsogAXyh+EtaGv13ga4nQy9qVqRGMa9trLiT4u zyykMkb1413HQ+my456QFym3xbQ7WeuuJmmoDqyYaCwOG8xAGmIT0PMao3Gvbv1MkN+q MbXxB1IBihHPfOvZY2FGWfeDJVVVISizK5polPXIroQJy9HHJkQ6wWlFxmVjNnuwyswP Q17vm7Yq3tCT+EuPFMGOkS1hOQMTEXLD1vDqPc3IdG3RiH059PraSKiS2HRuwGokzSa9 J14siBUiQq/W1weKFgoSsDPCNplfrlfX7JGzCnTgjv7ZvVhre1NQtJ7whpDa0Hh94nKh yZIA== 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 p184si28172140oib.144.2020.01.03.08.34.46; Fri, 03 Jan 2020 08:34:59 -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 S1727996AbgACQeH (ORCPT + 99 others); Fri, 3 Jan 2020 11:34:07 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:45338 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727859AbgACQeH (ORCPT ); Fri, 3 Jan 2020 11:34:07 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 407DA1C25EC; Fri, 3 Jan 2020 17:34:05 +0100 (CET) Date: Fri, 3 Jan 2020 17:34:04 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Maurizio Lombardi , Douglas Gilbert , "Martin K. Petersen" , Sasha Levin Subject: Re: [PATCH 4.19 054/114] scsi: scsi_debug: num_tgts must be >= 0 Message-ID: <20200103163404.GB14328@amd> References: <20200102220029.183913184@linuxfoundation.org> <20200102220034.493876476@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7iMSBzlTiPOCCT2k" Content-Disposition: inline In-Reply-To: <20200102220034.493876476@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 --7iMSBzlTiPOCCT2k Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Maurizio Lombardi >=20 > [ Upstream commit aa5334c4f3014940f11bf876e919c956abef4089 ] >=20 > Passing the parameter "num_tgts=3D-1" will start an infinite loop that > exhausts the system memory Should we provide some kind of upper bound for num_tgts, too? Otherwise integer overflow will follow later in the code. Even without overflow, it will kill the system due to OOM... Best regards, Pavel =09 --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --7iMSBzlTiPOCCT2k Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl4PbPwACgkQMOfwapXb+vJe+QCgxM6mHDdr9lN4KVhL48lnkSd6 uW0AnAnlyoORhsiDZEtCaYQJO1xEfsUN =wV7f -----END PGP SIGNATURE----- --7iMSBzlTiPOCCT2k--