mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:24:31 +01:00
bond_option_mode_set() already rejects mode changes that would make a loaded XDP program incompatible via bond_xdp_check(). However, bond_option_xmit_hash_policy_set() has no such guard. For 802.3ad and balance-xor modes, bond_xdp_check() returns false when xmit_hash_policy is vlan+srcmac, because the 802.1q payload is usually absent due to hardware offload. This means a user can: 1. Attach a native XDP program to a bond in 802.3ad/balance-xor mode with a compatible xmit_hash_policy (e.g. layer2+3). 2. Change xmit_hash_policy to vlan+srcmac while XDP remains loaded. This leaves bond->xdp_prog set but bond_xdp_check() now returning false for the same device. When the bond is later destroyed, dev_xdp_uninstall() calls bond_xdp_set(dev, NULL, NULL) to remove the program, which hits the bond_xdp_check() guard and returns -EOPNOTSUPP, triggering: WARN_ON(dev_xdp_install(dev, mode, bpf_op, NULL, 0, NULL)) Fix this by rejecting xmit_hash_policy changes to vlan+srcmac when an XDP program is loaded on a bond in 802.3ad or balance-xor mode. commit |
||
|---|---|---|
| .. | ||
| bond_3ad.c | ||
| bond_alb.c | ||
| bond_debugfs.c | ||
| bond_main.c | ||
| bond_netlink.c | ||
| bond_options.c | ||
| bond_procfs.c | ||
| bond_sysfs.c | ||
| bond_sysfs_slave.c | ||
| bonding_priv.h | ||
| Makefile | ||