🇰🇷 한글 설명
Linux 커널에서 부팅 중 부트타임 함수 트레이서가 시작될 때, 아직 초기화되지 않은 워크큐(system_percpu_wq)를 참조하여 커널 패닉이 발생하는 문제를 수정했습니다. 커널 페이지 테이블 해제 작업은 부팅 중에는 예약하지 않고 core_initcall에서 일괄 처리하도록 변경되었습니다.
💡 쉬운 설명
컴퓨터를 켜는 도중에 특정 디버깅 도구를 사용하면 시스템이 멈추는 버그가 있었습니다. 이 수정으로 부팅 중에는 필요한 작업을 미뤄두었다가 준비가 끝난 후 처리하게 되어 멈춤 문제가 해결됩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mm: don't schedule deferred kernel page table freeing while booting
Booting with a boot-time function tracer and a filter, for example
ftrace=function ftrace_filter=pud_free_pmd_page
panics on 7.3-rc4 as soon as the tracer starts:
[ 23.531178] Starting tracer 'function'
[ 23.675800] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000038: 0000 [#1] SMP KASAN NOPTI
[ 23.819917] KASAN: null-ptr-deref in range [0x00000000000001c0-0x00000000000001c7]
[ 23.964025] CPU: 0 UID: 0 PID: 0 Comm: swapper Not tainted 7.3.0-rc4-fe2ec83746e5-with-fixes-v2+ #195 PREEMPT(undef)
[ 24.252248] RIP: 0010:__queue_work+0xab/0xf00
[ 25.981629] Call Trace:
[ 26.125727] <TASK>
[ 26.413912] ? pagetable_free_kernel+0x20/0x120
[ 26.990283] queue_work_on+0x97/0xf0
[ 27.134382] __cpa_collapse_large_pages+0x501/0x6f0
[ 27.566662] cpa_flush+0x394/0x620
[ 27.998953] change_page_attr_set_clr+0x321/0x4a0
[ 29.151729] set_memory_rox+0xa2/0xf0
[ 29.584018] create_trampoline+0x431/0x6f0
...
[ 44.343347] Kernel panic - not syncing: Attempted to kill the idle task!
The boot-time tracer is started from early_trace_init(), which runs
before workqueue_init_early(). Making its trampoline read-only splits a
large page, and CPA collapses it again right away. The split table has
been a kernel page table since commit 9e4a3ec3411b
("x86/mm/pat: Allocate split page tables as kernel page tables"), so the
collapse frees it through pagetable_free_kernel(), which queues work on
system_percpu_wq - still NULL at that point. That commit is correct in
itself; it only lets CPA reach pagetable_free_kernel() before the
workqueue that function relies on exists.
Keep putting the table on the list, but don't schedule the work while
the system is still booting. A core_initcall schedules it once to free
whatever was queued by then.
📍 영향받는 시스템
Linux 커널 7.3-rc4 및 해당 버전 이후에서 부트타임 function tracer와 필터를 사용하는 시스템 (CVSS 점수 미정)
⚔️ 공격 벡터
공격자가 직접 악용하기는 어려우며, 부팅 옵션(ftrace 설정)을 지정한 환경에서 부팅 중 커널 패닉으로 서비스 거부가 발생할 수 있음
🛡️ 대응 방법
패치된 Linux 커널 버전으로 업데이트하거나 배포판의 보안 업데이트를 적용하고 재부팅
🔧 검증 코드
출력된 커널 버전이 해당 CVE 수정이 포함된 패치 버전(배포판 공지 기준) 이상인지 확인하며, 낮으면 업데이트가 필요합니다.