From mboxrd@z Thu Jan 1 00:00:00 1970 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 5608919EED3; Tue, 25 Mar 2025 17:48:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742924893; cv=none; b=NutTC8aL8BpFjnWtlN7gm7T/k5x/qHy25XW+JVfFdczInFnwK6xF4+QIZueKS5l2UKrUAlc/yuk1+Uw2F7xjjOw6VNQCv2Ot2Gpz6Js/ILSzIxaSzuSXcxiQxVr9Kgo4rF576x9baPibpumwaRgHBIOSi9DgW26s7/laIhF6/qQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742924893; c=relaxed/simple; bh=LDYDrMN1yw3dnPT5hqTvwo1DrKrUFNcyLxotDaZ19As=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=c5tSDnBn3EWTJCpSVz+0qLhmNjggp2t4NfZYDdlmsEITQfcQ0/ataiz0PqQimk636yImB8G5aEEuxvOkrcLXa/gP2Mh8rlStasSeHYSAs09OMLzBbxRNdf76zjeBAO2zddfZS4WGjnRvaM/BW4+7QnSVEqwbm1FL0G22ryxNNvU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eEg6jeoq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eEg6jeoq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62CD4C4CEE4; Tue, 25 Mar 2025 17:48:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1742924892; bh=LDYDrMN1yw3dnPT5hqTvwo1DrKrUFNcyLxotDaZ19As=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eEg6jeoqkTApxk+g4qxnWkA2KZibY5XwiIYqCjJZeLAETwp8dhdDtijH7GCzFgJvH St2ItRLskRowiJQlKKLQhyOj9uZ5iHyWFshM3dluJDgXBWsgi6RZHh+lUDIIH4++ZS cceOkMcfkOPi7Quu1HTfAra7Kh1sNY90JJ0FTeClpMsnzEKZPlPBJkZ98SScn3qnj1 4IwL723MoY4UCa5sMvlGD/3OY9Ki6oxQglZdMAePjZnNokrLy/K1Q4jYV+rBTaTALn nsGL756qYeF5D8+Gr51gjx7f/qfPLP5PIOdJZ2AHQP0IyaNdNERUDgAa7EwtINAvJ6 fdiDLSGOJF5Ow== Date: Tue, 25 Mar 2025 10:48:01 -0700 From: Jakub Kicinski To: Meghana Malladi Cc: , , , , , , , , , , , , , , , , , , , Vignesh Raghavendra , Roger Quadros , Subject: Re: [PATCH net-next v2 3/3] net: ti: icss-iep: Fix possible NULL pointer dereference for perout request Message-ID: <20250325104801.632ff98d@kernel.org> In-Reply-To: <20250321081313.37112-4-m-malladi@ti.com> References: <20250321081313.37112-1-m-malladi@ti.com> <20250321081313.37112-4-m-malladi@ti.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 21 Mar 2025 13:43:13 +0530 Meghana Malladi wrote: > Whenever there is a perout request from the user application, > kernel receives req structure containing the configuration info > for that req. This doesn't really explain the condition under which the bug triggers. Presumably when user request comes in req is never NULL? > Add NULL pointer handling for perout request if > that req struct points to NULL. > > Fixes: e5b456a14215 ("net: ti: icss-iep: Add pwidth configuration for perout signal") > Signed-off-by: Meghana Malladi > Reviewed-by: Simon Horman > --- > > Changes from v1(v2-v1): > - Collected RB tag from Simon Horman > > drivers/net/ethernet/ti/icssg/icss_iep.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/net/ethernet/ti/icssg/icss_iep.c b/drivers/net/ethernet/ti/icssg/icss_iep.c > index b4a34c57b7b4..aeebdc4c121e 100644 > --- a/drivers/net/ethernet/ti/icssg/icss_iep.c > +++ b/drivers/net/ethernet/ti/icssg/icss_iep.c > @@ -498,6 +498,10 @@ static int icss_iep_perout_enable(struct icss_iep *iep, > { > int ret = 0; > > + /* Return error if the req is NULL */ code is trivial here, explain the 'why' not the 'what' Why is this called with NULL? > + if (!req) > + return -EINVAL; -- pw-bot: cr