🇰🇷 한글 설명
Linux 커널의 crypto/algif_skcipher 모듈에서 비동기(AIO) 처리 중 IV(초기화 벡터)가 경합 조건으로 인해 공격자에 의해 조작될 수 있는 취약점입니다. 이로 인해 CTR/stream 모드에서 IV 또는 키스트림 재사용이 발생하여 비권한 사용자가 평문을 복구할 수 있습니다.
💡 쉬운 설명
암호화 과정에서 사용되는 비밀번호와 같은 일회용 값이 공격자에 의해 중간에 바뀔 수 있는 결함입니다. 이 결함을 이용하면 암호화된 데이터를 해독하여 원래 내용을 알아낼 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
crypto: algif_skcipher - force synchronous processing on trees without ctx->state
The AIO/async path in skcipher_recvmsg() passes the socket-wide ctx->iv
directly into the skcipher request. After io_submit() the socket lock is
dropped and the request is processed asynchronously, so a concurrent
sendmsg(ALG_SET_IV) can overwrite ctx->iv and make the in-flight request
run under an attacker-controlled IV. For CTR/stream modes this is
IV/keystream reuse and lets an unprivileged user recover the plaintext of
a concurrent operation.
Snapshotting ctx->iv into per-request storage for the async path is not
sufficient. For ciphers with statesize == 0 - which includes cbc and ctr -
the MSG_MORE inter-chunk IV chaining is carried solely by the in-place
req->iv writeback, which a snapshot redirects into per-request memory that
af_alg_free_resources() releases on completion, silently producing wrong
output. Writing the IV back from the completion callback instead is not
possible either: that would require lock_sock() there, but the callback can
run in softirq/atomic context, so it must not sleep.
Make the operation synchronous instead, which removes both the IV race and
any writeback race. This is equivalent to the upstream resolution, commit
fcc77d33a34c ("net: Remove support for AIO on sockets"), which removed the
AIO socket path across net/ entirely and so produces the same end state for
this file. This patch deviates from that commit deliberately: rather than
removing AIO socket support tree-wide, which would be far too invasive for
stable, it removes only the AIO branch in crypto/algif_skcipher.c.
io_submit() now completes synchronously; AF_ALG async is rarely used in
practice.
The -EIOCBQUEUED check in skcipher_recvmsg() is now dead but harmless,
and is left alone to keep the fix minimal.
Tested on 6.6.y: attacker IV injection dropped from 2296/200000 to 0/200000
after the change; MSG_MORE chunked CTR output bit-identical to single-shot.
📍 영향받는 시스템
Linux kernel (6.6.y 포함 skcipher 관련 모듈 사용 시스템)
⚔️ 공격 벡터
비동기 요청 처리 중 동시적인 ALG_SET_IV 호출을 통한 IV 주입
🛡️ 대응 방법
커널 업데이트를 통해 skcipher_recvmsg()의 AIO 경로를 제거하고 동기식 처리를 적용해야 합니다.
🔧 검증 코드
출력된 커널 버전이 보안 패치가 적용된 최신 안정화 버전인지 확인합니다.
📊 CVSS Vector String
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
💻 영향받는 소프트웨어
NVIDIA GPU Display Driver for Linux