Re: [PATCH] batman-adv: Release references to inactive interfaces
Sven Eckelmann <[email protected]>
| Newsgroups | org.open-mesh.lists.batman |
|---|---|
| Message-ID | <2676395.Lt9SDvczpP@ripper> |
On Friday, 17 October 2025 13:18:20 CEST Tetsuo Handa wrote:
> Is this patch recognized?
Who should recognize the patch?
https://git.open-mesh.org/linux-merge.git/commit/?id=f12b69d8f22824a07f17c1399c99757072de73e0
Regards,
Sven
>
> On 2025/09/28 3:01, Sven Eckelmann wrote:
> > Trying to dump the originators or the neighbors via netlink for a meshif
> > with an inactive primary interface is not allowed. The dump functions were
> > checking this correctly but they didn't handle non-existing primary
> > interfaces and existing _inactive_ interfaces differently.
> >
> > (Primary) batadv_hard_ifaces hold a references to a net_device. And
> > accessing them is only allowed when either being in a RCU/spinlock
> > protected section or when holding a valid reference to them. The netlink
> > dump functions use the latter.
> >
> > But because the missing specific error handling for inactive primary
> > interfaces, the reference was never dropped. This reference counting error
> > was only detected when the interface should have been removed from the
> > system:
> >
> > unregister_netdevice: waiting for batadv_slave_0 to become free. Usage count = 2
> >
> > Fixes: 50eddf397ac3 ("batman-adv: netlink: reduce duplicate code by returning interfaces")
> > Reported-by: [email protected]
> > Reported-by: Tetsuo Handa <[email protected]>
> > Signed-off-by: Sven Eckelmann <[email protected]>
> > ---
> > net/batman-adv/originator.c | 14 ++++++++++++--
> > 1 file changed, 12 insertions(+), 2 deletions(-)
>
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQS81G/PswftH/OW8cVND3cr0xT1ywUCaPJMkwAKCRBND3cr0xT1 yyitAP4gMXfqTZgm6OPV8sKc8rPXMi45KLCaADNJ8R+UzHXY0wD9Hp4th4Hof3db iMVyffunntjcUVGGDe/f0/CTHEi/4w4= =ODDU -----END PGP SIGNATURE-----