]> git.baikalelectronics.ru Git - kernel.git/commit
neighbor: Reset gc_entries counter if new entry is released before insert
authorDavid Ahern <dsahern@gmail.com>
Thu, 2 May 2019 01:08:34 +0000 (18:08 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 4 May 2019 04:36:19 +0000 (00:36 -0400)
commit6e637a72db28955f1c9ea7fe9fa0393519f4a944
tree4bae5434e1190ed072ea51ccb2389843653f34bd
parent2e4e5854bf131190502af93a37372d2af8b26f2a
neighbor: Reset gc_entries counter if new entry is released before insert

Ian and Alan both reported seeing overflows after upgrades to 5.x kernels:
  neighbour: arp_cache: neighbor table overflow!

Alan's mpls script helped get to the bottom of this bug. When a new entry
is created the gc_entries counter is bumped in neigh_alloc to check if a
new one is allowed to be created. ___neigh_create then searches for an
existing entry before inserting the just allocated one. If an entry
already exists, the new one is dropped in favor of the existing one. In
this case the cleanup path needs to drop the gc_entries counter. There
is no memory leak, only a counter leak.

Fixes: af2ec202823 ("neighbor: Improve garbage collection")
Reported-by: Ian Kumlien <ian.kumlien@gmail.com>
Reported-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
Tested-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/neighbour.c