🇰🇷 한글 설명
Linux 커널의 af_alg 모듈에서 sock_kmalloc으로 할당된 메모리가 초기화되지 않아 발생하는 취약점입니다. 이로 인해 특정 오류 경로에서 초기화되지 않은 데이터가 사용되거나, 'inflight' 변수에 쓰레기 값이 들어가 무작위로 -EBUSY 오류가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터 메모리를 빌려 쓸 때 깨끗이 지우지 않고 사용해서 발생하는 문제입니다. 이 때문에 시스템이 아무 이유 없이 갑자기 작동을 멈추거나 오류를 내뱉는 현상이 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
crypto: af_alg - zero initialize memory allocated via sock_kmalloc
Several crypto user API contexts and requests allocated with
sock_kmalloc() were left uninitialized, relying on callers to
set fields explicitly. This resulted in the use of uninitialized
data in certain error paths or when new fields are added in the
future.
The ACVP patches also contain two user-space interface files:
algif_kpp.c and algif_akcipher.c. These too rely on proper
initialization of their context structures.
A particular issue has been observed with the newly added
'inflight' variable introduced in af_alg_ctx by commit:
67b164a871af ("crypto: af_alg - Disallow multiple in-flight AIO requests")
Because the context is not memset to zero after allocation,
the inflight variable has contained garbage values. As a result,
af_alg_alloc_areq() has incorrectly returned -EBUSY randomly when
the garbage value was interpreted as true:
https://github.com/gregkh/linux/blame/master/crypto/af_alg.c#L1209
The check directly tests ctx->inflight without explicitly
comparing against true/false. Since inflight is only ever set to
true or false later, an uninitialized value has triggered
-EBUSY failures. Zero-initializing memory allocated with
sock_kmalloc() ensures inflight and other fields start in a known
state, removing random issues caused by uninitialized data.
📍 영향받는 시스템
Linux Kernel (af_alg 모듈을 사용하는 시스템)
⚔️ 공격 벡터
직접적인 공격보다는 시스템의 비정상적인 동작(DoS 유사 현상)을 유발할 수 있는 로컬/원격 조건 존재
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 sock_kmalloc 사용 시 메모리 제로 초기화를 적용해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인합니다.