mlxsw: Fix use-after-free bug in mlxsw_sx_port_xmit
authorIdo Schimmel <idosch@mellanox.com>
Thu, 6 Aug 2015 14:41:58 +0000 (16:41 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Aug 2015 05:54:10 +0000 (22:54 -0700)
commite577516b9db3e0f19df82b6430fe3b06e05d6304
tree4c9eac68dca177a0335932c9b8191ffde55b7941
parent3bfcd34764cbd3bcb48f6e9009eacf1d19856213
mlxsw: Fix use-after-free bug in mlxsw_sx_port_xmit

Store the length of the skb before transmitting it and use it for stats
instead of skb->len, since skb might have been freed already.

This issue was discovered using the Kernel Address sanitizer (KASan).

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/switchx2.c