Skip to content

Commit 9739d58

Browse files
lczapnikanguy11
authored andcommitted
i40e: fix input validation logic for action_meta
Fix condition to check 'greater or equal' to prevent OOB dereference. Fixes: e284fc2 ("i40e: Add and delete cloud filter") Cc: [email protected] Signed-off-by: Lukasz Czapnik <[email protected]> Reviewed-by: Aleksandr Loktionov <[email protected]> Signed-off-by: Przemek Kitszel <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent f1ad24c commit 9739d58

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3603,7 +3603,7 @@ static int i40e_validate_cloud_filter(struct i40e_vf *vf,
36033603

36043604
/* action_meta is TC number here to which the filter is applied */
36053605
if (!tc_filter->action_meta ||
3606-
tc_filter->action_meta > vf->num_tc) {
3606+
tc_filter->action_meta >= vf->num_tc) {
36073607
dev_info(&pf->pdev->dev, "VF %d: Invalid TC number %u\n",
36083608
vf->vf_id, tc_filter->action_meta);
36093609
goto err;

0 commit comments

Comments
 (0)