🇰🇷 한글 설명
Linux 커널의 virt: sev-guest 구성 요소에서 호스트가 제어하는 페이지 순서를 정리 경로에서 사용할 때 발생하는 취약점입니다. 호스트가 제공한 잘못된 길이 값이 페이지 할당기(page allocator)의 계산에 사용되어 메모리 오염을 유발할 수 있습니다.
💡 쉬운 설명
가상 머신이 호스트로부터 데이터를 받을 때, 호스트가 보낸 잘못된 크기 정보를 믿고 메모리를 정리하다가 시스템 메모리가 망가질 수 있는 문제입니다. 이로 인해 시스템이 불안정해지거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
virt: sev-guest: Do not use host-controlled page order in cleanup path
When issuing an extended guest request (SVM_VMGEXIT_EXT_GUEST_REQUEST),
get_ext_report() allocates a buffer to retrieve a certificate blob from the
host, keeping track of its size in report_req->certs_len.
However, the host may return SNP_GUEST_VMM_ERR_INVALID_LEN, indicating
an invalid buffer size, as well as the expected length of such buffer.
get_ext_report() subsequently updates report_req->certs_len with the
host-controlled value, and cleans up the buffer by computing a page order
from such value. This is incorrect, as the host-provided length may not
match the page order of the original allocation, potentially resulting
in corruption in the page allocator.
Fix this by using alloc_pages_exact() instead, and reusing @npages to
compute the size passed to free_pages_exact(). For consistency, also
use @npages to compute the size when allocating the pages, even though
this last change has no functional effect.
📍 영향받는 시스템
Linux kernel (virt: sev-guest 관련 모듈 사용 시스템)
⚔️ 공격 벡터
악의적인 호스트가 가상 머신에 잘못된 길이 값을 반환하여 메모리 할당기 오염 유도
🛡️ 대응 방법
커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 alloc_pages_exact()를 사용하도록 수정
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인