🇰🇷 한글 설명
Linux 커널의 amdgpu 드라이버에서 kobject 추가 실패 시 IP 인스턴스 메모리가 해제되지 않고 누수되는 취약점이 발견되었습니다. kobject_add()가 실패하더라도 초기 참조를 해제하지 않아 ip_hw_instance_release()가 호출되지 않는 것이 원인입니다. 이를 해결하기 위해 kobject_add() 실패 시 kobject_put()을 호출하여 메모리를 정상적으로 해제하도록 수정되었습니다.
💡 쉬운 설명
컴퓨터의 그래픽 카드 관련 소프트웨어에서 특정 오류가 발생했을 때, 사용했던 메모리를 다시 돌려주지 않고 계속 붙잡고 있는 문제가 있었습니다. 이 문제가 반복되면 시스템의 메모리가 부족해질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
drm/amdgpu: fix IP instance memory leak on kobject add failure
amdgpu_discovery_sysfs_ips() allocates ip_hw_instance with
kzalloc_flex() and initializes its embedded kobject before calling
kobject_add().
If kobject_add() fails, the return value is ignored and execution
continues without dropping the initial kobject reference. The failed
kobject is not retained in the kset list, so the normal sysfs teardown
path cannot find it. As a result, ip_hw_instance_release() is never
called and the ip_hw_instance allocation is leaked.
Call kobject_put() when kobject_add() fails so the initial reference is
dropped and ip_hw_instance_release() can free the allocation. Keep the
existing best-effort sysfs behavior by continuing with the remaining IP
entries after the failed registration.
The issue was identified by a static analysis tool I developed and
confirmed by manual review.
(cherry picked from commit 5c75fbcca8af1096d8d9415b91d8ea6212c22ee1)
📍 영향받는 시스템
Linux kernel (amdgpu driver 포함 버전)
⚔️ 공격 벡터
직접적인 공격은 어려우나, 특정 조건에서 드라이버 오류를 유도하여 시스템 메모리 고갈(DoS)을 일으킬 수 있음
🛡️ 대응 방법
amdgpu 드라이버의 메모리 누수 수정 패치가 적용된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전(commit 5c75fbcca8af1096d8d9415b91d8ea6212c22ee1 포함 버전)인지 확인