🇰🇷 한글 설명
Linux 커널의 QAT 드라이버에서 장치 종료 시 공유 워크큐(qat_misc_wq)를 제대로 비우지 않아 발생하는 Use-After-Free 취약점입니다. 특정 장치 드라이버가 언로드된 후에도 대기 중인 작업이 실행되면서 해제된 메모리에 접근하여 커널 크래시를 유발할 수 있습니다.
💡 쉬운 설명
장치를 끄거나 드라이버를 제거할 때, 아직 처리되지 않은 작업이 남아 있어 시스템이 갑자기 멈추거나 오류가 발생하는 문제입니다. 마치 퇴근한 직원이 처리해야 할 서류가 책상에 남아 있어 시스템이 혼란에 빠지는 것과 같습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
crypto: qat - flush misc workqueue during device shutdown
Repeated loading and unloading of a device specific QAT driver, for
example qat_4xxx, in a tight loop can lead to a crash due to a
use-after-free scenario. This occurs when a power management (PM)
interrupt triggers just before the device-specific driver (e.g.,
qat_4xxx.ko) is unloaded, while the core driver (intel_qat.ko) remains
loaded.
Since the driver uses a shared workqueue (`qat_misc_wq`) across all
devices and owned by intel_qat.ko, a deferred routine from the
device-specific driver may still be pending in the queue. If this
routine executes after the driver is unloaded, it can dereference freed
memory, resulting in a page fault and kernel crash like the following:
BUG: unable to handle page fault for address: ffa000002e50a01c
#PF: supervisor read access in kernel mode
RIP: 0010:pm_bh_handler+0x1d2/0x250 [intel_qat]
Call Trace:
pm_bh_handler+0x1d2/0x250 [intel_qat]
process_one_work+0x171/0x340
worker_thread+0x277/0x3a0
kthread+0xf0/0x120
ret_from_fork+0x2d/0x50
To prevent this, flush the misc workqueue during device shutdown to
ensure that all pending work items are completed before the driver is
unloaded.
Note: This approach may slightly increase shutdown latency if the
workqueue contains jobs from other devices, but it ensures correctness
and stability.
📍 영향받는 시스템
Intel QAT(QuickAssist Technology) 드라이버를 사용하는 Linux 커널 시스템
⚔️ 공격 벡터
장치 드라이버를 반복적으로 로드 및 언로드하여 특정 타이밍에 커널 크래시 유도
🛡️ 대응 방법
장치 종료 시 qat_misc_wq 워크큐를 플러시(flush)하도록 커널 패치 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.