🇰🇷 한글 설명
Linux 커널의 vhost_iotlb 구성 요소에서 IOTLB 테이블의 한계치 도달 시 엔트리 교체(retire) 로직이 제대로 작동하지 않는 취약점입니다. 이로 인해 비-교체형 테이블이 설정된 한계를 초과하여 계속 엔트리를 할당할 수 있으며, 이는 메모리 자원 관리 문제나 할당 오류를 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터의 가상 메모리 관리 도구가 정해진 저장 공간을 초과해서 계속 데이터를 쌓으려고 시도하는 문제입니다. 이로 인해 시스템의 메모리 관리 체계에 혼란이 생기거나 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
vhost_iotlb: bound map allocation in add_range
vhost_iotlb_add_range_ctx() only retires an old entry when the table
has a non-zero limit, has exactly reached that limit and has
VHOST_IOTLB_FLAG_RETIRE set. Non-retiring tables can keep allocating
entries after reaching their configured limit.
Existing vhost devices allocate their IOTLB with max_iotlb_entries from
vhost.c, which defaults to 2048 and is tunable by module parameter. Use
the caller-provided limit at the allocation point instead of adding a
separate default in the common IOTLB helper, and reject non-positive
values in vhost paths that can report an error.
Other vhost IOTLB users should not create zero-limit tables when entries
can be populated from userspace or guest-controlled requests. Add
caller-side max_iotlb_entries parameters for mlx5 vDPA, VDUSE and
vhost-vDPA. Reject non-positive VDUSE and vhost-vDPA values, and require
at least two entries for vdpa_sim and mlx5 vDPA paths that install
full-range mappings, since those mappings are split into two IOTLB
entries.
Handle full-range mappings in the common helper by checking that the
IOTLB can hold both split entries before inserting the first half. This
avoids returning an error after leaving a half mapping behind.
When the table is full, keep the existing retire behavior for retiring
tables and return -ENOSPC for non-retiring tables. Reuse the retired map
node instead of freeing it and allocating a replacement, so a stream of
IOTLB updates cannot keep forcing GFP_ATOMIC allocations after the table
has reached its limit. If a zero-limit IOTLB still reaches the common
helper, treat it as a configuration error and return -EINVAL.
I found this bug myself, though the patch was written with AI assistance.
📍 영향받는 시스템
Linux Kernel (vhost_iotlb 관련 모듈 사용 시스템)
⚔️ 공격 벡터
사용자 공간(Userspace) 또는 게스트(Guest) 제어 요청을 통해 IOTLB 엔트리를 지속적으로 생성하여 메모리 할당 오류 유도
🛡️ 대응 방법
vhost_iotlb 관련 패치가 적용된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인