linux-stable/include
Thomas Zeitlhofer 2a515f6446 net: neigh: decrement the family specific qlen
[ Upstream commit 8207f253a0 ]

Commit 0ff4eb3d5e ("neighbour: make proxy_queue.qlen limit
per-device") introduced the length counter qlen in struct neigh_parms.
There are separate neigh_parms instances for IPv4/ARP and IPv6/ND, and
while the family specific qlen is incremented in pneigh_enqueue(), the
mentioned commit decrements always the IPv4/ARP specific qlen,
regardless of the currently processed family, in pneigh_queue_purge()
and neigh_proxy_process().

As a result, with IPv6/ND, the family specific qlen is only incremented
(and never decremented) until it exceeds PROXY_QLEN, and then, according
to the check in pneigh_enqueue(), neighbor solicitations are not
answered anymore. As an example, this is noted when using the
subnet-router anycast address to access a Linux router. After a certain
amount of time (in the observed case, qlen exceeded PROXY_QLEN after two
days), the Linux router stops answering neighbor solicitations for its
subnet-router anycast address and effectively becomes unreachable.

Another result with IPv6/ND is that the IPv4/ARP specific qlen is
decremented more often than incremented. This leads to negative qlen
values, as a signed integer has been used for the length counter qlen,
and potentially to an integer overflow.

Fix this by introducing the helper function neigh_parms_qlen_dec(),
which decrements the family specific qlen. Thereby, make use of the
existing helper function neigh_get_dev_parms_rcu(), whose definition
therefore needs to be placed earlier in neighbour.c. Take the family
member from struct neigh_table to determine the currently processed
family and appropriately call neigh_parms_qlen_dec() from
pneigh_queue_purge() and neigh_proxy_process().

Additionally, use an unsigned integer for the length counter qlen.

Fixes: 0ff4eb3d5e ("neighbour: make proxy_queue.qlen limit per-device")
Signed-off-by: Thomas Zeitlhofer <thomas.zeitlhofer+lkml@ze-it.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-02 17:43:04 +01:00
..
acpi ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init() 2022-11-10 18:17:24 +01:00
asm-generic vmlinux.lds.h: Fix placement of '.data..decrypted' section 2022-11-16 10:04:06 +01:00
clocksource
crypto
drm drm/edid: Handle EDID 1.4 range descriptor h/vfreq offsets 2022-09-02 16:38:51 +03:00
dt-bindings dt-bindings: clock: exynosautov9: correct clock numbering of peric0/c1 2022-10-21 12:38:32 +02:00
keys
kunit kunit: fix assert_type for comparison macros 2022-09-01 13:00:32 -06:00
kvm
linux bpf: Prevent bpf program recursion for raw tracepoint probes 2022-11-26 09:27:56 +01:00
math-emu
media media: v4l: subdev: Fail graciously when getting try data for NULL state 2022-11-10 18:17:24 +01:00
memory
misc
net net: neigh: decrement the family specific qlen 2022-12-02 17:43:04 +01:00
pcmcia
ras mm, hwpoison: enable memory error handling on 1GB hugepage 2022-08-08 18:06:44 -07:00
rdma
rv
scsi scsi: stex: Properly zero out the passthrough command structure 2022-10-15 08:02:56 +02:00
soc ARM: at91: pm: avoid soft resetting AC DLL 2022-11-26 09:27:26 +01:00
sound ASoC: Intel: common: add ACPI matching tables for Raptor Lake 2022-11-04 00:00:28 +09:00
target
trace ARM: SoC fixes for 6.0-rc6 2022-09-22 11:10:11 -07:00
uapi audit: fix undefined behavior in bit shift for AUDIT_BIT 2022-12-02 17:42:59 +01:00
ufs scsi: ufs: core: Enable link lost interrupt 2022-08-11 22:04:32 -04:00
vdso
video
xen x86/xen: Add support for HVMOP_set_evtchn_upcall_vector 2022-08-12 11:28:21 +02:00