]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
batman-adv: v: stop OGMv2 on disabled interface
authorSven Eckelmann <sven@narfation.org>
Sat, 9 May 2026 20:44:12 +0000 (22:44 +0200)
committerSven Eckelmann <sven@narfation.org>
Tue, 19 May 2026 06:14:53 +0000 (08:14 +0200)
commitf8ce8b8331a1bc44ad4905886a482214d428b253
tree9e603e07feedf790f1837b50a8ff928356e5892b
parent0039ac8305064e455f04d412ec3896c4fe41d04f
batman-adv: v: stop OGMv2 on disabled interface

When a batadv_hard_iface is disabled, its mesh_iface pointer is set to
NULL. However, batadv_v_ogm_send_meshif() may still dispatch OGMs via
batadv_v_ogm_queue_on_if() for interfaces that have since lost their
mesh_iface association. This results in a NULL pointer dereference when
batadv_v_ogm_queue_on_if() unconditionally calls netdev_priv() on the
now NULL hard_iface->mesh_iface to retrieve the batadv_priv.

It is necessary to ensure that the batadv_v_ogm_queue_on_if() checks that
it is using the same mesh_iface for which batadv_v_ogm_send_meshif() was
called.

Cc: stable@kernel.org
Fixes: 0da0035942d4 ("batman-adv: OGMv2 - add basic infrastructure")
Reported-by: Yuan Tan <yuantan098@gmail.com>
Reported-by: Yifan Wu <yifanwucs@gmail.com>
Reported-by: Juefei Pu <tomapufckgml@gmail.com>
Reported-by: Xin Liu <bird@lzu.edu.cn>
Reviewed-by: Yuan Tan <yuantan098@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/bat_v_ogm.c