🇰🇷 한글 설명
Linux 커널의 perf/x86/intel/uncore 모듈에서 die ID 초기화 및 조회 시 발생하는 버그입니다. NUMA 설정 상태와 관계없이 UBOX 디바이스 위치 파악 실패로 인해 PMON 유닛이 RB 트리에 추가되지 않는 문제를 해결합니다.
💡 쉬운 설명
Linux 커널에서 프로세서의 물리적 위치를 파악하는 기능이 제대로 작동하지 않는 버그입니다. 특히 NUMA 설정 상태에 따라 일부 시스템 모니터링 유닛이 누락되는 문제가 발생합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
perf/x86/intel/uncore: Fix die ID init and look up bugs
In snbep_pci2phy_map_init(), in the nr_node_ids > 8 path,
uncore_device_to_die() may return -1 when all CPUs associated
with the UBOX device are offline.
Remove the WARN_ON_ONCE(die_id == -1) check for two reasons:
- The current code breaks out of the loop. This is incorrect because
pci_get_device() does not guarantee iteration in domain or bus order,
so additional UBOX devices may be skipped during the scan.
- Returning -EINVAL is incorrect, since marking offline buses with
die_id == -1 is expected and should not be treated as an error.
Separately, when NUMA is disabled on a NUMA-capable platform,
pcibus_to_node() returns NUMA_NO_NODE, causing uncore_device_to_die()
to return -1 for all PCI devices. As a result,
spr_update_device_location(), used on Intel SPR and EMR, ignores the
corresponding PMON units and does not add them to the RB tree.
Fix this by using uncore_pcibus_to_dieid(), which retrieves topology
from the UBOX GIDNIDMAP register and works regardless of whether NUMA
is enabled in Linux. This requires snbep_pci2phy_map_init() to be
added in spr_uncore_pci_init().
Keep uncore_device_to_die() only for the nr_node_ids > 8 case, where
NUMA is expected to be enabled.
📍 영향받는 시스템
Linux kernel (Intel Sandy Bridge-EP 이후, 특히 SPR/EMR 플랫폼)
⚔️ 공격 벡터
로컬 공격자가 비정상적인 perf 명령어를 실행하거나 시스템 모니터링 유닛 접근을 통해 정보 유출 또는 시스템 불안정성 야기
🛡️ 대응 방법
Linux 커널을 최신 패치 버전으로 업데이트하여 uncore_pcibus_to_dieid() 함수 사용으로 NUMA 설정 독립적인 처리 적용
🔧 검증 코드
커널 버전 확인 후 PERF_EVENTS가 활성화되면 영향받을 수 있는 시스템이며, 최신 커널 업데이트로 패치 여부를 확인해야 합니다.
uname -r; grep -q 'CONFIG_PERF_EVENTS=y' /boot/config-$(uname -r) 2>/dev/null && echo 'PERF_EVENTS enabled' || echo 'check kernel'