Commit 015bac5d authored by Kyungwook Boo's avatar Kyungwook Boo Committed by Tony Nguyen
Browse files

i40e: fix MMIO write access to an invalid page in i40e_clear_hw



When the device sends a specific input, an integer underflow can occur, leading
to MMIO write access to an invalid page.

Prevent the integer underflow by changing the type of related variables.

Signed-off-by: default avatarKyungwook Boo <bookyungwook@gmail.com>
Link: https://lore.kernel.org/lkml/ffc91764-1142-4ba2-91b6-8c773f6f7095@gmail.com/T/


Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Reviewed-by: default avatarAleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent fee4a79a
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -817,10 +817,11 @@ int i40e_pf_reset(struct i40e_hw *hw)
void i40e_clear_hw(struct i40e_hw *hw)
{
	u32 num_queues, base_queue;
	u32 num_pf_int;
	u32 num_vf_int;
	s32 num_pf_int;
	s32 num_vf_int;
	u32 num_vfs;
	u32 i, j;
	s32 i;
	u32 j;
	u32 val;
	u32 eol = 0x7ff;