]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5e: IPoIB, Fix access to invalid memory address
authorRoi Dayan <roid@mellanox.com>
Mon, 21 Aug 2017 09:04:50 +0000 (12:04 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Oct 2017 09:56:06 +0000 (11:56 +0200)
commit9de182964e0a6bbc1bb7935c6f9dc4f82fcf785d
tree3e5e4455263331de65ecb8e1947b8b0e0c0ff0c3
parent401dfb4850a485e504a151a55e84836de77ac27b
net/mlx5e: IPoIB, Fix access to invalid memory address

[ Upstream commit 38e8a5c040d3ec99a8351c688dcdf0f549611565 ]

When cleaning rdma netdevice we need to save the mdev pointer
because priv is released when we release netdev.

This bug was found using the kernel address sanitizer (KASAN).
use-after-free in mlx5_rdma_netdev_free+0xe3/0x100 [mlx5_core]

Fixes: 48935bbb7ae8 ("net/mlx5e: IPoIB, Add netdevice profile skeleton")
Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c