Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1248470ybh; Thu, 23 Jul 2020 04:20:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbqxq3S13LhB7MS0TmZivYQbT9/APab1pNcnXceBSuALvzub5v2RON6RP59KxKKNVWpOg6 X-Received: by 2002:a05:6402:b57:: with SMTP id bx23mr3549396edb.304.1595503214710; Thu, 23 Jul 2020 04:20:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595503214; cv=none; d=google.com; s=arc-20160816; b=nyl46GtKOCn4LK3nSuJGVjALjhAwBC2Lukkt5FF/9uItRK/XbF/Wa8/ulhnbCZHzru bmdtRRB8kGaal4X1sY8XOotKmPSili7PlBd3FRUdfLH/uHbhXs1lTFyaMkgBxf+cd4K5 2fuaIjNrMprzzqMQzWAUUg+76JFzTX/1yl6TFm4vJT0K8WtCbrxoHVSZDlZ48U3DHWLI hyIat9xRGIPNtUB5FU6eF8pycCcMt9jznuW6o7LdO589xU2FRoFV7McqH8icR4+zBIbV 2FmCPEgbCn7oEev7dETd8+CqrpQQdw5sZJAYTNhcw3ar7McwHsNHg9pHHZD3qkOA6mh8 vjMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=tmkxUmowZK5HAP36t+SC4rSIGvH7VeONHc66UCzqElw=; b=ZOtYjdomWj7UWV8n1tkUUm2B7Ey0Wl+XiyXpq8BOl1zGONaLCqz0T3YBmxsNWQSZez xWGgXtcv92EXzEnqkgc8Ft+u0pH8df1iAcPWpb2UTeFEgTgpwBqh6XT6E1zLVkCQ21gl ldmmkAeG6rQ0/cRbLyvTiuHrZSD16MAXLx6iPaX+mG7Bv+6l6v2SZ9WXm6z8ECTTKnR2 l6FSWVmgW2vmqHrFDlzrTZGfF7WTSJZi3sGp3B1ksuDnmuIro+Fum8Yja3t2YbJUcKL3 e411phXTixpdvFMHK5XEfRHSdCJo3bbjXIWnvtQ5pypTfvqj4Wrsi2DPfz5o8dX6oZt/ Limw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=X5jl6HVt; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dg22si1183124edb.25.2020.07.23.04.19.51; Thu, 23 Jul 2020 04:20:14 -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=@kernel.org header.s=default header.b=X5jl6HVt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728426AbgGWLTb (ORCPT + 99 others); Thu, 23 Jul 2020 07:19:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:57700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725846AbgGWLTb (ORCPT ); Thu, 23 Jul 2020 07:19:31 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 44BDA206F4; Thu, 23 Jul 2020 11:19:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595503170; bh=/L66IPWsTwQKHafCML2stlb8sDzgzvJ2TicBnY5PFCg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X5jl6HVtha0ujLKYFWMkzo561uPSVD0kzZS6SzOLXvaCUFCcssfEoXo5t+zcHzM9p uUDOfOVysQjBw7DsO0D3sfPkioNQTAsI4aklnyieS12//nilszmfPH+YHWoma7xU7N eqYeftvob5QxtWnfbo5cVqV1vFAarES+7wiQ4SlM= Date: Thu, 23 Jul 2020 13:19:34 +0200 From: Greg Kroah-Hartman To: Jon Hunter Cc: Mathias Nyman , Thierry Reding , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH V2] usb: tegra: Fix allocation for the FPCI context Message-ID: <20200723111934.GA1964033@kroah.com> References: <20200712102837.24340-1-jonathanh@nvidia.com> <20200715113842.30680-1-jonathanh@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200715113842.30680-1-jonathanh@nvidia.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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... thanks, greg k-h