🇰🇷 한글 설명
Linux 커널의 crypto acomp 모듈에서 acomp_save_req() 함수가 잘못된 포인터를 저장하여 발생하는 메모리 손상 취약점입니다. 비동기 하드웨어 구현체(예: QAT 드라이버) 사용 시 잘못된 오프셋으로 메모리에 접근하여 시스템 충돌이나 일반 보호 오류(GPF)를 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터가 데이터를 처리할 때 주소를 잘못 기록하여 엉뚱한 메모리 위치를 건드리는 문제입니다. 이로 인해 시스템이 갑자기 멈추거나 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
crypto: acomp - fix wrong pointer stored by acomp_save_req()
acomp_save_req() stores &req->chain in req->base.data. When
acomp_reqchain_done() is invoked on asynchronous completion, it receives
&req->chain as the data argument but casts it directly to struct
acomp_req. Since data points to the chain member, all subsequent field
accesses are at a wrong offset, resulting in memory corruption.
The issue occurs when an asynchronous hardware implementation, such as
the QAT driver, completes a request that uses the DMA virtual address
interface (e.g. acomp_request_set_src_dma()). This combination causes
crypto_acomp_compress() to enter the acomp_do_req_chain() path, which
sets acomp_reqchain_done() as the completion callback via
acomp_save_req().
With KASAN enabled, this manifests as a general protection fault in
acomp_reqchain_done():
general protection fault, probably for non-canonical address 0xe000040000000000
KASAN: probably user-memory-access in range [0x0000400000000000-0x0000400000000007]
RIP: 0010:acomp_reqchain_done+0x15b/0x4e0
Call Trace:
<IRQ>
qat_comp_alg_callback+0x5d/0xa0 [intel_qat]
adf_ring_response_handler+0x376/0x8b0 [intel_qat]
adf_response_handler+0x60/0x170 [intel_qat]
tasklet_action_common+0x223/0x820
handle_softirqs+0x1ab/0x640
</IRQ>
Fix this by storing the request itself in req->base.data instead of
&req->chain, so that acomp_reqchain_done() receives the correct pointer.
Simplify acomp_restore_req() accordingly to access req->chain directly.
📍 영향받는 시스템
Linux kernel (crypto acomp 모듈을 사용하는 시스템, 특히 Intel QAT 드라이버 사용 환경)
⚔️ 공격 벡터
비동기 DMA 인터페이스를 사용하는 암호화 요청을 처리하는 과정에서 메모리 오염 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 acomp_save_req()의 포인터 저장 로직을 수정해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인합니다.