]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_router: Fix NULL pointer deref
authorIdo Schimmel <idosch@mellanox.com>
Mon, 25 Dec 2017 07:57:35 +0000 (08:57 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Jan 2018 17:37:16 +0000 (12:37 -0500)
commit101a036fd184e453ee58ae61af03a9ae0cf73bd1
tree41bd0ce83a740054777d470d4a24900f0a3588c8
parenta9a52f438537c69580afa52930c73156ebb08ed7
mlxsw: spectrum_router: Fix NULL pointer deref

When we remove the neighbour associated with a nexthop we should always
refuse to write the nexthop to the adjacency table. Regardless if it is
already present in the table or not.

Otherwise, we risk dereferencing the NULL pointer that was set instead
of the neighbour.

Fixes: 965ddd4c7f05 ("mlxsw: spectrum_router: Implement next-hop routing")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reported-by: Alexander Petrovskiy <alexpe@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c