Subject: Re: [PATCH 5.15.y] batman-adv: hold claim backbone gateways by reference

From: Sven Eckelmann <[email-masked]>
Date: Thu, 30 Apr 2026 09:38:05 +0200

On Thursday, 30 April 2026 09:16:45 CEST Robert Garcia wrote:
> From: Haoze Xie <[email-masked]>
> 
> [ Upstream commit 82d8701b2c930d0e96b0dbc9115a218d791cb0d2 ]
> 
> batadv_bla_add_claim() can replace claim->backbone_gw and drop the old
> gateway's last reference while readers still follow the pointer.
> 
> The netlink claim dump path dereferences claim->backbone_gw->orig and
> takes claim->backbone_gw->crc_lock without pinning the underlying
> backbone gateway. batadv_bla_check_claim() still has the same naked
> pointer access pattern.
> 
> Reuse batadv_bla_claim_get_backbone_gw() in both readers so they operate
> on a stable gateway reference until the read-side work is complete.
> This keeps the dump and claim-check paths aligned with the lifetime
> rules introduced for the other BLA claim readers.
> 
> Fixes: 23721387c409 ("batman-adv: add basic bridge loop avoidance code")
> Fixes: 04f3f5bf1883 ("batman-adv: add B.A.T.M.A.N. Dump BLA claims via netlink")
> Cc: [email-masked]
> Reported-by: Yifan Wu <[email-masked]>
> Reported-by: Juefei Pu <[email-masked]>
> Co-developed-by: Yuan Tan <[email-masked]>
> Signed-off-by: Yuan Tan <[email-masked]>
> Suggested-by: Xin Liu <[email-masked]>
> Signed-off-by: Haoze Xie <[email-masked]>
> Signed-off-by: Ao Zhou <[email-masked]>
> Signed-off-by: Sven Eckelmann <[email-masked]>
> Signed-off-by: Simon Wunderlich <[email-masked]>
> Signed-off-by: Robert Garcia <[email-masked]>

See https://lore.kernel.org/r/[email-masked] for 
the original backport. Can you explain further why you send a new version?

Sasha Levin <[email-masked]> picked it up for 5.15.y (on Sun, 19 Apr 2026 
21:13:58 -0400, MsgId [email-masked]). 
Yes, it was not yet published or 5.15 - so maybe fell through the cracks.

Regards,
	Sven