Thread (3 messages) flat view 3 messages, 2 authors, 5d ago

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

From: Hangbin Liu <hidden>
Date: 2026-09-02 08:26:09
Also in: lkml

On Wed, Sep 02, 2026 at 10:31:41AM +0300, Nikolay Aleksandrov wrote:
On 02/09/2026 08:21, Hangbin Liu wrote:
quoted
From: Hangbin Liu <redacted>

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 and
balance-xor mode.
I don't think it affects balance-xor, it's using usable_slaves->count which is
incremented only for actual usable slaves
Ah, yes. I missed this.
I think we can just move the slave count inc after XDP setup when we can't fail anymore?
I don't see anything using it before the slave array update.
Makes sense to me. I will update the patch.

Thanks
Hangbin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help