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 AE90F30506C; Tue, 30 Sep 2025 14:59:42 +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=1759244382; cv=none; b=NfnFf61RZvS5c9X2zAYXtl8WOg79LxSae9kN/x1dr4YVwt8ul4k18/WciwbhlFy4nMIv3dtbu0UFGIhUaDrgY043QU/UbeIzvtvcd7Yl95dIGE+EplmweGqvAzqBteEdcVRsH64d84R0RfS9lbV35f5HrlJL8Pve2IzD3UMmiTw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759244382; c=relaxed/simple; bh=OUdHSepfytE91AmfqpQiFh1LnXRf+dmu2oVQCuirG9I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IDQZ5dm1TIqayltaSdo3EVKl0kgFyDT6kDeEXcpmZpc9/E2jzW8Cu7qKi1c2QCPj8OaaL2Qs9q9J/3RXKxQHyMupOy79v3ZfbuqV6fYEbZ823YW57K8KsO17ofCMUqSqR+ava5/oBNWTpG4nTRVz4KNpnG95XC+ovb8tfAygr44= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=agWsbHid; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="agWsbHid" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DA56C4CEF0; Tue, 30 Sep 2025 14:59:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759244382; bh=OUdHSepfytE91AmfqpQiFh1LnXRf+dmu2oVQCuirG9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=agWsbHidbhiiKqyidjhnZerVvWfTsMjIHkzCE7PcbwTsRXHGYZXCejIcTHT17qThM 7F6d1PBVItqupIRIS5dS5l+KczTjsbBWxltNym+IuKcS8p8isxxZhEluiHYn+JwdKR 5AcZtN72u+gp9oI0fDpTTvUXgBVZtcOZqHLappbc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Lukasz Czapnik , Aleksandr Loktionov , Przemek Kitszel , Simon Horman , Rafal Romanowski , Tony Nguyen Subject: [PATCH 5.10 112/122] i40e: add max boundary check for VF filters Date: Tue, 30 Sep 2025 16:47:23 +0200 Message-ID: <20250930143827.552429890@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250930143822.939301999@linuxfoundation.org> References: <20250930143822.939301999@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lukasz Czapnik commit cb79fa7118c150c3c76a327894bb2eb878c02619 upstream. There is no check for max filters that VF can request. Add it. Fixes: e284fc280473 ("i40e: Add and delete cloud filter") Cc: stable@vger.kernel.org Signed-off-by: Lukasz Czapnik Reviewed-by: Aleksandr Loktionov Signed-off-by: Przemek Kitszel Reviewed-by: Simon Horman Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c @@ -3710,6 +3710,8 @@ err: aq_ret); } +#define I40E_MAX_VF_CLOUD_FILTER 0xFF00 + /** * i40e_vc_add_cloud_filter * @vf: pointer to the VF info @@ -3749,6 +3751,14 @@ static int i40e_vc_add_cloud_filter(stru goto err_out; } + if (vf->num_cloud_filters >= I40E_MAX_VF_CLOUD_FILTER) { + dev_warn(&pf->pdev->dev, + "VF %d: Max number of filters reached, can't apply cloud filter\n", + vf->vf_id); + aq_ret = -ENOSPC; + goto err_out; + } + cfilter = kzalloc(sizeof(*cfilter), GFP_KERNEL); if (!cfilter) return -ENOMEM;