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 6E4C7302755; Tue, 30 Sep 2025 14:59:36 +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=1759244376; cv=none; b=t8jVDUZhuIJNGg+To9dgB0hqh+ui8o1kk9SPDw6tW347Fozr0Go4PW/b4VE3Q5uTI7mtBeqJplyYO1+QKiydJmajT7OxvCO6QyBLzpC5fWguuY08ZaA9FQ3a2ClFJctxKHXUVxy0JpPtipLo7WLPpObXQSJ7EmlEIA70GlqempI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759244376; c=relaxed/simple; bh=D/YOMKIhXcwhinSC+aRAYswI413G2aEZbULRYDm5+Ac=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Hj8XKdLnDQ/SF1NVyLFEOIsfb33B7qZZynjDRXHTcpiXyK1bWF848pFcV8jY0Ikw1ZW9lTW+RO0EzxkB9903levtzvbu5f3VeeTvhmsCJvFT6Qg815h8nEyGo8svtvtmU6qX6rv5MtmpJRQrlzmShBhtTSKHmo0a5dz4BC1bXvg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rIIoFObX; 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="rIIoFObX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F61AC113D0; Tue, 30 Sep 2025 14:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759244375; bh=D/YOMKIhXcwhinSC+aRAYswI413G2aEZbULRYDm5+Ac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rIIoFObXKFnDGfQI3NJoITjPyzck5tPjm8uI185Q5y5EewXR5YZ4b1rLwesfcvwky MUPMhGrj3YCQWWZ5kj4z89sU71iEXCDIVW8dJDhto2BbBAGOgyVXee46bVYgU4iCbD D2ECOMImWdyW67PXiWXnJJ6+0H4/sobE/mH+bacc= 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 , Tony Nguyen , Kamakshi Nellore Subject: [PATCH 5.10 110/122] i40e: fix idx validation in i40e_validate_queue_map Date: Tue, 30 Sep 2025 16:47:21 +0200 Message-ID: <20250930143827.473346440@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 aa68d3c3ac8d1dcec40d52ae27e39f6d32207009 upstream. Ensure idx is within range of active/initialized TCs when iterating over vf->ch[idx] in i40e_validate_queue_map(). Fixes: c27eac48160d ("i40e: Enable ADq and create queue channel/s on VF") 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: Kamakshi Nellore (A Contingent Worker at Intel) Signed-off-by: Tony Nguyen Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c @@ -2397,8 +2397,10 @@ static int i40e_validate_queue_map(struc u16 vsi_queue_id, queue_id; for_each_set_bit(vsi_queue_id, &queuemap, I40E_MAX_VSI_QP) { - if (vf->adq_enabled) { - vsi_id = vf->ch[vsi_queue_id / I40E_MAX_VF_VSI].vsi_id; + u16 idx = vsi_queue_id / I40E_MAX_VF_VSI; + + if (vf->adq_enabled && idx < vf->num_tc) { + vsi_id = vf->ch[idx].vsi_id; queue_id = (vsi_queue_id % I40E_DEFAULT_QUEUES_PER_VF); } else { queue_id = vsi_queue_id;