🇰🇷 한글 설명
Linux 커널의 dmaengine: idxd 드라이버에서 idxd_free() 함수가 중복된 put_device()를 호출하여 참조 횟수 언더플로우 및 Use-After-Free 취약점이 발생합니다. 이로 인해 모듈 언로드 시 메모리 손상이나 시스템 불안정이 초래될 수 있습니다.
💡 쉬운 설명
컴퓨터 부품을 관리하는 프로그램이 종료될 때, 이미 정리된 메모리를 중복해서 정리하려고 시도하면서 발생하는 오류입니다. 이 과정에서 시스템이 엉뚱한 메모리 영역을 건드려 보안 문제가 생기거나 컴퓨터가 멈출 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
dmaengine: idxd: Remove improper idxd_free
The call to idxd_free() introduces a duplicate put_device() leading to a
reference count underflow:
refcount_t: underflow; use-after-free.
WARNING: CPU: 15 PID: 4428 at lib/refcount.c:28 refcount_warn_saturate+0xbe/0x110
...
Call Trace:
<TASK>
idxd_remove+0xe4/0x120 [idxd]
pci_device_remove+0x3f/0xb0
device_release_driver_internal+0x197/0x200
driver_detach+0x48/0x90
bus_remove_driver+0x74/0xf0
pci_unregister_driver+0x2e/0xb0
idxd_exit_module+0x34/0x7a0 [idxd]
__do_sys_delete_module.constprop.0+0x183/0x280
do_syscall_64+0x54/0xd70
entry_SYSCALL_64_after_hwframe+0x76/0x7e
The idxd_unregister_devices() which is invoked at the very beginning of
idxd_remove(), already takes care of the necessary put_device() through the
following call path:
idxd_unregister_devices() -> device_unregister() -> put_device()
In addition, when CONFIG_DEBUG_KOBJECT_RELEASE is enabled, put_device() may
trigger asynchronous cleanup via schedule_delayed_work(). If idxd_free() is
called immediately after, it can result in a use-after-free.
Remove the improper idxd_free() to avoid both the refcount underflow and
potential memory corruption during module unload.
📍 영향받는 시스템
Linux kernel (idxd driver module)
⚔️ 공격 벡터
로컬 권한을 가진 공격자가 커널 모듈을 언로드(unload)하는 과정을 통해 메모리 손상을 유도할 수 있음
🛡️ 대응 방법
idxd 드라이버 내의 잘못된 idxd_free() 호출을 제거한 최신 커널 패치 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.