diff options
author | Nikolay Aleksandrov <nikolay@cumulusnetworks.com> | 2020-05-26 12:56:15 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-06-03 08:21:37 +0200 |
commit | 88e81db5509b32a1fb3b1efc82757cd8990ea484 (patch) | |
tree | 4dd7d40bb44d37ec12bc9f6712da89e6fd19a297 /net/netlink | |
parent | 8398275f7aed243e287f6eaf0c829ade0f2803ba (diff) |
nexthops: don't modify published nexthop groups
commit 90f33bffa382598a32cc82abfeb20adc92d041b6 upstream.
We must avoid modifying published nexthop groups while they might be
in use, otherwise we might see NULL ptr dereferences. In order to do
that we allocate 2 nexthoup group structures upon nexthop creation
and swap between them when we have to delete an entry. The reason is
that we can't fail nexthop group removal, so we can't handle allocation
failure thus we move the extra allocation on creation where we can
safely fail and return ENOMEM.
Fixes: 430a049190de ("nexthop: Add support for nexthop groups")
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/netlink')
0 files changed, 0 insertions, 0 deletions