From: "Linus Lüssing" <linus.luessing@c0d3.blue>
To: Sven Eckelmann <sven@narfation.org>
Cc: b.a.t.m.a.n@lists.open-mesh.org,
syzbot+881d65229ca4f9ae8c84@syzkaller.appspotmail.com,
Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Subject: Re: [PATCH] batman-adv: Release references to inactive interfaces
Date: Tue, 13 Oct 2026 12:55:45 +0200 [thread overview]
Message-ID: <as4OMcL-nlD-mRIv@sellars> (raw)
In-Reply-To: <20250927-netlink-free-inactive-if-v1-1-8f109d2104f7@narfation.org>
On Sat, Sep 27, 2025 at 08:01:29PM +0200, 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: syzbot+881d65229ca4f9ae8c84@syzkaller.appspotmail.com
> Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
(Not that it'd really matter a year later, after merging, but just
for the record:)
Acked-by: Linus Lüssing <linus.luessing@c0d3.blue>
prev parent reply other threads:[~2026-10-13 10:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-27 18:01 [PATCH] batman-adv: Release references to inactive interfaces Sven Eckelmann
2025-10-17 11:18 ` Tetsuo Handa
2025-10-17 14:02 ` Sven Eckelmann
2026-10-13 10:55 ` Linus Lüssing [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=as4OMcL-nlD-mRIv@sellars \
--to=linus.luessing@c0d3.blue \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=sven@narfation.org \
--cc=syzbot+881d65229ca4f9ae8c84@syzkaller.appspotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox