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 E91713CC9F8; Wed, 25 Mar 2026 16:42:52 +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=1774456973; cv=none; b=owvo6Z9XyXWEBIwgAdsmKkfvb2GdIAzH6p1rvs/9kbJBUAr0qOR+uZc8O6J3EyXs8Kivq2WUqqOdiMp3D718tjWyxlYAA3Cg15+SJ8rH2qd/UUY0zAPRlq9iFhQV3PQv6vDWJSkikGjXpwqcWn9rcGixkDy3yluIG0jhBsngStk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774456973; c=relaxed/simple; bh=ftAS/2TjN/TRbBu6BzWLARyDup41kIcRxGAHYWEUato=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GHF8C1+Hv7CqX6CtA3QsssDKc1bkBCcZiSz7o/KH4Anxb3Q2kG2J+ud8BzSVIvwngLZAIlb5QJOMpfA4s9s59iOjzPqoDOrwJfY15DG8s2fNgnnPprO/E7lMfXRV6Gxwh2qiVLYfutrRCV+nDYDmGKY5nAUedWlJ2n99a1ZpzRQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=L38QAl9I; 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="L38QAl9I" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 887D5C4CEF7; Wed, 25 Mar 2026 16:42:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774456972; bh=ftAS/2TjN/TRbBu6BzWLARyDup41kIcRxGAHYWEUato=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L38QAl9I5o4+juGu4PvFQoEga45702tv0N53YB1Azh3rPCsy49koOpniP9GltrnnF mvNr/chm1v115BTjaJf46BtE9+v4g/dzkACODErjFDIJV3M8mhb1J2Wey9y1qTmGen ZZ0++U/eHY5y7n32ZdrrE6HpcGntgle2jG7haDFB/qM/Kn7Dz1/CtatbTpfxsJOpL0 Be3vr6isBTcDJv5/5Fb8jZ/u4XI1f3DSrYXhNkrdrbb5Clf1MS9Iv4SfBsfSuGFvCT 7bnEjIld2kzv0u0A5Upnf8Dh9hWV5vZob/MLF4zZ9D3Dbg0tzrdlJBolV8QxbsBMjA JOrX69yGkZayw== Date: Wed, 25 Mar 2026 16:42:46 +0000 From: Simon Horman To: Ratheesh Kannoth Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, sgoutham@marvell.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, donald.hunter@gmail.com, jiri@resnulli.us, chuck.lever@oracle.com, matttbe@kernel.org, cjubran@nvidia.com, shshitrit@nvidia.com, dtatulea@nvidia.com, tariqt@nvidia.com Subject: Re: [PATCH v7 net-next 5/5] octeontx2-af: npc: Support for custom KPU profile from filesystem Message-ID: <20260325164246.GF111839@horms.kernel.org> References: <20260323035110.3908741-1-rkannoth@marvell.com> <20260323035110.3908741-6-rkannoth@marvell.com> <20260324163621.GC111839@horms.kernel.org> 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-Disposition: inline In-Reply-To: On Wed, Mar 25, 2026 at 08:44:30AM +0530, Ratheesh Kannoth wrote: > On 2026-03-24 at 22:06:21, Simon Horman (horms@kernel.org) wrote: ... > > Perhaps it applies to the existing code as well. But I think > > the new code to handle parsing images read from the file system > > could benefit from bounds checking. Basically passing in the length > > of the firmware image as an argument and ensuring that data beyond > > that length isn't accessed. > This is already done in both arms of the code. > > if (rvu->kpu_fwdata_sz < hdr_sz + offset) { > dev_warn(rvu->dev, > "Profile size mismatch on KPU%i parsing.\n", > "profile size mismatch on kpu%i parsing.\n", > kpu + 1); > return -EINVAL; > > > Sorry, somehow I missed that.