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 16BF838B149; Mon, 18 May 2026 18:56:16 +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=1779130577; cv=none; b=KbWVD/I7lRxJFQ+fSrn81lTlND8Fci2rmowLmvVaG2aOO0yPoR7IrARYnlQ/W0C7N5a2uoUQSPZF52aTFcE3X8y1HTQUVO065QVco7aKrKClfa2Qc/0q+JchJFUj0aaMEBCf9EY0dN32Kd7twKBG8vk6/t8R3a5I5/M3mLnbrZE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779130577; c=relaxed/simple; bh=9xSWq3/p42ZAOBsEQMtxfJEQE/1Guk1SM/niBcloTd4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XhFF+FyBVB8/pNImzY+wfJFvhXAOmQDDGGjfih1NPvcjmsIcJP/OoJdpLycst7LlF6hzRy1tw5BhFPqRlJhfzo2E0QGh/AqNxsVFUAvGBSv/RVa2q8W9kq8D/v3yx6LSvhTIoXPZkQ5bp1a/MlagY0WZTLgZcswMQ9X8kWuNOxs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kAtO3ksr; 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="kAtO3ksr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC0BEC2BCB7; Mon, 18 May 2026 18:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1779130576; bh=9xSWq3/p42ZAOBsEQMtxfJEQE/1Guk1SM/niBcloTd4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kAtO3ksrzt7DJjrHpNTpug1TB9x9vec33F++NIpJ2TO9rfd7gv4EDSobrmmcE0fIy O3gxjbOPlVdjfHdnTioK5F9u48ds8Biz1rsxVKg1LSSOC52e+85qCTtj+S2dcNRdeW 6FKKfd1o/GNCHwA0x2ugS7FfI6MCcnIcmRv2ZEIMMRuBT9YsUt4j3o/fuv8Cdyizaw 1S0Ta1gT/NykobMjlRWWKR/MR9ujwgwuAGFvbZUeEm+uIhV1uQ0DyzZj65qaYf8Xtq Ow3X5F+5suIqWaMVYP23JeWSFykQkqeCczX8v6rhxZA9JrfZMQza+ak7eI+DHyFRRu VVQhYETjNxlvw== Date: Mon, 18 May 2026 19:56:11 +0100 From: Simon Horman To: Junrui Luo Cc: Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Mitch Williams , Greg Rose , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yuhao Jiang , stable@vger.kernel.org Subject: Re: [PATCH net v2] iavf: validate num_vsis in VIRTCHNL_OP_GET_VF_RESOURCES response Message-ID: <20260518185611.GF98116@horms.kernel.org> References: 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 Thu, May 14, 2026 at 02:55:04PM +0800, Junrui Luo wrote: > The VF allocates a fixed-size buffer for IAVF_MAX_VF_VSI (3) VSI > entries when processing a VIRTCHNL_OP_GET_VF_RESOURCES response from > the PF. However, num_vsis from the PF response is used unchecked as > the loop bound when iterating over vsi_res[] in multiple functions. > > A PF sending num_vsis greater than IAVF_MAX_VF_VSI, or the received > message is shorter than num_vsis claims leads to out-of-bounds accesses > on the vsi_res[] array. > > Clamp num_vsis based on the actual bytes copied from the PF response. > > Fixes: 5eae00c57f5e ("i40evf: main driver core") > Reported-by: Yuhao Jiang > Cc: stable@vger.kernel.org > Signed-off-by: Junrui Luo > --- > Changes in v2: > - Clamp num_vsis based on actual received message length instead of > IAVF_MAX_VF_VSI suggested by Przemek > - Link to v1: https://lore.kernel.org/r/SYBPR01MB7881AF11C45AEDC0D4CA89C1AF062@SYBPR01MB7881.ausprd01.prod.outlook.com Reviewed-by: Simon Horman There is an AI-generated review of this patchset available on sashiko.dev. However, I believe that the issues raised there can be considered in the context of possible follow-up. I do not believe they should block progress of this patch.