Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7630557rdb; Thu, 4 Jan 2024 02:44:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IFAaq/eJSmjjkScjqlWHZtjf/CfNfkTA1IYqxc/Gz9wKzHR1Y1Fkh1gAZLrXdVjj8Od5OSu X-Received: by 2002:a05:6402:1212:b0:554:7034:e0f8 with SMTP id c18-20020a056402121200b005547034e0f8mr232489edw.81.1704365058723; Thu, 04 Jan 2024 02:44:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704365058; cv=none; d=google.com; s=arc-20160816; b=VYt2bPu7t3tADAzqQ7yGTs5aKP/ibgZKw+LMzmOWhwKwqM8pH9cfus0zkHUy5fQOvp cD34EcT8zCLadUi6ihkN7qFn8qHJaTagCXPQZiC5FYBRrGXW80r+SRavajMcmc8TvZAH ZRR+Gcx66GE289NNP3NQnY1XzNAJ1MkDAAyGsSkeqMjKzbvZKWzJZ3961ZDRhDZZkVf9 bDRultL96svW8dM715CT2CMg02p59L4xuVIm4TWB7xHgMiV0JkIrFROwDIQV4UAL1kJf lrsIxkHX14M5zcl8Y0oYB2inQ3QiKZOekjVb3so3Mrpe2WyqQ4WoH/GoXPPv8TH8lmza XdEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=PIOS6Rw3aTY+yGNTKYCyRB5sWvUGJJllca5fqSdS5K4=; fh=121LUqpsVikNmc941RLF3l+EyrTvVq61IJ1+GqRVeB4=; b=Qg2R6SffCtosBjz7F9TipwyTO9RbF73//59rmvwJ3HjYRLR39zGanBVPx8+Q9vXEU7 O0Di207jgTJ0H5FAcN6U1473YN7dvfzCkkDOmnKkn3mVj/pCe8L9n0ASmsEMp8dECGHQ psbuTX2ermcYUNXem1DIlHkVVyrdg6VPpdaEtQKdDIU0mHaUJexBYPYSFeJi7joG92gI AyYlpsUurlWiGrsE81X4BtVpBdYY48elt9bzMoIks/5RilGrheDoqGDbF/mflPq+Qgka XJDULuyRCcPoXsddfvxteRCLLiUHAJ9g3mc3nkDKpVbxj1+AkFqSsIESl5DPZix5YkUB 5eFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oMjHZb6m; spf=pass (google.com: domain of linux-kernel+bounces-16522-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16522-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y59-20020a50bb41000000b00553ab5afef0si13112041ede.662.2024.01.04.02.44.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 02:44:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-16522-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oMjHZb6m; spf=pass (google.com: domain of linux-kernel+bounces-16522-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-16522-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 79DF01F24E7B for ; Thu, 4 Jan 2024 10:44:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 823EA20DE0; Thu, 4 Jan 2024 10:44:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="oMjHZb6m" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B09D210E6; Thu, 4 Jan 2024 10:44:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1FBDC433C7; Thu, 4 Jan 2024 10:44:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1704365048; bh=qWsGozCds69J55V51Nw4hD1uUMdPFMjkgJ1PBcIhjgU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oMjHZb6mp3VNQWhgL7u1SLUA7jbXoufPhqEHJX4wQcR0p9TMY1NIx/8zupxZRg52y SwoDPZXGMjTrRVKW4rw5vV95sZNNRcfwh/zH8I7ZYpCKy+xyrTIw9iiB3LbqGctTXn /eNbmLbZMadipsd+K87D+da4qZCogQ97M49Q2MtI= Date: Thu, 4 Jan 2024 11:44:05 +0100 From: Greg Kroah-Hartman To: Udipto Goswami Cc: Alan Stern , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: core: Prevent null pointer dereference in update_port_device_state Message-ID: <2024010447-sprite-shelter-0743@gregkh> References: <20240104102616.20120-1-quic_ugoswami@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240104102616.20120-1-quic_ugoswami@quicinc.com> On Thu, Jan 04, 2024 at 03:56:16PM +0530, Udipto Goswami wrote: > Currently,the function update_port_device_state gets the usb_hub from > udev->parent by calling usb_hub_to_struct_hub. > However, in case the actconfig or the maxchild is 0, the usb_hub would > be NULL and upon further accessing to get port_dev would result in null > pointer dereference. Is this true for any real (or fake) hardware? > > Fix this by introducing an if check after the usb_hub is populated. > > Fixes: 83cb2604f641 ("usb: core: add sysfs entry for usb device state") > Signed-off-by: Udipto Goswami Any specific reason you don't want this backported to the stable kernels that include the commit you marked this as a fix for? As my bot says: - You have marked a patch with a "Fixes:" tag for a commit that is in an older released kernel, yet you do not have a cc: stable line in the signed-off-by area at all, which means that the patch will not be applied to any older kernel releases. To properly fix this, please follow the documented rules in the Documentation/process/stable-kernel-rules.rst file for how to resolve this. thanks, greg k-h