🇰🇷 한글 설명
Linux 커널의 RISC-V perf 서브시스템에서 사용 가능한 카운터 마스크를 처리할 때 발생하는 취약점입니다. RV32 아키텍처에서 64개의 카운터를 순회하는 과정 중 객체의 범위를 벗어나 메모리를 읽는 오버런 문제가 발생할 수 있습니다.
💡 쉬운 설명
RISC-V 기반의 32비트 시스템에서 컴퓨터의 성능 측정 도구가 메모리의 허용된 범위를 넘어 잘못된 데이터를 읽을 수 있는 오류입니다. 이로 인해 시스템의 성능 측정 기능이 오작동하거나 예기치 않은 동작이 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
perf: RISC-V: store available counter mask as bitmap
The available-counter mask was a single unsigned long, but iteration
uses RISCV_MAX_COUNTERS, which is 64. On RV32 that reads past the object.
Filling with an unsigned-long bit at index 32 and above is also wrong.
Use DECLARE_BITMAP and set_bit/bitmap helpers. Walk each bitmap word
into CFG_MATCH when checking events, when allocating an index, and when
stopping all counters. Set the counter base to i times BITS_PER_LONG.
Share the CFG_MATCH ecall through a small helper so the 32-bit argument
split is not duplicated. On qemu-system-riscv32 the probe bitmap has bits
above XLEN set, so the first word alone is not enough.
[
[email protected]: updated to apply; fixed checkpatch.pl issues]
📍 영향받는 시스템
RISC-V 아키텍처를 사용하는 32비트(RV32) Linux 커널 시스템
⚔️ 공격 벡터
로컬 공격자가 성능 카운터 관련 시스템 호출을 통해 메모리 경계 밖의 데이터를 읽거나 시스템 불안정을 유도할 수 있음
🛡️ 대응 방법
RISC-V 카운터 마스크 처리를 비트맵 방식으로 수정하여 적용한 최신 Linux 커널로 업데이트
🔧 검증 코드
출력 결과에 'riscv'가 포함되어 있다면 해당 아키텍처의 영향을 받을 가능성이 있는 시스템입니다.
uname -a | grep -i 'riscv'