Skip to content

Commit 3bfcd34

Browse files
idoschdavem330
authored andcommitted
mlxsw: Use correct skb length when dumping payload
Do not use the length of the transmitted skb (which was freed), but that of the response skb. This issue was discovered using the Kernel Address sanitizer (KASan). Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d003462 commit 3bfcd34

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/mellanox/mlxsw

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mellanox/mlxsw/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ static int mlxsw_core_reg_access_emad(struct mlxsw_core *mlxsw_core,
10731073
mlxsw_core->emad.tid - 1);
10741074
mlxsw_core_buf_dump_dbg(mlxsw_core,
10751075
mlxsw_core->emad.resp_skb->data,
1076-
skb->len);
1076+
mlxsw_core->emad.resp_skb->len);
10771077

10781078
dev_kfree_skb(mlxsw_core->emad.resp_skb);
10791079
}

0 commit comments

Comments
 (0)