🇰🇷 한글 설명
Linux 커널의 powerpc/hv-gpci 구성 요소에서 sysfs show() 콜백 함수가 preempt_disable() 호출에 대응하는 put_cpu_var()를 성공적인 경로에서 호출하지 않아 선점 카운트(preempt count)가 누수되는 취약점입니다. 이로 인해 선점이 비활성화된 상태로 사용자 공간으로 복귀하게 되며, 결국 시스템이 SIGSEGV를 발생시키거나 'scheduling while atomic' 오류와 함께 커널 패닉을 일으킬 수 있습니다.
💡 쉬운 설명
시스템의 특정 정보를 읽을 때마다 내부적인 제어권 설정이 제대로 해제되지 않고 쌓이는 버그입니다. 이 현상이 반복되면 시스템이 명령을 처리하는 과정에서 충돌을 일으켜 강제로 종료될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
powerpc/hv-gpci: fix preempt count leak in sysfs show paths
Four sysfs show() callbacks in hv-gpci take get_cpu_var(hv_gpci_reqb)
(which calls preempt_disable()) but only call the matching put_cpu_var()
on the error path under the 'out:' label. Every successful read leaks
one preempt_disable():
processor_bus_topology_show()
processor_config_show()
affinity_domain_via_virtual_processor_show()
affinity_domain_via_domain_show()
(affinity_domain_via_partition_show() was already correct.)
On a CONFIG_PREEMPT=y kernel, repeated reads raise preempt_count and
eventually return to userspace with preemption still disabled. The
next user-mode page fault then hits faulthandler_disabled() == 1,
gets forced to SIGSEGV, and the resulting coredump trips
'BUG: scheduling while atomic' in call_usermodehelper_exec ->
wait_for_completion_state -> schedule:
BUG: scheduling while atomic: <task>/<pid>/0x00000004
...
__schedule_bug+0x6c/0x90
__schedule+0x58c/0x13a0
schedule+0x48/0x1a0
schedule_timeout+0x104/0x170
wait_for_completion_state+0x16c/0x330
call_usermodehelper_exec+0x254/0x2d0
vfs_coredump+0x1050/0x2590
get_signal+0xb9c/0xc80
do_notify_resume+0xf8/0x470
Add an out_success label that calls put_cpu_var() before returning
the byte count, mirroring affinity_domain_via_partition_show().
📍 영향받는 시스템
powerpc 아키텍처를 사용하는 CONFIG_PREEMPT=y 설정의 Linux 커널
⚔️ 공격 벡터
로컬 사용자가 취약한 sysfs 경로(processor_bus_topology 등)를 반복적으로 읽어 선점 카운트를 누적시킴
🛡️ 대응 방법
커널 패치가 적용된 최신 버전의 Linux 커널로 업데이트하거나, 해당 sysfs 경로에 대한 접근을 제한함
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인합니다.