🇰🇷 한글 설명
Linux 커널의 pds_core 드라이버에서 PCI 상태 확인 중 데드락(Deadlock)이 발생하는 취약점입니다. 드라이버의 헬스 스레드 컨텍스트에서 PCI 리셋을 시도할 때 스레드 종료 프로세스와 충돌하며, 펌웨어가 중단된 상태에서 드라이버를 언로드할 때 워크큐 관련 경고가 발생할 수 있습니다.
💡 쉬운 설명
장치 상태를 점검하는 과정에서 시스템이 서로를 기다리며 멈춰버리는 '교착 상태'가 발생할 수 있는 문제입니다. 또한 장치를 제거할 때 소프트웨어가 비정상적으로 동작하여 시스템 오류를 일으킬 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
pds_core: Fix pdsc_check_pci_health function to use work thread
When the driver notices fw_status == 0xff it tries to perform a PCI
reset on itself via pci_reset_function() in the context of the driver's
health thread. However, pdsc_reset_prepare calls
pdsc_stop_health_thread(), which attempts to stop/flush the health
thread. This results in a deadlock because the stop/flush will never
complete since the driver called pci_reset_function() from the health
thread context. Fix by changing the pdsc_check_pci_health_function()
to queue a newly introduced pdsc_pci_reset_thread() on the pdsc's
work queue.
Unloading the driver in the fw_down/dead state uncovered another issue,
which can be seen in the following trace:
WARNING: CPU: 51 PID: 6914 at kernel/workqueue.c:1450 __queue_work+0x358/0x440
[...]
RIP: 0010:__queue_work+0x358/0x440
[...]
Call Trace:
<TASK>
? __warn+0x85/0x140
? __queue_work+0x358/0x440
? report_bug+0xfc/0x1e0
? handle_bug+0x3f/0x70
? exc_invalid_op+0x17/0x70
? asm_exc_invalid_op+0x1a/0x20
? __queue_work+0x358/0x440
queue_work_on+0x28/0x30
pdsc_devcmd_locked+0x96/0xe0 [pds_core]
pdsc_devcmd_reset+0x71/0xb0 [pds_core]
pdsc_teardown+0x51/0xe0 [pds_core]
pdsc_remove+0x106/0x200 [pds_core]
pci_device_remove+0x37/0xc0
device_release_driver_internal+0xae/0x140
driver_detach+0x48/0x90
bus_remove_driver+0x6d/0xf0
pci_unregister_driver+0x2e/0xa0
pdsc_cleanup_module+0x10/0x780 [pds_core]
__x64_sys_delete_module+0x142/0x2b0
? syscall_trace_enter.isra.18+0x126/0x1a0
do_syscall_64+0x3b/0x90
entry_SYSCALL_64_after_hwframe+0x72/0xdc
RIP: 0033:0x7fbd9d03a14b
[...]
Fix this by preventing the devcmd reset if the FW is not running.
📍 영향받는 시스템
pds_core 드라이버를 사용하는 Linux 커널 시스템
⚔️ 공격 벡터
로컬 공격자가 특정 하드웨어 상태(fw_status == 0xff)를 유도하거나 드라이버 언로드를 시도하여 시스템 중단 유발
🛡️ 대응 방법
Linux 커널을 최신 패치가 적용된 버전으로 업데이트하여 pdsc_pci_reset_thread를 사용하도록 수정
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인