Skip to content

Commit bad6d4a

Browse files
committed
i40e: fix idx validation in i40e_validate_queue_map
jira KERNEL-238 cve CVE-2025-39972 Rebuild_History Non-Buildable kernel-6.12.0-124.16.1.el10_1 commit-author Lukasz Czapnik <lukasz.czapnik@intel.com> commit aa68d3c Ensure idx is within range of active/initialized TCs when iterating over vf->ch[idx] in i40e_validate_queue_map(). Fixes: c27eac4 ("i40e: Enable ADq and create queue channel/s on VF") Cc: stable@vger.kernel.org Signed-off-by: Lukasz Czapnik <lukasz.czapnik@intel.com> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Reviewed-by: Simon Horman <horms@kernel.org> Tested-by: Kamakshi Nellore <nellorex.kamakshi@intel.com> (A Contingent Worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> (cherry picked from commit aa68d3c) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 4b43202 commit bad6d4a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2469,8 +2469,10 @@ static int i40e_validate_queue_map(struct i40e_vf *vf, u16 vsi_id,
24692469
u16 vsi_queue_id, queue_id;
24702470

24712471
for_each_set_bit(vsi_queue_id, &queuemap, I40E_MAX_VSI_QP) {
2472-
if (vf->adq_enabled) {
2473-
vsi_id = vf->ch[vsi_queue_id / I40E_MAX_VF_VSI].vsi_id;
2472+
u16 idx = vsi_queue_id / I40E_MAX_VF_VSI;
2473+
2474+
if (vf->adq_enabled && idx < vf->num_tc) {
2475+
vsi_id = vf->ch[idx].vsi_id;
24742476
queue_id = (vsi_queue_id % I40E_DEFAULT_QUEUES_PER_VF);
24752477
} else {
24762478
queue_id = vsi_queue_id;

0 commit comments

Comments
 (0)