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

From: Hangbin Liu

Date: Thu Sep 03 2026 - 22:04:09 EST


On Thu, Sep 03, 2026 at 09:22:58AM -0700, Jakub Kicinski wrote:
> On Thu, 3 Sep 2026 12:38:14 +0200 Matthieu Baerts wrote:
> > On 03/09/2026 10:10, Hangbin Liu wrote:
> > > From: Hangbin Liu <liuhangbin@xxxxxxxxxx>
> > >
> > > When bond_enslave() succeeds up to the XDP setup stage, slave_cnt is
> > > already incremented. If XDP setup subsequently fails, the error paths
> > > jump directly to err_sysfs_del, bypassing the slave_cnt decrement.
> > >
> > > This causes slave_cnt to drift upward on each failed enslaving attempt,
> > > which would lead to unbalanced traffic distribution with round-robin
> > > mode.
> > >
> > > Fix it by moving the slave_cnt increasement after XDP setup.
> > Thank you for the fix, but it looks like it causes multiple KASAN
> > issues, see:
> >
> > - https://netdev.bots.linux.dev/flakes.html?ld-remote=virt-bonding-dbg
>
> Hangbin, this is at least the 3rd time in a week when kernel selftests
> find issues in patches you posted. It's really time for you to run
> these tests locally.

Yes, you are right. I need to setup local NIPA ASAP. And I will not post
patch before run all related tests on debug kernel.

Sincerely sorry for the trouble this has caused you.

Regards
Hangbin