🇰🇷 한글 설명
Linux 커널의 OpenRISC 아키텍처에서 sigreturn 시 특권 상태의 SR(Supervision Register) 비트가 적절히 복구되지 않는 취약점이 발견되었습니다. 공격자가 조작된 sigframe을 통해 데이터 MMU를 비활성화하면, 임의의 물리 메모리에 대한 읽기 및 쓰기 권한을 획득하여 로컬 권한 상승이 가능합니다.
💡 쉬운 설명
컴퓨터의 보안 규칙을 담당하는 설정값이 사용자에 의해 조작될 수 있는 결함입니다. 이를 통해 일반 사용자가 시스템의 가장 중요한 핵심 영역인 물리 메모리에 마음대로 접근하여 관리자 권한을 뺏을 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
openrisc: signal: do not restore privileged SR bits on sigreturn
restore_sigcontext() copies the whole supervision register (SR) from the
signal frame and only clears SPR_SR_SM before the value is reloaded into
the hardware SR (through ESR and l.rfe) on the return to user space. All
other SR bits are left under user control.
An unprivileged task can thus return from a signal handler through a
crafted sigframe that clears SPR_SR_DME. With the data MMU disabled the
CPU performs no translation or protection on data accesses, so the task
gains read and write access to arbitrary physical memory, a local
privilege escalation. SPR_SR_IME, SPR_SR_SUMRA, SPR_SR_LEE, SPR_SR_EPH
and the cache-enable bits are exposed the same way. The ptrace GPR regset
already refuses any change to SR for exactly this reason.
Restore only the arithmetic flag bits (F, CY, OV) from the signal frame
and take every privileged control bit from the SR the kernel saved on
signal entry.
Verified with qemu-system-or1k -M or1k-sim: before this change an
unprivileged PoC clears SPR_SR_DME in rt_sigreturn and writes a marker to
physical address 0x03000000 (beyond the kernel's mem=32M); afterwards the
same PoC receives SIGSEGV and physical memory is unchanged.
📍 영향받는 시스템
OpenRISC 아키텍처를 사용하는 Linux 커널 시스템
⚔️ 공격 벡터
조작된 sigframe을 이용한 rt_sigreturn 호출을 통한 특권 SR 비트 조작
🛡️ 대응 방법
SR 비트 복구 시 산술 플래그 비트만 허용하고 나머지 특권 제어 비트는 커널이 저장한 값을 사용하도록 커널 패치 적용
🔧 검증 코드
커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.
uname -a | grep -i 'openrisc'