* [patch net] mlxsw: spectrum_router: Fix NULL pointer deref
@ 2017-12-25 7:57 Jiri Pirko
2017-12-25 8:02 ` Jiri Pirko
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Pirko @ 2017-12-25 7:57 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, mlxsw
From: Ido Schimmel <idosch@mellanox.com>
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")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reported-by: Alexander Petrovskiy <alexpe@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index be657b8..434b392 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -3228,7 +3228,7 @@ static void __mlxsw_sp_nexthop_neigh_update(struct mlxsw_sp_nexthop *nh,
{
if (!removing)
nh->should_offload = 1;
- else if (nh->offloaded)
+ else
nh->should_offload = 0;
nh->update = 1;
}
--
2.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [patch net] mlxsw: spectrum_router: Fix NULL pointer deref
2017-12-25 7:57 [patch net] mlxsw: spectrum_router: Fix NULL pointer deref Jiri Pirko
@ 2017-12-25 8:02 ` Jiri Pirko
2018-01-02 17:39 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Pirko @ 2017-12-25 8:02 UTC (permalink / raw)
To: netdev; +Cc: davem, idosch, mlxsw
Mon, Dec 25, 2017 at 08:57:35AM CET, jiri@resnulli.us wrote:
>From: Ido Schimmel <idosch@mellanox.com>
>
>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")
>Signed-off-by: Ido Schimmel <idosch@mellanox.com>
>Reported-by: Alexander Petrovskiy <alexpe@mellanox.com>
>Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Dave, could you please queue this up for 4.14.y together
with "mlxsw: spectrum: Relax sanity checks during enslavement".
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch net] mlxsw: spectrum_router: Fix NULL pointer deref
2017-12-25 8:02 ` Jiri Pirko
@ 2018-01-02 17:39 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2018-01-02 17:39 UTC (permalink / raw)
To: jiri; +Cc: netdev, idosch, mlxsw
From: Jiri Pirko <jiri@resnulli.us>
Date: Mon, 25 Dec 2017 09:02:54 +0100
> Mon, Dec 25, 2017 at 08:57:35AM CET, jiri@resnulli.us wrote:
>>From: Ido Schimmel <idosch@mellanox.com>
>>
>>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")
>>Signed-off-by: Ido Schimmel <idosch@mellanox.com>
>>Reported-by: Alexander Petrovskiy <alexpe@mellanox.com>
>>Signed-off-by: Jiri Pirko <jiri@mellanox.com>
>
> Dave, could you please queue this up for 4.14.y together
> with "mlxsw: spectrum: Relax sanity checks during enslavement".
Both applied and queued up for -stable.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-02 17:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-25 7:57 [patch net] mlxsw: spectrum_router: Fix NULL pointer deref Jiri Pirko
2017-12-25 8:02 ` Jiri Pirko
2018-01-02 17:39 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).