🇰🇷 한글 설명
Linux 커널 bonding 모듈에서 XDP 프로그램이 로드된 상태에서 xmit_hash_policy를 vlan+srcmac으로 변경할 수 있는 취약점입니다. 802.3ad/balance-xor 모드에서 호환성 검사가 누락되어 있어 bond 제거 시 경고가 발생합니다.
💡 쉬운 설명
리눅스 시스템의 네트워크 본딩 기능에서 보안 검사가 빠져있는 문제입니다. 시스템이 불안정해질 수 있지만 원격으로 직접 악용하기는 어렵습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
bpf/bonding: reject vlan+srcmac xmit_hash_policy change when XDP is loaded
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 39a0876d595b ("net, bonding: Disallow vlan+srcmac with XDP")
introduced bond_xdp_check() which returns false for 802.3ad/balance-xor
modes when xmit_hash_policy is vlan+srcmac. The check was wired into
bond_xdp_set() to reject XDP attachment with an incompatible policy, but
the symmetric path -- preventing xmit_hash_policy from being changed to an
incompatible value after XDP is already loaded -- was left unguarded in
bond_option_xmit_hash_policy_set().
Note:
commit 094ee6017ea0 ("bonding: check xdp prog when set bond mode")
later added a similar guard to bond_option_mode_set(), but
bond_option_xmit_hash_policy_set() remained unprotected.
📍 영향받는 시스템
Linux kernel 5.10+의 bonding 모듈 (802.3ad, balance-xor 모드)
⚔️ 공격 벡터
로컬 사용자가 XDP 프로그램이 로드된 본딩 인터페이스에서 xmit_hash_policy를 변경하여 트리거
🛡️ 대응 방법
Linux kernel을 최신 버전으로 업데이트하거나 bond_option_xmit_hash_policy_set()에 bond_xdp_check() 가드 추가
🔧 검증 코드
현재 커널 버전 확인. 취약 버전이면 업데이트 권고, 최신 버전이면 패치 적용 확인
uname -r | grep -E '^[0-9]+\.[0-9]+' && cat /proc/version