Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp995151ybg; Wed, 29 Jul 2020 03:08:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzR9fe46Kg/n+OE14d6DQdSB+V0VpHndGMum0qS9uPr/a/3bEFY2ZiscypRKqyXRD+3zmwf X-Received: by 2002:a17:906:2a41:: with SMTP id k1mr17058317eje.300.1596017326248; Wed, 29 Jul 2020 03:08:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596017326; cv=none; d=google.com; s=arc-20160816; b=UEAfGmtqoElXISulkW3PjzUpQ+cbRopYw/GhBc6yyCZpNu+OiGxHCNQSUlVOywMWjb 1swqPM0fWN03P/dtXjRqR4MEXcRnhhuB4Yo6AfRBb6O/Kb64nhnmgpuhb01/Sft37ZBn 4S91XwqJs5uD2Zgy9aC3oHZ49F2sS7JkBSodjPkb3YUIj4H7hEw2/gZsNM1en4z9B6bi 3VFQ/t7pBLcvJO+5lm7UrHgCUkOvukZvKlh/F3unsmmXJtHAZ1GvSvVVMz0p5PIH3kCb 6VI+MkVq2KAO668IAfOVZUqzEMd7h1utNMJGCknVXsO22eFX1dSLQNl2Enl7WjTIwQKO axyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=J9aeU8QwhA/JpGumv0tXw97StQVGfr0gZpe+p+AtC6g=; b=dNVpLUW0lrncCLNIUBEvNxflXcmI2f1mOgx6obCu4qYxSpbqJB2+uYJhFa9izfMaaX AA6CfPsZoufASKHQv2bmO9RRhb1g1G+YQ9NYeI9eITpy5+k4eWePZTM95VzhgNqapH4u bOKjvJsUliOIgCHyXlTW5KEx486v7KyyE6v6e9ZH6l217SkabB0dcCP0aks4h46ns4Rr u5HjYlrI+numNPhv3XTLvY2nZwplVX68t4V8IR+Cs4pF87pOaUUhyRhSvkkAdk1f/YLG AZEWDgr2ELehTWvhy8SyMZ4gMgkCXPHVsyrrQ/ZoLDb3Qu69gfquIqTplVEVXhdCK+EF HOdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=nAqZhoEx; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y5si984757edr.105.2020.07.29.03.08.23; Wed, 29 Jul 2020 03:08:46 -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=@nvidia.com header.s=n1 header.b=nAqZhoEx; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726476AbgG2KIM (ORCPT + 99 others); Wed, 29 Jul 2020 06:08:12 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:18831 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbgG2KIL (ORCPT ); Wed, 29 Jul 2020 06:08:11 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 29 Jul 2020 03:07:26 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 29 Jul 2020 03:08:11 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 29 Jul 2020 03:08:11 -0700 Received: from [10.26.73.28] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 29 Jul 2020 10:08:06 +0000 Subject: Re: [PATCH V2] usb: tegra: Fix allocation for the FPCI context To: Greg Kroah-Hartman CC: Mathias Nyman , Thierry Reding , , , References: <20200712102837.24340-1-jonathanh@nvidia.com> <20200715113842.30680-1-jonathanh@nvidia.com> <20200723111934.GA1964033@kroah.com> From: Jon Hunter Message-ID: Date: Wed, 29 Jul 2020 11:08:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200723111934.GA1964033@kroah.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1596017246; bh=J9aeU8QwhA/JpGumv0tXw97StQVGfr0gZpe+p+AtC6g=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=nAqZhoExb/n7tqUKdOPO908fv9jjGGo36/TG9jMXPo8zRbAOQek+STMLzw7OHGpMg mpcfwhatS3Wj/tNSzlRCMmIPDOjhpIRat4Hpvntf5Q+UBMkezzbMDsOxhgCTQdchLe tW89JQJ1RNiwjgn4gBdBTVBrujXBETqhf91wDF12gKiLXZpikM8odFFC/Ct8QQlpOX evf+EalsdJYogJD3rbemv0QPeCNv/GxzJlLtXFYMDjRqJEnldrmK6YpWuHrYGzF4VV EiPFovdp9SpAGsjRCNL5HCP9KeA3wBhjKup5VGPBIsFreEqhWnqjuDI6sV7eQROELN /t21PyBzq4JUQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/07/2020 12:19, Greg Kroah-Hartman wrote: > On Wed, Jul 15, 2020 at 12:38:42PM +0100, Jon Hunter wrote: >> Commit 5c4e8d3781bc ("usb: host: xhci-tegra: Add support for XUSB >> context save/restore") is using the IPFS 'num_offsets' value when >> allocating memory for FPCI context instead of the FPCI 'num_offsets'. >> >> After commit cad064f1bd52 ("devres: handle zero size in devm_kmalloc()") >> was added system suspend started failing on Tegra186. The kernel log >> showed that the Tegra XHCI driver was crashing on entry to suspend when >> attempting the save the USB context. On Tegra186, the IPFS context has a >> zero length but the FPCI content has a non-zero length, and because of >> the bug in the Tegra XHCI driver we are incorrectly allocating a zero >> length array for the FPCI context. The crash seen on entering suspend >> when we attempt to save the FPCI context and following commit >> cad064f1bd52 ("devres: handle zero size in devm_kmalloc()") this now >> causes a NULL pointer deference when we access the memory. Fix this by >> correcting the amount of memory we are allocating for FPCI contexts. >> >> Cc: stable@vger.kernel.org >> >> Fixes: 5c4e8d3781bc ("usb: host: xhci-tegra: Add support for XUSB context save/restore") >> >> Signed-off-by: Jon Hunter >> Acked-by: Thierry Reding >> --- >> >> Changes since V1: >> - Corrected commit message >> - Added Thierry's ACK >> >> drivers/usb/host/xhci-tegra.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) > > No cc: to linux-usb@vger? :( > > I'll go queue this up, but I would have caught it sooner if you had done > so... Sorry about that. Thanks for queuing up! Jon -- nvpublic