🇰🇷 한글 설명
Linux 커널의 memblock_double_array() 함수에서, 슬랩 할당자가 준비되기 전 메모리 배열을 확장할 때 memblock_find_in_range()로 얻은 메모리 범위가 아직 수락(accept)되지 않은 상태로 사용될 수 있다. 이로 인해 AMD SEV-SNP 게스트 부팅 시 커널 크래시가 발생할 수 있으며, 해당 범위에 accept_memory()를 호출하여 문제를 완화한다.
💡 쉬운 설명
리눅스 커널이 부팅 중 메모리를 준비하는 과정에서 아직 사용 허가를 받지 않은 메모리를 쓰려고 해서 문제가 생깁니다. 그 결과 보안 가상머신(SNP 게스트)이 부팅 도중 멈출 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
memblock: Accept allocated memory before use in memblock_double_array()
When increasing the array size in memblock_double_array() and the slab
is not yet available, a call to memblock_find_in_range() is used to
reserve/allocate memory. However, the range returned may not have been
accepted, which can result in a crash when booting an SNP guest:
RIP: 0010:memcpy_orig+0x68/0x130
Code: ...
RSP: 0000:ffffffff9cc03ce8 EFLAGS: 00010006
RAX: ff11001ff83e5000 RBX: 0000000000000000 RCX: fffffffffffff000
RDX: 0000000000000bc0 RSI: ffffffff9dba8860 RDI: ff11001ff83e5c00
RBP: 0000000000002000 R08: 0000000000000000 R09: 0000000000002000
R10: 000000207fffe000 R11: 0000040000000000 R12: ffffffff9d06ef78
R13: ff11001ff83e5000 R14: ffffffff9dba7c60 R15: 0000000000000c00
memblock_double_array+0xff/0x310
memblock_add_range+0x1fb/0x2f0
memblock_reserve+0x4f/0xa0
memblock_alloc_range_nid+0xac/0x130
memblock_alloc_internal+0x53/0xc0
memblock_alloc_try_nid+0x3d/0xa0
swiotlb_init_remap+0x149/0x2f0
mem_init+0xb/0xb0
mm_core_init+0x8f/0x350
start_kernel+0x17e/0x5d0
x86_64_start_reservations+0x14/0x30
x86_64_start_kernel+0x92/0xa0
secondary_startup_64_no_verify+0x194/0x19b
Mitigate this by calling accept_memory() on the memory range returned
before the slab is available.
Prior to v6.12, the accept_memory() interface used a 'start' and 'end'
parameter instead of 'start' and 'size', therefore the accept_memory()
call must be adjusted to specify 'start + size' for 'end' when applying
to kernels prior to v6.12.
📍 영향받는 시스템
AMD SEV-SNP 기반 가상머신에서 동작하는 Linux 커널(수정 적용 전 버전, 특히 v6.12 이전 커널 포함)
⚔️ 공격 벡터
로컬에서 악의적으로 조작된 입력이 필요하지 않으며, 주로 부팅 과정에서 발생하는 안정성(크래시) 결함으로 서비스 거부 형태의 영향이 있다.
🛡️ 대응 방법
배포판이 제공하는 최신 Linux 커널 보안 업데이트를 적용하고 시스템을 재부팅한다.
🔧 검증 코드
출력된 커널 버전을 배포판 보안 공지에서 해당 CVE 수정이 포함된 커널 버전과 비교하여, 같거나 그 이후 패치 버전이면 수정된 것으로 판단한다.