diff options
author | Jiri Pirko <jiri@mellanox.com> | 2016-11-10 06:31:04 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-10 13:02:15 -0500 |
commit | 33b1341cd1bf5c89e7ef332aa8ac3ed614a3d942 (patch) | |
tree | 516ea68da5d5e948bf32aeb098a72e2042165470 /scripts/gcc-plugins/cyc_complexity_plugin.c | |
parent | 2ce0af8fd0a6c2938e49630a0fdf3257464576e3 (diff) |
mlxsw: spectrum_router: Fix handling of neighbour structure
__neigh_create function works in a different way than assumed.
It passes "n" as a parameter to ndo_neigh_construct. But this "n" might
be destroyed right away before __neigh_create() returns in case there is
already another neighbour struct in the hashtable with the same dev and
primary key. That is not expected by mlxsw_sp_router_neigh_construct()
and the stored "n" points to freed memory, eventually leading to crash.
Fix this by doing tight 1:1 coupling between neighbour struct and
internal driver neigh_entry. That allows to narrow down the key in
internal driver hashtable to do lookups by "n" only.
Fixes: 6cf3c971dc84 ("mlxsw: spectrum_router: Add private neigh table")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'scripts/gcc-plugins/cyc_complexity_plugin.c')
0 files changed, 0 insertions, 0 deletions