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

From: Hangbin Liu

Date: Thu Sep 03 2026 - 21:41:03 EST


On Thu, Sep 03, 2026 at 02:53:29PM +0300, Nikolay Aleksandrov wrote:
> > 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
> >
> > -
> > https://netdev.bots.linux.dev/branch_deltas/net-next-2026-09-03--09-00.html
> >
> > e.g.
> >
> >
> > https://lore.kernel.org/netdev/20260903-bond_slave_cnt-v2-1-02e27304ca36@xxxxxxxxxx/raw
> >
> > Cheers,
> > Matt
>
> Waaait a second, it is moved after slave arr update, yes that would cause those.
> I missed it in the review, in my suggestion I specifically said it must be before
> the slave array update because it uses slave_cnt.
>
> It must be moved up. :)
>

Ah, I thought all the code between netdev_ops->ndo_bpf and
bond_xdp_set_features() are xdp stuff and missed the bond_update_slave_arr()
in the middle...

I need more careful when go though the code and do testing even with simplest
change.

Thanks
Hangbin