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

From: Jakub Kicinski

Date: Thu Sep 03 2026 - 12:51:08 EST


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.