🇰🇷 한글 설명
Linux 커널의 AF_XDP generic RX 경로에서 레이스 컨디션(경쟁 상태) 취약점이 발견되었습니다. 여러 소켓이 단일 xsk_buff_pool을 공유하는 umem 모드에서, 서로 다른 CPU 코어가 동일한 자원에 동시에 접근할 때 동기화 문제가 발생할 수 있습니다. 이를 해결하기 위해 rx_lock의 위치를 xsk_socket에서 xsk_buff_pool로 이동하여 공유 자원을 보호하도록 수정되었습니다.
💡 쉬운 설명
여러 개의 네트워크 통로가 하나의 메모리 저장소를 같이 사용할 때, 데이터가 엉키지 않도록 관리하는 규칙에 허점이 있었습니다. 이로 인해 서로 다른 작업이 동시에 같은 곳을 건드려 시스템 오류가 발생할 수 있는 문제입니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
xsk: Fix race condition in AF_XDP generic RX path
Move rx_lock from xsk_socket to xsk_buff_pool.
Fix synchronization for shared umem mode in
generic RX path where multiple sockets share
single xsk_buff_pool.
RX queue is exclusive to xsk_socket, while FILL
queue can be shared between multiple sockets.
This could result in race condition where two
CPU cores access RX path of two different sockets
sharing the same umem.
Protect both queues by acquiring spinlock in shared
xsk_buff_pool.
Lock contention may be minimized in the future by some
per-thread FQ buffering.
It's safe and necessary to move spin_lock_bh(rx_lock)
after xsk_rcv_check():
* xs->pool and spinlock_init is synchronized by
xsk_bind() -> xsk_is_bound() memory barriers.
* xsk_rcv_check() may return true at the moment
of xsk_release() or xsk_unbind_dev(),
however this will not cause any data races or
race conditions. xsk_unbind_dev() removes xdp
socket from all maps and waits for completion
of all outstanding rx operations. Packets in
RX path will either complete safely or drop.
📍 영향받는 시스템
AF_XDP를 사용하는 Linux 커널 시스템
⚔️ 공격 벡터
공유된 umem 환경에서 다중 CPU 코어를 이용한 동시 데이터 접근을 통한 레이스 컨디션 유발
🛡️ 대응 방법
AF_XDP 관련 패치가 적용된 최신 Linux 커널 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인합니다.