Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1583047pxu; Sat, 12 Dec 2020 18:50:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLbp1qHYoZrfdsJlwO/jA2hTQp3PTzbTEBErwurGXaPKXLmm+IZrlKPXYNsPFHAsxuh//P X-Received: by 2002:aa7:c353:: with SMTP id j19mr18790296edr.204.1607827841686; Sat, 12 Dec 2020 18:50:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607827841; cv=none; d=google.com; s=arc-20160816; b=BPmJtO2UWGhMOJ0QMH0c5OmbpxUT+QftONHKs6ZEgMdJr/Aut0i0jSITM3NJqMHLPV D42dA8dF6lKhW6qIcMKOd3OiChv6Lar8rBG7Y9IqmaiviwXl5/L6Bj59q7ZgwJufmQ6Q LNQwsEEzu7lavRAOC+Abw6pTqc9PpqjwxtG7FuV+jaU1cWu9HMr4rcoJ4LodMcpxMhRM aQ62GdRCmxZlA8feMcV5dLlGaXZzt3VJlZU2EX0Bcwo8GJJ9uO66QHsgRuVIM4jvpGFA 4jH7MuONROlwLgdFVMMVPj5GLkIvoaPynrqpXCj7+Xb7EawO0ZN9qcBRB6xOZPUJ91C3 mP8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=Z64Q69bNv5l/byHSt5ulVubWnuvQgElXrnT00inZ4+c=; b=Nsk81cnMuI2mIMFg2eGlZWUC4w+LwbEM8gd8efhemLxIymME4Ek3bd5E8WAKwfefz2 qzXoLIwSciF7KAYOmoPZdwzKNRwL3sNNsnnwG3VnqMpiTW7AlY68ibaf0M6fCRpZuHvz NN9gOYyXsUy9k+NARfh2P6PFdq8jL7A0bYxudE1qQJ8bNsuty5xVVTePiJicBrRtgYPI u18+/IpW0ueojqc+YHHCIt4i5PeDZ5B/emcv5NwjvIr908LXmFTRcGQPy7Ggvm0LMvIF VrF53kt5sTXKRCE0e6IWH8Upt3z5+VBclqGEn/kFmjhmrdoZjwyNafpkwTjgoeWxpK8d uhlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pVpvQXxd; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s11si7941330edy.18.2020.12.12.18.50.19; Sat, 12 Dec 2020 18:50:41 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=pVpvQXxd; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393403AbgLKUrM (ORCPT + 99 others); Fri, 11 Dec 2020 15:47:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:41778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391288AbgLKUrJ (ORCPT ); Fri, 11 Dec 2020 15:47:09 -0500 Date: Fri, 11 Dec 2020 12:46:27 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607719589; bh=W3XvV2FN8bnGn+0PE+UG66OnmrvBWes/FNmdjqojzaE=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=pVpvQXxdGH6hT8/deIH1b8KzzSU0P9l0Wa7k98mQrV/z/baUAEWISNvcHPkvyfwV4 sIKtbNz6vlZEAmuqi6eWbIT6dppb13Sry8pkgZaGYdgxYQ8QxQysi6kBQR7mZbtj9R 9KMnIGngOCJ90nfdMXaoRPljwwqfIkIhisA/+G2BPUz/kMzAqAKruFlXn6o08dWEJd G5AC3fFNB4WZ6YwBq7bCJJg4CvAoaJAk3Asel0VMBP428Oyj1UAQeMKVZPmB/njDev Cr2PQqRB6nX5zWogRC5Axyx7nGR2t4KWjqtUAs0Bec5P7BikHL1Zj3Kc8zgS5P12Up 1DGs5ovOXtf5w== From: Jaegeuk Kim To: Eric Biggers Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, kernel-team@android.com, cang@codeaurora.org, alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org, martin.petersen@oracle.com, stanley.chu@mediatek.com Subject: Re: [PATCH] scsi: ufs: fix memory boundary check for UFS 3.0 Message-ID: References: <20201211193814.1709484-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/11, Eric Biggers wrote: > On Fri, Dec 11, 2020 at 11:38:14AM -0800, Jaegeuk Kim wrote: > > From: Jaegeuk Kim > > > > If param_offset is greater than what UFS supports, it'll give kernel panic. > > > > Signed-off-by: Jaegeuk Kim > > Change-Id: I48ea6f3f3074bd42abf4ecf8be87806732f3e6a3 > > --- > > drivers/scsi/ufs/ufshcd.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > > index d6a3a0ba6960..04687661d0df 100644 > > --- a/drivers/scsi/ufs/ufshcd.c > > +++ b/drivers/scsi/ufs/ufshcd.c > > @@ -3194,6 +3194,9 @@ int ufshcd_read_desc_param(struct ufs_hba *hba, > > return -EINVAL; > > } > > > > + if (param_offset > buff_len) > > + return -EINVAL; > > + > > /* Check whether we need temp memory */ > > if (param_offset != 0 || param_size < buff_len) { > > desc_buf = kmalloc(buff_len, GFP_KERNEL); > > -- > > Didn't this already get fixed by: > > commit 1699f980d87fb678a669490462cf0b9517c1fb47 > Author: Can Guo > Date: Wed Oct 21 22:59:00 2020 -0700 > > scsi: ufs: Fix unexpected values from ufshcd_read_desc_param() Oh, cool. Yes, please ignore this. Thanks,