[PATCH batadv 0/8] batman-adv: follow up fixes

Sven Eckelmann posted 8 patches 1 month, 1 week ago
net/batman-adv/bridge_loop_avoidance.c | 10 ++++++-
net/batman-adv/tp_meter.c              |  5 +++-
net/batman-adv/translation-table.c     | 55 +++++++++++++++++++++++++++-------
net/batman-adv/types.h                 |  2 +-
4 files changed, 58 insertions(+), 14 deletions(-)
[PATCH batadv 0/8] batman-adv: follow up fixes
Posted by Sven Eckelmann 1 month, 1 week ago
While reviewing the fixes submitted to batman-adv in the recent weeks,
further problems in similar or adjecent code was identified. This was either
noticed in the manual review or reported by sashiko.dev.

Especially in the TT code, you have the global and the local translation
table. But when a bug was fixed, often only one of the two codepaths was
fixed. It was now tried to sync the TVLV preparation code between to of
them - not style wise but fixes wise. Besides the hardening, it will also
make the code less confusing.

The BLA and TP fixes are just some reference counting fixes - either
reference leak fixes or missing reference handling.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
Sven Eckelmann (8):
      batman-adv: tp_meter: fix tp_num leak on kmalloc failure
      batman-adv: bla: prevent use-after-free when deleting claims
      batman-adv: bla: only purge non-released claims
      batman-adv: tt: fix negative tt_buff_len
      batman-adv: tt: reject oversized local TVLV buffers
      batman-adv: tt: fix TOCTOU race for reported vlans
      batman-adv: tt: avoid empty VLAN responses
      batman-adv: tt: prevent TVLV entry number overflow

 net/batman-adv/bridge_loop_avoidance.c | 10 ++++++-
 net/batman-adv/tp_meter.c              |  5 +++-
 net/batman-adv/translation-table.c     | 55 +++++++++++++++++++++++++++-------
 net/batman-adv/types.h                 |  2 +-
 4 files changed, 58 insertions(+), 14 deletions(-)
---
base-commit: 3d3cf6a7314aca4df0a6dde28ce784a2a30d0166
change-id: 20260503-fixes-followup-064092b7ff55

Best regards,
--  
Sven Eckelmann <sven@narfation.org>
Re: [PATCH batadv 0/8] batman-adv: follow up fixes
Posted by Jakub Kicinski 1 month, 1 week ago
On Sun, 03 May 2026 14:22:33 +0200 Sven Eckelmann wrote:
> While reviewing the fixes submitted to batman-adv in the recent weeks,
> further problems in similar or adjecent code was identified. This was either
> noticed in the manual review or reported by sashiko.dev.

Are you CCing netdev to get this reviewed by Sashiko?
Please don't..
We delegate code to sub-sub-systems to lower the patch volume :(
Re: [PATCH batadv 0/8] batman-adv: follow up fixes
Posted by Sven Eckelmann 1 month, 1 week ago
On Tuesday, 5 May 2026 02:10:51 CEST Jakub Kicinski wrote:
> On Sun, 03 May 2026 14:22:33 +0200 Sven Eckelmann wrote:
> > While reviewing the fixes submitted to batman-adv in the recent weeks,
> > further problems in similar or adjecent code was identified. This was either
> > noticed in the manual review or reported by sashiko.dev.
> 
> Are you CCing netdev to get this reviewed by Sashiko?
> Please don't..
> We delegate code to sub-sub-systems to lower the patch volume :(
> 

Because of `b4 prep --auto-to-cc`. Will now manually remove you.

Regards,
	Sven
Re: [PATCH batadv 0/8] batman-adv: follow up fixes
Posted by Jakub Kicinski 1 month, 1 week ago
On Tue, 05 May 2026 06:46:11 +0200 Sven Eckelmann wrote:
> On Tuesday, 5 May 2026 02:10:51 CEST Jakub Kicinski wrote:
> > On Sun, 03 May 2026 14:22:33 +0200 Sven Eckelmann wrote:  
> > > While reviewing the fixes submitted to batman-adv in the recent weeks,
> > > further problems in similar or adjecent code was identified. This was either
> > > noticed in the manual review or reported by sashiko.dev.  
> > 
> > Are you CCing netdev to get this reviewed by Sashiko?
> > Please don't..
> > We delegate code to sub-sub-systems to lower the patch volume :(
> 
> Because of `b4 prep --auto-to-cc`. Will now manually remove you.

Ah, I see. I was asking because I don't recall us getting much batadv
patches CCed to netdev. Maybe it's simply because there wasn't that
many of them to begin with.

If the rate keeps up let's add an X: to MAINTAINERS to avoid
netdev@ being CCed. IDK if that's what X is supposed to be used for 
but we use it for wireless and bluetooth already. The PRs still
flow thru networking tree, but there's no need for netdev to be CCed
on 99% of the patch submissions.
Re: [PATCH batadv 0/8] batman-adv: follow up fixes
Posted by Sven Eckelmann 1 month, 1 week ago
On Wednesday, 6 May 2026 02:20:17 CEST Jakub Kicinski wrote:
> Ah, I see. I was asking because I don't recall us getting much batadv
> patches CCed to netdev. Maybe it's simply because there wasn't that
> many of them to begin with.
> 
> If the rate keeps up let's add an X: to MAINTAINERS to avoid
> netdev@ being CCed. IDK if that's what X is supposed to be used for 
> but we use it for wireless and bluetooth already. The PRs still
> flow thru networking tree, but there's no need for netdev to be CCed
> on 99% of the patch submissions.
> 

Thanks for the hint, queued up a patch:

$ ./scripts/get_maintainer.pl -f net/batman-adv/*
Marek Lindner <marek.lindner@mailbox.org> (maintainer:BATMAN ADVANCED)
Simon Wunderlich <sw@simonwunderlich.de> (maintainer:BATMAN ADVANCED)
Antonio Quartulli <antonio@mandelbit.com> (maintainer:BATMAN ADVANCED)
Sven Eckelmann <sven@narfation.org> (maintainer:BATMAN ADVANCED)
b.a.t.m.a.n@lists.open-mesh.org (moderated list:BATMAN ADVANCED)
linux-kernel@vger.kernel.org (open list)


$ ./scripts/get_maintainer.pl -f Documentation/networking/batman-adv.rst
Marek Lindner <marek.lindner@mailbox.org> (maintainer:BATMAN ADVANCED)
Simon Wunderlich <sw@simonwunderlich.de> (maintainer:BATMAN ADVANCED)
Antonio Quartulli <antonio@mandelbit.com> (maintainer:BATMAN ADVANCED)
Sven Eckelmann <sven@narfation.org> (maintainer:BATMAN ADVANCED)
Jonathan Corbet <corbet@lwn.net> (maintainer:DOCUMENTATION)
Shuah Khan <skhan@linuxfoundation.org> (reviewer:DOCUMENTATION)
b.a.t.m.a.n@lists.open-mesh.org (moderated list:BATMAN ADVANCED)
linux-doc@vger.kernel.org (open list:DOCUMENTATION)
linux-kernel@vger.kernel.org (open list)

$ ./scripts/get_maintainer.pl -f include/uapi/linux/batadv_packet.h include/uapi/linux/batman_adv.h
Marek Lindner <marek.lindner@mailbox.org> (maintainer:BATMAN ADVANCED)
Simon Wunderlich <sw@simonwunderlich.de> (maintainer:BATMAN ADVANCED)
Antonio Quartulli <antonio@mandelbit.com> (maintainer:BATMAN ADVANCED)
Sven Eckelmann <sven@narfation.org> (maintainer:BATMAN ADVANCED)
b.a.t.m.a.n@lists.open-mesh.org (moderated list:BATMAN ADVANCED)
linux-kernel@vger.kernel.org (open list)


@Yuan: Thanks for updating your internal rules. But the main problem (more 
patches send to netdev) was caused by my oversight. Btw. thanks for all your 
contributions.

Regards,
	Sven
Re: [PATCH batadv 0/8] batman-adv: follow up fixes
Posted by Sven Eckelmann 1 month, 1 week ago
On Tuesday, 5 May 2026 06:46:11 CEST Sven Eckelmann wrote:
> On Tuesday, 5 May 2026 02:10:51 CEST Jakub Kicinski wrote:
> > On Sun, 03 May 2026 14:22:33 +0200 Sven Eckelmann wrote:
> > > While reviewing the fixes submitted to batman-adv in the recent weeks,
> > > further problems in similar or adjecent code was identified. This was either
> > > noticed in the manual review or reported by sashiko.dev.
> > 
> > Are you CCing netdev to get this reviewed by Sashiko?
> > Please don't..
> > We delegate code to sub-sub-systems to lower the patch volume :(
> > 
> 
> Because of `b4 prep --auto-to-cc`. Will now manually remove you.

To speed up the discussion: @Konstantin, is there a way in b4 to say "stop at 
the sub-sub-systems" when doing `b4 prep --auto-to-cc`? I am just trying to get the 
`b4` workflow somehow working with the netdev requirements.

Regards,
	Sven
Re: [PATCH batadv 0/8] batman-adv: follow up fixes
Posted by Matthieu Baerts 1 month, 1 week ago
Hi Sven,

05 May 2026 07:00:27 Sven Eckelmann <sven@narfation.org>:

> On Tuesday, 5 May 2026 06:46:11 CEST Sven Eckelmann wrote:
>> On Tuesday, 5 May 2026 02:10:51 CEST Jakub Kicinski wrote:
>>> On Sun, 03 May 2026 14:22:33 +0200 Sven Eckelmann wrote:
>>>> While reviewing the fixes submitted to batman-adv in the recent weeks,
>>>> further problems in similar or adjecent code was identified. This was either
>>>> noticed in the manual review or reported by sashiko.dev.
>>>
>>> Are you CCing netdev to get this reviewed by Sashiko?
>>> Please don't..
>>> We delegate code to sub-sub-systems to lower the patch volume :(
>>>
>>
>> Because of `b4 prep --auto-to-cc`. Will now manually remove you.
>
> To speed up the discussion: @Konstantin, is there a way in b4 to say "stop at
> the sub-sub-systems" when doing `b4 prep --auto-to-cc`? I am just trying to get the
> `b4` workflow somehow working with the netdev requirements.

Maybe a new option could be added, but that seems difficult to guess
where to stop, and to which subsystems to apply this.

Can you not simply omit using `b4 prep --auto-to-cc` when working
with "internal" patches?

On my side, that's what I'm doing. I added a .b4-config file with this
content, not to have to specify --set-prefix nor --to:

[b4]
    send-series-to = MPTCP Linux <mptcp@lists.linux.dev>
    prep-pre-flight-checks = disable-needs-auto-to-cc
    send-prefixes = mptcp-next

Cheers,
Matt
Re: [PATCH batadv 0/8] batman-adv: follow up fixes
Posted by Sven Eckelmann 1 month, 1 week ago
On Tuesday, 5 May 2026 07:21:13 CEST Matthieu Baerts wrote:
[...]
> >>> Are you CCing netdev to get this reviewed by Sashiko?
> >>> Please don't..
> >>> We delegate code to sub-sub-systems to lower the patch volume :(
> >>>
> >>
> >> Because of `b4 prep --auto-to-cc`. Will now manually remove you.
> >
> > To speed up the discussion: @Konstantin, is there a way in b4 to say "stop at
> > the sub-sub-systems" when doing `b4 prep --auto-to-cc`? I am just trying to get the
> > `b4` workflow somehow working with the netdev requirements.
> 
> Maybe a new option could be added, but that seems difficult to guess
> where to stop, and to which subsystems to apply this.
> 
> Can you not simply omit using `b4 prep --auto-to-cc` when working
> with "internal" patches?

Yes, no, maybe :)
I will for the moment ignore the .b4-config part and talk about it at the end 
of the mail.

b4 is trying to (afaik) to have a good common work flow for kernel related 
projects (and more). Independent of my role (if I am the maintainer or just 
another contributor), it will nag before a send: "Hey, please run 
--auto-to-cc, --check, --check-deps before you submit this patch(set) - you 
know how embarrassing it is when you notice some obvious problem 2 seconds 
after the SMTP server accepted your mail."

And I agree with this and also try to convince people to try b4 because I 
think it is really helpful. Or at least ask them to use
`./scripts/get_maintainer.pl` and NOT send patches with the prefix "net" or 
"net-next" when it actually targets our tree. But as it turns out, these 
recommendation seem to have been wrong and I am sorry about this.

And I know, b4 is a good tool but adding a bazillion options just for every 
special case doesn't make a lot of sense and might make it a worse tool. I was 
therefore more thinking about `scripts/get_maintainer.pl`  (see `b4.send-auto-
cc-cmd`) which also called by b4 with various options to avoid adding too many 
people.

I don't say that any of these tools need to change. I am guessing more that I 
have to adjust something (MAINTAINERS, ...) to avoid that people are sending 
batman-adv sub-sub-system patches directly to netdev. I am just not aware of 
what this should be. But it sounds to me like there is at least a need for it 
(from the netdev maintainers perspective).

> On my side, that's what I'm doing. I added a .b4-config file with this
> content, not to have to specify --set-prefix nor --to:

Regarding the .b4-config - yes, this is helpful and I should add it to 
batctl.git. I was more thinking about the normal contributor to 
net/batman-adv/. Regardless of this person taking as base net/net-next.git or 
our repo.

The fixes from Ren Wei (and associates) and some other people were sent with 
"net" in the prefix, were Cc'ing netdev and didn't seem to use our tree as 
base. This is of course not correct and they should have targeted our tree 
instead. I didn't complain because the fix was otherwise extremely helpful and 
I though that there was no harm done. As it looks now, I should have and I am 
sorry for not communicating this.

And I am at the moment not sure how to fix this without overloading 
contributers with "when you are contributing to some sub-subsystem of netdev 
..., but when you are contributing to ext4, other rules apply .... don't 
forget about i2c rules for patch submission, ...".

But maybe I am just ignorant and this is already quite simple (and there are 
no special "netdev" rules) - I am just not aware of it. In this case, please 
point me in the right direction, just to avoid reproducing wrong 
recommendations to other people.

Regards,
	Sven
Re: [PATCH batadv 0/8] batman-adv: follow up fixes
Posted by Yuan Tan 1 month, 1 week ago
On Tue, May 5, 2026 at 12:20 AM Sven Eckelmann <sven@narfation.org> wrote:
>
> On Tuesday, 5 May 2026 07:21:13 CEST Matthieu Baerts wrote:
> [...]
> > >>> Are you CCing netdev to get this reviewed by Sashiko?
> > >>> Please don't..
> > >>> We delegate code to sub-sub-systems to lower the patch volume :(
> > >>>
> > >>
> > >> Because of `b4 prep --auto-to-cc`. Will now manually remove you.
> > >
> > > To speed up the discussion: @Konstantin, is there a way in b4 to say "stop at
> > > the sub-sub-systems" when doing `b4 prep --auto-to-cc`? I am just trying to get the
> > > `b4` workflow somehow working with the netdev requirements.
> >
> > Maybe a new option could be added, but that seems difficult to guess
> > where to stop, and to which subsystems to apply this.
> >
> > Can you not simply omit using `b4 prep --auto-to-cc` when working
> > with "internal" patches?
>
> Yes, no, maybe :)
> I will for the moment ignore the .b4-config part and talk about it at the end
> of the mail.
>
> b4 is trying to (afaik) to have a good common work flow for kernel related
> projects (and more). Independent of my role (if I am the maintainer or just
> another contributor), it will nag before a send: "Hey, please run
> --auto-to-cc, --check, --check-deps before you submit this patch(set) - you
> know how embarrassing it is when you notice some obvious problem 2 seconds
> after the SMTP server accepted your mail."
>
> And I agree with this and also try to convince people to try b4 because I
> think it is really helpful. Or at least ask them to use
> `./scripts/get_maintainer.pl` and NOT send patches with the prefix "net" or
> "net-next" when it actually targets our tree. But as it turns out, these
> recommendation seem to have been wrong and I am sorry about this.
>
> And I know, b4 is a good tool but adding a bazillion options just for every
> special case doesn't make a lot of sense and might make it a worse tool. I was
> therefore more thinking about `scripts/get_maintainer.pl`  (see `b4.send-auto-
> cc-cmd`) which also called by b4 with various options to avoid adding too many
> people.
>
> I don't say that any of these tools need to change. I am guessing more that I
> have to adjust something (MAINTAINERS, ...) to avoid that people are sending
> batman-adv sub-sub-system patches directly to netdev. I am just not aware of
> what this should be. But it sounds to me like there is at least a need for it
> (from the netdev maintainers perspective).
>
> > On my side, that's what I'm doing. I added a .b4-config file with this
> > content, not to have to specify --set-prefix nor --to:
>
> Regarding the .b4-config - yes, this is helpful and I should add it to
> batctl.git. I was more thinking about the normal contributor to
> net/batman-adv/. Regardless of this person taking as base net/net-next.git or
> our repo.
>
> The fixes from Ren Wei (and associates) and some other people were sent with
> "net" in the prefix, were Cc'ing netdev and didn't seem to use our tree as
> base. This is of course not correct and they should have targeted our tree
> instead. I didn't complain because the fix was otherwise extremely helpful and
> I though that there was no harm done. As it looks now, I should have and I am
> sorry for not communicating this.
>
> And I am at the moment not sure how to fix this without overloading
> contributers with "when you are contributing to some sub-subsystem of netdev
> ..., but when you are contributing to ext4, other rules apply .... don't
> forget about i2c rules for patch submission, ...".
>
> But maybe I am just ignorant and this is already quite simple (and there are
> no special "netdev" rules) - I am just not aware of it. In this case, please
> point me in the right direction, just to avoid reproducing wrong
> recommendations to other people.
>
> Regards,
>         Sven

Hi Sven,

I apologize for the inconvenience this caused. This was my oversight;
I’m embarrassed to admit that I was unaware that batman-adv used its
own maintenance tree and had instructed my team to follow the standard
netdev process.

It is our responsibility as contributors to carefully follow rules. I
will update our internal guides immediately to ensure our future
patches adhere to the correct workflow.

Best,
Yuan