]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
batman-adv: prevent ELP transmission interval underflow
authorSven Eckelmann <sven@narfation.org>
Fri, 29 May 2026 21:36:43 +0000 (23:36 +0200)
committerSven Eckelmann <sven@narfation.org>
Wed, 3 Jun 2026 06:27:16 +0000 (08:27 +0200)
commit5e50d4b8ae3ea622122d3c6a38d7f6fe68dfddca
tree0eb1ebe51370f9526e322ac133af4fe84f3dab35
parent98b0fb191c878a64cbaebfe231d96d57576acf8c
batman-adv: prevent ELP transmission interval underflow

batadv_v_elp_start_timer() enqeues a delayed work. The time when it starts
is randomly chosen between (elp_interval - BATADV_JITTER) and
(elp_interval + BATADV_JITTER). The configured elp_interval must therefore
be larger or equal to BATADV_JITTER to avoid that it causes an underflow of
the unsigned integer. If this would happen, then a "fast" ELP interval
would turn into a "day long" delay.

At the same time, it must not be larger than the maximum value the variable
can store.

Cc: stable@kernel.org
Fixes: a10800829040 ("batman-adv: Add elp_interval hardif genl configuration")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/netlink.c