🇰🇷 한글 설명
Linux 커널의 crypto 서브시스템에서 nx_crypto_ctx_exit 함수에 잘못된 타입의 인자가 전달되어 발생하는 취약점입니다. shash 컨텍스트를 crypto_tfm 타입으로 잘못 처리함으로써 커널 데이터 접근 오류(Oops)를 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터의 핵심 운영체제인 리눅스에서 암호화 기능을 처리할 때, 데이터의 형식을 잘못 읽어 시스템이 갑자기 멈추거나 오류가 발생하는 문제입니다. 이로 인해 시스템이 예기치 않게 종료될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
crypto: nx - fix nx_crypto_ctx_exit argument
nx_crypto_ctx_shash_exit calls nx_crypto_ctx_exit with crypto_shash_ctx(...)
but crypto_shash_ctx gives a nx_crypto_ctx *, not a crypto_tfm *.
Fix the type in nx_crypto_ctx_exit and drop the bogus crypto_tfm_ctx
call.
This fixes the following oops:
BUG: Unable to handle kernel data access at 0xc0403effffffffc8
Faulting instruction address: 0xc000000000396cb4
Oops: Kernel access of bad area, sig: 11 [#15]
Call Trace:
nx_crypto_ctx_shash_exit+0x24/0x60
crypto_shash_exit_tfm+0x28/0x40
crypto_destroy_tfm+0x98/0x140
crypto_exit_ahash_using_shash+0x20/0x40
crypto_destroy_tfm+0x98/0x140
hash_release+0x1c/0x30
alg_sock_destruct+0x38/0x60
__sk_destruct+0x48/0x2b0
af_alg_release+0x58/0xb0
__sock_release+0x68/0x150
sock_close+0x20/0x40
__fput+0x110/0x3a0
sys_close+0x48/0xa0
system_call_exception+0x140/0x2d0
system_call_common+0xf4/0x258
.. which came from hardlink(1) opportunistically using AF_ALG.
The same problem exists with nx_crypto_ctx_skcipher_exit getting a context
it wasn't expecting, but apparently nobody hit that for years.
📍 영향받는 시스템
Linux Kernel (nx crypto module 사용 버전)
⚔️ 공격 벡터
AF_ALG 소켓을 사용하는 프로세스가 암호화 알고리즘을 해제할 때 발생하는 커널 메모리 접근 오류 유발
🛡️ 대응 방법
nx_crypto_ctx_exit 함수의 인자 타입을 수정하고 잘못된 호출을 제거한 최신 리눅스 커널 패치 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.