Skip to content

Commit bf9e2a9

Browse files
Kyungwook BoosfX-bot
authored andcommitted
i40e: fix MMIO write access to an invalid page in i40e_clear_hw
[ Upstream commit 015bac5daca978448f2671478c553ce1f300c21e ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent d9bcbf6 commit bf9e2a9

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
@@ -1320,10 +1320,11 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw)
13201320
void i40e_clear_hw(struct i40e_hw *hw)
13211321
{
13221322
u32 num_queues, base_queue;
1323-
u32 num_pf_int;
1324-
u32 num_vf_int;
1323+
s32 num_pf_int;
1324+
s32 num_vf_int;
13251325
u32 num_vfs;
1326-
u32 i, j;
1326+
s32 i;
1327+
u32 j;
13271328
u32 val;
13281329
u32 eol = 0x7ff;
13291330

0 commit comments

Comments
 (0)