🇰🇷 한글 설명
Linux 커널의 perf/core 구성 요소에서 branch entry의 비트필드를 개별적으로 초기화하는 과정 중 일부 필드가 누락되는 취약점이 발견되었습니다. 이로 인해 arm64 아키텍처에서 kmalloc으로 할당된 메모리의 초기화되지 않은 데이터가 사용자 공간으로 노출될 수 있습니다.
💡 쉬운 설명
컴퓨터가 기록을 남길 때 이전 기록이나 메모리의 찌꺼기 데이터가 실수로 함께 전달될 수 있는 문제입니다. 이로 인해 민감한 정보가 의도치 않게 외부로 유출될 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
perf/core: Fill branch entries with a single assignment
perf_clear_branch_entry_bitfields() clears the bitfields of struct
perf_branch_entry one by one and leaves from/to alone, since callers
overwrite those straight away. The list has to be kept in sync with the
struct by hand and has already fallen behind: new_type and priv were
added to perf_branch_entry and never added here.
Only BRBE writes those two, and neither for every record.
brbe_set_perf_entry_type() leaves new_type alone for a branch type it
does not recognise, and priv is not set for source-only records.
arm_pmuv3.c allocates the per-CPU branch stack with kmalloc(), so such a
record reaches userspace with whatever the slot held: uninitialised
kmalloc() data on the first pass over the buffer, the previous record's
values after that. Nothing under arch/x86/events/ writes either field,
so only arm64 is affected.
Assign the whole entry at each site instead. Everything not named is
then zero, and there is no list to keep in sync. The bitfields add up to
exactly 64 bits, so the struct has no padding to leave undefined.
perf_clear_branch_entry_bitfields() has no callers left, so remove it.
perf_entry_from_brbe_regset() assigns an empty literal instead, since it
fills from/to conditionally. PERF_BR_SPEC_NA is 0, so dropping the
explicit spec assignment changes nothing.
📍 영향받는 시스템
Linux kernel (특히 arm64 아키텍처 기반 시스템)
⚔️ 공격 벡터
초기화되지 않은 커널 메모리(kmalloc) 데이터를 perf 도구를 통해 사용자 공간으로 읽어내는 방식
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 perf/core의 메모리 할당 및 초기화 로직을 수정해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인합니다.