🇰🇷 한글 설명
Linux 커널의 arm64 아키텍처에서 초기 커널 매핑 시 세그먼트 경계가 2MB 블록 내에 위치할 경우, 추가적인 페이지 테이블 페이지가 필요할 수 있습니다. 기존의 예약된 페이지 수가 부족하여 데이터 세그먼트의 마지막 부분이 다음 페이지로 오버플로될 수 있는 취약점이 발견되어, 예약 페이지를 하나 더 늘려 이를 해결했습니다.
💡 쉬운 설명
컴퓨터의 핵심 운영체제인 리눅스가 부팅될 때 메모리를 나누는 과정에서 공간 계산이 잘못되어 데이터가 옆 칸을 침범할 수 있는 문제가 있었습니다. 이 문제를 해결하기 위해 메모리 공간을 미리 조금 더 넉넉하게 확보하도록 수정되었습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
arm64: Reserve an extra page for early kernel mapping
The final part of [data, end) segment may overflow into the next page of
init_pg_end[1] which is the gap page before early_init_stack[2]:
[1]
crash_arm64_v9.0.1> vtop ffffffed00601000
VIRTUAL PHYSICAL
ffffffed00601000 83401000
PAGE DIRECTORY: ffffffecffd62000
PGD: ffffffecffd62da0 => 10000000833fb003
PMD: ffffff80033fb018 => 10000000833fe003
PTE: ffffff80033fe008 => 68000083401f03
PAGE: 83401000
PTE PHYSICAL FLAGS
68000083401f03 83401000 (VALID|SHARED|AF|NG|PXN|UXN)
PAGE PHYSICAL MAPPING INDEX CNT FLAGS
fffffffec00d0040 83401000 0 0 1 4000 reserved
[2]
ffffffed002c8000 (r) __pi__data
ffffffed0054e000 (d) __pi___bss_start
ffffffed005f5000 (b) __pi_init_pg_dir
ffffffed005fe000 (b) __pi_init_pg_end
ffffffed005ff000 (B) early_init_stack
ffffffed00608000 (b) __pi__end
For 4K pages, the early kernel mapping may use 2MB block entries but the
kernel segments are only 64KB aligned. Segment boundaries that fall
within a 2MB block therefore require a PTE table so that different
attributes can be applied on either side of the boundary.
KERNEL_SEGMENT_COUNT still correctly counts the five permanent kernel
VMAs registered by declare_kernel_vmas(). However, since commit
5973a62efa34 ("arm64: map [_text, _stext) virtual address range
non-executable+read-only"), the early mapper also maps [_text, _stext)
separately from [_stext, _etext). This adds one more early-only split
and can require one more page-table page than the existing
EARLY_SEGMENT_EXTRA_PAGES allowance reserves.
Increase the 4K-page early mapping allowance by one page to cover that
additional split.
[
[email protected]: rewrote part of the commit log]
[
[email protected]: expanded the code comment]
📍 영향받는 시스템
Linux kernel (arm64 architecture)
⚔️ 공격 벡터
메모리 오버플로를 이용한 커널 메모리 영역 침범 및 권한 상승 가능성
🛡️ 대응 방법
커널 패치를 적용하여 arm64 초기 매핑 시 추가 페이지(EARLY_SEGMENT_EXTRA_PAGES)를 예약하도록 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인