Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a88c1b27 authored by Lukasz Czapnik's avatar Lukasz Czapnik Committed by Greg Kroah-Hartman
Browse files

i40e: fix input validation logic for action_meta



commit 9739d5830497812b0bdeaee356ddefbe60830b88 upstream.

Fix condition to check 'greater or equal' to prevent OOB dereference.

Fixes: e284fc28 ("i40e: Add and delete cloud filter")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarLukasz Czapnik <lukasz.czapnik@intel.com>
Reviewed-by: default avatarAleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Tested-by: default avatarRafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b6cb93a7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3367,7 +3367,7 @@ static int i40e_validate_cloud_filter(struct i40e_vf *vf,

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