🔍 CVE-2026-99018

0.0
CVSS Score
UNKNOWN
2026-10-23
2026-10-23 13:17
✅ 완료

🇰🇷 한글 설명

Linux 커널 RISC-V 아키텍처의 예외 처리 루틴(handle_exception)에서 Shadow Call Stack 포인터(gp) 재로드 조건을 사용자 제어 가능한 tp 레지스터 비교에 의존하고 있었습니다. 이로 인해 사용자 공간 프로세스가 gp를 조작하여 커널 임의 쓰기 및 제어 흐름 탈취가 가능했으며, 수정은 하드웨어 sstatus.SPP 비트로 사용자 모드 진입 여부를 판단하도록 변경하는 것입니다.

💡 쉬운 설명

RISC-V 리눅스 커널이 사용자 프로그램이 조작할 수 있는 값으로 '사용자 프로그램에서 왔는지'를 잘못 판단하고 있었습니다. 이를 악용하면 일반 사용자 권한으로도 커널 메모리를 쓰고 실행 흐름을 바꿀 수 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: riscv: entry: gate shadow call stack reload on sstatus.SPP, not tp Under CONFIG_SHADOW_CALL_STACK, handle_exception() reloads the kernel shadow call stack pointer (gp) only when the trap came from userspace. It made that decision with scs_load_current_if_task_changed, which compares the trap-time tp (read back from sscratch into s5) against the current tp: beq \prev, tp, _skip_scs scs_load_current _skip_scs: tp is a user-writable register. A user task that sets tp to the linear-map address of its own task_struct (&current) before trapping makes the comparison succeed (can achieve by brute force with KASLR enable under our test), so the kernel skips scs_load_current and keeps running with the gp that userspace left in place. Under CONFIG_SHADOW_CALL_STACK gp is the shadow call stack pointer and load_global_pointer is a no-op, so the compiler-emitted "sd ra, -8(gp)" / "ld ra, -8(gp)" in every non-leaf function then write to, and return through, an attacker-controlled address -- an unprivileged kernel arbitrary-write and control-flow-hijack primitive. The poisoned gp is saved to task_struct.scs_sp on return, so the reload is skipped on every subsequent entry as well. Decide "came from userspace" from the hardware sstatus.SPP bit (already in s1 at this point) instead of from tp, mirroring the check that ret_from_exception already uses a few instructions later. SPP is written by hardware on trap entry and cannot be forged from U-mode. Legitimate behaviour is unchanged: user entries (SPP=0) reload the task shadow call stack, nested kernel entries (SPP=1) skip it.

📍 영향받는 시스템

CONFIG_SHADOW_CALL_STACK이 활성화된 RISC-V 아키텍처의 Linux 커널 (수정 커밋 이전 버전)

⚔️ 공격 벡터

로컬 비특권 사용자가 tp 레지스터를 자신의 task_struct 주소로 설정한 뒤 트랩을 발생시켜 커널의 gp(SCS 포인터)를 오염시켜 임의 쓰기 및 제어 흐름 탈취를 수행

🛡️ 대응 방법

커널을 CVE-2026-99018 수정 패치가 포함된 버전으로 업데이트하고 재부팅

🔧 검증 코드

출력된 커널 버전을 배포판 보안 공지 또는 상위 커널의 수정 커밋과 대조하여 패치 포함 여부를 확인하며, 아키텍처가 riscv64인지 'uname -m'으로 함께 확인

Shell / Script
uname -r

💻 영향받는 소프트웨어

Linux Kernel