Re: [PATCH 5.15.y] batman-adv: hold claim backbone gateways by reference
From: Sven Eckelmann
Date: Thu Apr 30 2026 - 03:38:45 EST
On Thursday, 30 April 2026 09:16:45 CEST Robert Garcia wrote:
> From: Haoze Xie <royenheart@xxxxxxxxx>
>
> [ 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: stable@xxxxxxxxxxxxxxx
> Reported-by: Yifan Wu <yifanwucs@xxxxxxxxx>
> Reported-by: Juefei Pu <tomapufckgml@xxxxxxxxx>
> Co-developed-by: Yuan Tan <yuantan098@xxxxxxxxx>
> Signed-off-by: Yuan Tan <yuantan098@xxxxxxxxx>
> Suggested-by: Xin Liu <bird@xxxxxxxxxx>
> Signed-off-by: Haoze Xie <royenheart@xxxxxxxxx>
> Signed-off-by: Ao Zhou <n05ec@xxxxxxxxxx>
> Signed-off-by: Sven Eckelmann <sven@xxxxxxxxxxxxx>
> Signed-off-by: Simon Wunderlich <sw@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Robert Garcia <rob_garcia@xxxxxxx>
See https://lore.kernel.org/r/20260413125407.85603-1-sven@xxxxxxxxxxxxx for
the original backport. Can you explain further why you send a new version?
Sasha Levin <sashal@xxxxxxxxxx> picked it up for 5.15.y (on Sun, 19 Apr 2026
21:13:58 -0400, MsgId 20260419195610.batman-adv-5.15@xxxxxxxxxx).
Yes, it was not yet published or 5.15 - so maybe fell through the cracks.
Regards,
Sven
Attachment:
signature.asc
Description: This is a digitally signed message part.