Skip to content

Commit 015bac5

Browse files
Kyungwook Booanguy11
authored andcommitted
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: Kyungwook Boo <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/T/ Reviewed-by: Przemek Kitszel <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Aleksandr Loktionov <[email protected]> Tested-by: Rinitha S <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
1 parent fee4a79 commit 015bac5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -817,10 +817,11 @@ int i40e_pf_reset(struct i40e_hw *hw)
817817
void i40e_clear_hw(struct i40e_hw *hw)
818818
{
819819
u32 num_queues, base_queue;
820-
u32 num_pf_int;
821-
u32 num_vf_int;
820+
s32 num_pf_int;
821+
s32 num_vf_int;
822822
u32 num_vfs;
823-
u32 i, j;
823+
s32 i;
824+
u32 j;
824825
u32 val;
825826
u32 eol = 0x7ff;
826827

0 commit comments

Comments
 (0)