]> git.ipfire.org Git - thirdparty/linux.git/commit
batman-adv: tvlv: avoid race of cifsnotfound handler state
authorSven Eckelmann <sven@narfation.org>
Sun, 14 Jun 2026 09:22:43 +0000 (11:22 +0200)
committerSven Eckelmann <sven@narfation.org>
Sun, 14 Jun 2026 10:33:18 +0000 (12:33 +0200)
commitedb557b2ba38fea2c5eb710cf366c797e187218c
tree77b1146f57c93788c190147d0baeda3f27a449fd
parent32a6799255525d6ea4da0f7e9e0e521ad9560a46
batman-adv: tvlv: avoid race of cifsnotfound handler state

TVLV handlers can have the flag BATADV_TVLV_HANDLER_OGM_CIFNOTFND set to
signal that the OGM handler should be called (with NULL for data) when the
specific TVLV container was not found in the OGM. This is used by:

* DAT
* GW
* Multicast (OGM + Tracker)

The state whether the handler was executed was stored in the struct
batadv_tvlv_handler. But the TVLV processing is started without any lock.
Multiple parallel contexts processing TVLVs would therefore overwrite each
others BATADV_TVLV_HANDLER_OGM_CALLED flag in the shared
batadv_tvlv_handler.

Drop the shared BATADV_TVLV_HANDLER_OGM_CALLED flag and instead determine,
per TVLV buffer, whether a matching container was present by scanning the
packet's buffer.

Cc: stable@kernel.org
Fixes: ef26157747d4 ("batman-adv: tvlv - basic infrastructure")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/tvlv.c
net/batman-adv/types.h