🇰🇷 한글 설명
Linux 커널 amdgpu 드라이버에서 Raven, Renoir 등 APU의 ih1 인터럽트 링 버퍼가 초기화되지 않은 상태에서 amdgpu_gmc_filter_faults_remove()가 이를 참조하여 NULL 포인터 역참조가 발생하는 취약점입니다. 재시도 폴트 처리가 활성화된 APU에서 SVM 페이지 폴트 복구 경로를 통해 커널 패닉이 유발될 수 있습니다. 링 크기 검사를 추가하여 수정되었습니다.
💡 쉬운 설명
일부 AMD 내장 그래픽 칩에서 커널이 존재하지 않는 메모리 영역을 잘못 참조해 시스템이 멈출 수 있는 결함입니다. 해당 칩을 사용하는 PC에 커널 보안 업데이트를 적용하면 해결됩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
drm/amdgpu: fix NULL pointer dereference in amdgpu_gmc_filter_faults_remove
On APUs such as Raven and Renoir (GC 9.1.0, 9.2.2, 9.3.0), the ih1 and
ih2 interrupt ring buffers are not initialized. This is by design, as
these secondary IH rings are only available on discrete GPUs. See
vega10_ih_sw_init() which explicitly skips ih1/ih2 initialization when
AMD_IS_APU is set.
However, amdgpu_gmc_filter_faults_remove() unconditionally uses ih1 to
get the timestamp of the last interrupt entry. When retry faults are
enabled on APUs (noretry=0), this function is called from the SVM page
fault recovery path, resulting in a NULL pointer dereference when
amdgpu_ih_decode_iv_ts_helper() attempts to access ih->ring[].
The crash manifests as:
BUG: kernel NULL pointer dereference, address: 0000000000000004
RIP: 0010:amdgpu_ih_decode_iv_ts_helper+0x22/0x40 [amdgpu]
Call Trace:
amdgpu_gmc_filter_faults_remove+0x60/0x130 [amdgpu]
svm_range_restore_pages+0xae5/0x11c0 [amdgpu]
amdgpu_vm_handle_fault+0xc8/0x340 [amdgpu]
gmc_v9_0_process_interrupt+0x191/0x220 [amdgpu]
amdgpu_irq_dispatch+0xed/0x2c0 [amdgpu]
amdgpu_ih_process+0x84/0x100 [amdgpu]
This issue was exposed by commit 1446226d32a4 ("drm/amdgpu: Remove GC HW
IP 9.3.0 from noretry=1") which changed the default for Renoir APU from
noretry=1 to noretry=0, enabling retry fault handling and thus
exercising the buggy code path.
Fix this by adding a check for ih1.ring_size before attempting to use
it. Also restore the soft_ih support from commit dd299441654f ("drm/amdgpu:
Rework retry fault removal"). This is needed if the hardware doesn't
support secondary HW IH rings.
v2: additional updates (Alex)
(cherry picked from commit 6ce8d536c80aa1f059e82184f0d1994436b1d526)
📍 영향받는 시스템
AMD APU(Raven, Renoir 등 GC 9.1.0/9.2.2/9.3.0)를 사용하는 Linux 커널 시스템 (패치 적용 전 버전)
⚔️ 공격 벡터
로컬 사용자가 GPU 페이지 폴트를 유발할 수 있는 상황에서 커널 NULL 포인터 역참조로 서비스 거부(시스템 충돌)를 일으킬 수 있음
🛡️ 대응 방법
배포판 제공 최신 Linux 커널 보안 업데이트를 설치하고 재부팅하세요.
🔧 검증 코드
커널 버전이 수정 커밋이 포함된 배포판 업데이트 버전 이상인지 확인하고, amdgpu 모듈 로드 및 AMD APU 장치 존재 여부를 확인하세요; 해당 APU가 없거나 amdgpu 모듈이 없으면 영향받지 않습니다.
uname -r && grep -c amdgpu /proc/modules 2>/dev/null && lspci -nn | grep -i 'vga\|display' | grep -i amd