🇰🇷 한글 설명
Linux 커널의 perf/x86/amd/brs 구성 요소에서 커널 주소가 유출되는 취약점이 발견되었습니다. AMD Zen 3 프로세서에서 BRS 기능을 사용할 때, 사용자 공간에서 요청한 브랜치 스택에 커널 주소가 포함되어 노출될 수 있습니다. 이를 해결하기 위해 소프트웨어 필터가 브랜치 시작 주소까지 검증하도록 수정되었습니다.
💡 쉬운 설명
컴퓨터의 핵심 운영체제 영역인 커널의 비밀 주소가 일반 사용자 프로그램에 노출될 수 있는 문제입니다. 이 주소가 알려지면 해커가 시스템을 공격하기 위한 기초 정보를 얻을 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
perf/x86/amd/brs: Fix kernel address leakage
A user-only branch stack can contain branches that originate from
the kernel. As a result, kernel addresses are exposed to user space
even when PERF_SAMPLE_BRANCH_USER is requested. On AMD processors
supporting X86_FEATURE_BRS (Zen 3 only), perf can still report entries
such as SYSRET/interrupt returns for which the branch-from addresses
are in the kernel.
E.g.
$ perf record -j any,u -c 4000 -e branch-brs -o - -- \
perf bench syscall basic --loop 1000 | \
perf script -i - -F brstack|tr ' ' '\n'| \
grep -E '0x[89a-f][0-9a-f]{15}'
...
0xffffffff810001c4/0x72e2e32955eb/-/-/-/0//-
0xffffffff810001c4/0x72e2d94a9821/-/-/-/0//-
0xffffffff810001c4/0x72e2d94ffa1b/-/-/-/0//-
...
BRS provides no hardware branch filtering, so privilege level
filtering is performed entirely in software. However, amd_brs_match_plm()
only validates the branch-to address against the requested privilege
levels. For branches from the kernel to user space, the branch-from
address is left unchecked and is leaked. Extend the software filter to
also validate the branch-from address, so that any branch record whose
branch-from address is in the kernel is dropped when
PERF_SAMPLE_BRANCH_USER is requested.
📍 영향받는 시스템
X86_FEATURE_BRS를 지원하는 AMD Zen 3 프로세서를 사용하는 Linux 커널 시스템
⚔️ 공격 벡터
사용자 권한으로 perf 도구를 사용하여 브랜치 스택을 기록함으로써 커널 메모리 주소를 탈취
🛡️ 대응 방법
커널 주소 유출 방지 패치가 적용된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이상인지 확인