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 483A01F3FED; Tue, 30 Sep 2025 15:25:25 +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=1759245925; cv=none; b=eYIK2QTJIZZRPjCz1vX0ZrAeeKaTp7mTJX2tqvspT4rNo5DhLvByYzahSXjStj5todrcan3KOMLWbA7QxrQOEtHECOf7Gld1UvdBFfeiE03k/zGbYTVUe9xZxNotvpvUGsRsc6HfM6MTWqL6FoP0b5gzEtcQlhtKGzzqZvhlEFs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759245925; c=relaxed/simple; bh=yLF+92XWTvEOMK6174Q9ZZduKSH+mgPXezq7azOdScQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q3d+0qR9tZjodZ/E6GCc2ukmUqxkylhIyOvekF1pxc/ymMmWmIc22MRX+wTplNKeBOclsNb/goGBPDhqBJaoVDizFoEjiPM2As5qnEc0Uzac03puTqp5Y9sleQpW2EXiQZpYVNeQlxMkumdQGByZ+XN+qHemwql/cYH85qJEGn0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rV74fSY8; 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="rV74fSY8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2486C4CEF0; Tue, 30 Sep 2025 15:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759245925; bh=yLF+92XWTvEOMK6174Q9ZZduKSH+mgPXezq7azOdScQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rV74fSY8/BeIDwD5ouyxhjKHPCWqA6GtzbEOievJLsC+VaPB/2qklfwEncDXwJHRq +xcBHrdXYEbWFgIMx6AgJ47wp1kdNY6VflY+W83Kd+cGKayAQ9KJRZADW2k9FrTsRz XhnAsWKcgzU/9Qg6uLo4s/PZlAJg5MmUY9sDzM1M= 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 6.6 60/91] i40e: add max boundary check for VF filters Date: Tue, 30 Sep 2025 16:47:59 +0200 Message-ID: <20250930143823.684566545@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250930143821.118938523@linuxfoundation.org> References: <20250930143821.118938523@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 6.6-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 @@ -3898,6 +3898,8 @@ err: aq_ret); } +#define I40E_MAX_VF_CLOUD_FILTER 0xFF00 + /** * i40e_vc_add_cloud_filter * @vf: pointer to the VF info @@ -3937,6 +3939,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) { aq_ret = -ENOMEM;