Re: [PATCH net v3] bonding: fix slave_cnt leak on XDP error paths

From: Hangbin Liu

Date: Fri Sep 11 2026 - 04:25:10 EST


On Fri, Sep 11, 2026 at 10:23:26AM +0300, Nikolay Aleksandrov wrote:
> > Oh, hold one. I miss read the comment. It's not about the
> > bond_update_slave_arr() at bond_enslave() we moved to.
> >
> > This is the bond_update_slave_arr() called by bond_uses_primary(), which
> > is before the ndo_bpf ops. We need to either also move the
> > if (bond_uses_primary(bond)) block after bond_update_slave_arr().
> > Or just use my patch v1 version, that add a new err out.
> >
> > Nikolay, what do you think?
> >
> > pw-bot: changes-requested
> >
> > Thanks
> > Hangbin
>
> Oh well, it is becoming too dangerous. I'd go with your v1. That is the safest bet
> that can be easily backported. Sorry for leading you down this path, I missed
> we can still reach the slave arr update via active slave selection.

bond_update_slave_arr() is somewhat hidden, and I also missed it :(

The settings in bond_enslave() are growing increasingly complex and
interdependent. Moving any line around becomes risky.

Thanks
Hangbin