🇰🇷 한글 설명
Linux 커널의 virtio_vsock 구성 요소에서 작업 항목 간의 의존성을 고려하지 않은 플러시 순서로 인해 Use-After-Free 취약점이 발생합니다. tx_work나 send_pkt_work가 rx_work를 큐에 추가할 수 있는데, 순서가 잘못되면 rx_work가 실행되기 전에 메모리가 해제되어 시스템 충돌이나 보안 문제가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터 내부의 통신 작업들이 순서대로 정리되지 않아, 이미 삭제된 메모리 영역을 다시 사용하려고 시도하면서 발생하는 오류입니다. 이로 인해 시스템이 갑자기 멈추거나 예상치 못한 동작을 할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
vsock/virtio: flush works in dependency order
virtio_vsock_remove() stops the virtqueues and then flushes each work
item before freeing the enclosing virtio_vsock. The current order does
not account for dependencies between those items: tx_work may queue
send_pkt_work, and send_pkt_work may queue rx_work.
In particular, send_pkt_work can set restart_rx and release tx_lock.
The remove path can then stop the queues and flush rx_work before
send_pkt_work queues it. Although the later send_pkt_work flush waits
for that producer to finish, nothing waits for the newly queued rx_work,
so kfree(vsock) can race with it.
KASAN reported:
BUG: KASAN: slab-use-after-free in
virtio_transport_rx_work+0x487/0x4b0
Read of size 8 at addr ffff888114c2b008 by task kworker/1:1/47
Workqueue: virtio_vsock virtio_transport_rx_work
Call Trace:
virtio_transport_rx_work+0x487/0x4b0
process_one_work+0x688/0x1120
worker_thread+0x45b/0xd10
Allocated by task 1:
virtio_vsock_probe+0xef/0x6b0
Freed by task 84:
kfree+0x131/0x3c0
virtio_vsock_remove+0xd1/0x100
Flush the works in producer-to-consumer order. virtio_vsock_vqs_del()
has already disabled the queue callbacks and cleared the run flags, so
after tx_work and send_pkt_work are drained, no source remains that can
queue rx_work after its flush.
📍 영향받는 시스템
Linux kernel (virtio_vsock 모듈을 사용하는 시스템)
⚔️ 공격 벡터
로컬 공격자가 특정 네트워크 통신 시나리오를 유도하여 커널 메모리 오류를 발생시킴
🛡️ 대응 방법
의존성 순서(Producer-to-Consumer)에 따라 작업 항목을 플러시하도록 커널 패치를 적용하거나 최신 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인