🇰🇷 한글 설명
Linux 커널의 gve 드라이버에서 HW-GRO 기능 활성화 시 헤더 버퍼 인덱싱 오류로 인해 데이터 오염이 발생할 수 있는 취약점입니다. 버퍼의 고유 ID가 아닌 큐 위치를 기준으로 헤더를 처리함으로써, 패킷 순서가 뒤섞일 경우 잘못된 헤더를 읽거나 장치가 사용 중인 버퍼를 덮어쓰는 문제가 발생합니다.
💡 쉬운 설명
네트워크 카드가 데이터를 처리할 때 순서가 뒤바뀌면, 엉뚱한 데이터의 머리 부분을 읽거나 아직 사용 중인 메모리를 건드려 데이터가 깨지는 문제입니다. 이로 인해 인터넷 속도가 느려지거나 통신 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
gve: fix header buffer corruption with header-split and HW-GRO
The DQO RX datapath programs a per-buffer-queue-descriptor
header_buf_addr at post time and reads the split header back at
completion time. Both the post and the read currently index the
header buffer by queue position rather than by the buffer's identity:
- post (gve_rx_post_buffers_dqo): header_buf_addr is computed from
bufq->tail
- read (gve_rx_dqo): the header is read from desc_idx (the completion
queue head index)
This relies on the buffer-queue index and the completion-queue index
being equal for the start of every packet, i.e. on the device consuming
posted buffers and returning completions in the exact same order. That
assumption does not hold once HW-GRO is enabled with multiple
flows: coalesced segments are accepted and completed in an order that
may differ from the order buffers were posted, and segments from
different flows may interleave.
That results in two problems:
1. Wrong header slot on read. Because the read offset is derived from
the completion index (desc_idx) while the device wrote the header to
the address programmed for the buffer's buf_id, the driver can copy
a header belonging to a different packet. This shows up as
throughput drop (about 30% drop and large numbers of TCP
retransmissions) with header-split and HW-GRO both enabled and many
streams.
2. Header buffer reused while still owned by the device. The driver
advances bufq->head by one per completion and re-posts buffers based
on that. Arrival of N RX completions only guarantees that at least N
RX buffer descriptors have been read by the device. It does not
guarantee that the device has relinquished the ownership of all the
buffers corresponding to those N descriptors. With out-of-order
completions (e.g. the completion for a packet copied into buffer N
arrives before the completion for a packet copied into buffer N-1),
the driver can re-post and overwrite a header buffer that the device
is still going to write into, corrupting the header of a packet
whose completion has not yet been processed.
Fix both issues by indexing the header buffer by buf_id on both the post
and read paths. Reading from buf_id's slot is therefore always correct
regardless of completion ordering (fixes problem 1).
Indexing by buf_id also ties each header slot to the lifetime of its
buffer state. A buffer state is only returned to the free/recycle lists
when its own completion (buf_id) is processed, so its header slot can
only be re-posted after the device is done with it. This makes header
slot reuse safe under out-of-order completions (fixes problem 2).
Allocate (gve_rx_alloc_hdr_bufs) and free (gve_rx_free_hdr_bufs) the
header buffers based on num_buf_states to match the buf_id indexing.
📍 영향받는 시스템
Linux kernel with gve driver and HW-GRO enabled
⚔️ 공격 벡터
Network traffic manipulation to trigger out-of-order completions (Remote/Network-based)
🛡️ 대응 방법
Linux kernel update to the version containing the gve header buffer indexing fix
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 패치된 최신 버전인지 확인합니다.