🇰🇷 한글 설명
리눅스 커널의 mm/mempolicy 구성 요소에서 잘못된 컨텍스트 내에 수면(sleeping) 할당이 발생하는 취약점이 발견되었습니다. rhashtable 리해싱 과정 중 RCU 읽기 잠금 상태에서 메모리를 할당할 때, 특정 메모리 정책(MPOL_WEIGHTED_INTERLEAVE)이 적용되어 있으면 원자적(atomic) 컨텍스트임에도 불구하고 커널이 잠들 수 있는 GFP_KERNEL 플래그를 사용하여 시스템 불안정을 초래할 수 있습니다.
💡 쉬운 설명
컴퓨터의 핵심 운영체제인 리눅스에서 아주 바쁜 작업 중에 잠시 멈춰야 하는 명령을 내려 시스템이 엉키거나 멈출 수 있는 오류가 발견되었습니다. 이는 특정 메모리 관리 방식이 사용될 때 발생하며, 시스템의 안정성을 해칠 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mm/mempolicy: fix sleeping allocation in alloc_pages_bulk_weighted_interleave()
syzbot reported a sleeping function called from invalid context splat in
bucket_table_alloc().
When rhashtable_insert_slow() rehashes the table under rcu_read_lock(), it
calls bucket_table_alloc(..., GFP_ATOMIC | __GFP_NOWARN). If the bucket
table allocation uses vmalloc, __vmalloc_node_range_noprof() invokes
vm_area_alloc_pages() -> alloc_pages_bulk_mempolicy_noprof() with the
passed GFP_ATOMIC flags.
If the current task has an MPOL_WEIGHTED_INTERLEAVE mempolicy,
alloc_pages_bulk_weighted_interleave() is called and currently hardcodes
GFP_KERNEL when allocating the temporary weights array, triggering a
might_alloc() splat in atomic/RCU contexts.
Pass the gfp flags (masked with GFP_RECLAIM_MASK to strip page-allocator
zone modifiers like __GFP_HIGHMEM) received by
alloc_pages_bulk_weighted_interleave() to kmalloc() instead of hardcoding
GFP_KERNEL. Since the weights buffer is immediately initialized in full,
kmalloc() is sufficient.
📍 영향받는 시스템
Linux Kernel (MPOL_WEIGHTED_INTERLEAVE 정책을 사용하는 환경)
⚔️ 공격 벡터
로컬 공격자가 특정 메모리 정책을 사용하는 프로세스를 실행하여 커널의 원자적 컨텍스트 내에서 수면 할당을 유도함으로써 시스템 불안정 유발
🛡️ 대응 방법
리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 alloc_pages_bulk_weighted_interleave() 함수의 메모리 할당 플래그 수정 사항을 반영해야 함
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.