🇰🇷 한글 설명
리눅스 커널의 vmalloc 메모리 관리 과정에서 vmap_block 구조체가 완전히 초기화되기 전에 큐에 추가되는 취약점입니다. 이로 인해 다른 CPU가 해당 큐를 참조할 때 초기화되지 않은 인덱스를 사용하여 메모리 경계 외 접근(Out-of-bounds access)이 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터의 메모리를 관리하는 목록에 새로운 항목을 적어 넣을 때, 아직 정보가 다 채워지지 않은 상태로 목록에 먼저 올려버리는 실수입니다. 이 때문에 다른 프로세서가 이 목록을 읽으려다 잘못된 위치를 참조하여 시스템 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mm: vmalloc: ensure vmap_block is initialised before adding to queue
Commit 8c61291fd850 ("mm: fix incorrect vbq reference in
purge_fragmented_block") extended the 'vmap_block' structure to contain a
'cpu' field which is set at allocation time to the id of the initialising
CPU.
When a new 'vmap_block' is being instantiated by new_vmap_block(), the
partially initialised structure is added to the local 'vmap_block_queue'
xarray before the 'cpu' field has been initialised. If another CPU is
concurrently walking the xarray (e.g. via vm_unmap_aliases()), then it
may perform an out-of-bounds access to the remote queue thanks to an
uninitialised index.
This has been observed as UBSAN errors in Android:
| Internal error: UBSAN: array index out of bounds: 00000000f2005512 [#1] PREEMPT SMP
|
| Call trace:
| purge_fragmented_block+0x204/0x21c
| _vm_unmap_aliases+0x170/0x378
| vm_unmap_aliases+0x1c/0x28
| change_memory_common+0x1dc/0x26c
| set_memory_ro+0x18/0x24
| module_enable_ro+0x98/0x238
| do_init_module+0x1b0/0x310
Move the initialisation of 'vb->cpu' in new_vmap_block() ahead of the
addition to the xarray.
📍 영향받는 시스템
Linux Kernel (Android 환경에서 UBSAN 오류 보고됨)
⚔️ 공격 벡터
멀티코어 환경에서 동시성(Concurrency)을 이용한 메모리 경계 외 접근 유도
🛡️ 대응 방법
커널 패치(Commit 8c61291fd850)를 적용하여 vmap_block 구조체의 cpu 필드가 큐에 추가되기 전에 먼저 초기화되도록 수정해야 합니다.
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.