diff options
| author | Sven Eckelmann <sven@narfation.org> | 2025-09-27 19:39:08 +0200 |
|---|---|---|
| committer | Simon Wunderlich <sw@simonwunderlich.de> | 2025-09-27 19:59:49 +0200 |
| commit | f12b69d8f22824a07f17c1399c99757072de73e0 (patch) | |
| tree | a8fb2135636c7cfadfe0ef3305d56c8f7df93326 /tools/docs/parse-headers.py | |
| parent | d69eb204c255c35abd9e8cb621484e8074c75eaa (diff) | |
batman-adv: Release references to inactive interfaces
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
Cc: stable@vger.kernel.org
Fixes: 6ecc4fd6c2f4 ("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>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'tools/docs/parse-headers.py')
0 files changed, 0 insertions, 0 deletions
