Re: [PATCH] batman-adv: Release references to inactive interfaces

Tetsuo Handa <[email protected]>
Newsgroups org.open-mesh.lists.batman
Message-ID <[email protected]>
Is this patch recognized?

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(-)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.