Re: [PATCH net v3 2/2] bonding: don't let an 802.3ad slave change its type

From: Nikolay Aleksandrov

Date: Mon Nov 23 2026 - 07:46:41 EST


On 23/11/2026 14:43, Nikolay Aleksandrov wrote:
On 23/11/2026 06:29, Kyuwon Cho wrote:
On Mon, Nov 23, 2026 at 11:25:37AM +0800, Hangbin Liu wrote:
Hmm, I personally prefer the approach used by vlan and team, which disallows
changing the slave type after enslavement. If you think we should only disable
the 802.3ad-specific part, this change should be merged with patch 1, as they
address the same issue.

For net I would keep it to 802.3ad, where the type change leads to the
out-of-bounds read, and merge it into patch 1 as you suggest. Refusing
the type change in every mode would also make the enslave of the nlmon
device in bond-eth-type-change.sh fail. The test would still pass, as
it does not check that enslave, but it would no longer change the type
it is there to test, so that change seems better made in net-next.

Nikolay, would you rather have the general check?

I will send v4 with the two patches merged once this is settled.

Thanks,
Kyuwon Cho

Since this requires purposefully breaking the bond with CAP_NET_ADMIN,
I'd go for net-next. About the general check - unfortunately I don't
think we can do it at all due to one, rather weird, use case that comes
to mind - nested bonds. There are setups which use bonds of bonds and that
will put ordering on the setup, potentially could break scripts.

Cheers,
 Nik

On a second thought - the bond is ARPHRD device by default, so nested bond
would affect only non-ARPHRD setups, I'm not sure if there are any such setups.
Just saying, it could be a path to stopping all type changes after enslave. :)