Skip to contentSkip to conversation

Patch "mlxsw: spectrum_router: Fix NULL pointer deref" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Jan 13, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

mlxsw: spectrum_router: Fix NULL pointer deref

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
mlxsw-spectrum_router-fix-null-pointer-deref.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Sat Jan 13 10:51:19 CET 2018

From: Ido Schimmel <[email protected]>
Date: Mon, 25 Dec 2017 08:57:35 +0100
Subject: mlxsw: spectrum_router: Fix NULL pointer deref

From: Ido Schimmel <[email protected]>

[ Upstream commit 8764a8267b128405cf383157d5e9a4a3735d2409 ]

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 a7ff87acd995 ("mlxsw: spectrum_router: Implement next-hop routing")
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +2 -2
@@ -1328,9 +1328,9 @@ set_trap:
 static void __mlxsw_sp_nexthop_neigh_update(struct mlxsw_sp_nexthop *nh,
 					    bool removing)
 {
-	if (!removing && !nh->should_offload)
+	if (!removing)
 		nh->should_offload = 1;
-	else if (removing && nh->offloaded)
+	else
 		nh->should_offload = 0;
 	nh->update = 1;
 }

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/mlxsw-spectrum_router-fix-null-pointer-deref.patch