🇰🇷 한글 설명
Linux 커널의 IMA(Integrity Measurement Architecture) 구성 요소 내 xattr_verify() 함수에서 경계 외 읽기(Out-of-bounds read) 취약점이 발견되었습니다. xattr_len 계산 시 부호 없는 정수(size_t) 변환으로 인한 언더플로우가 발생하여, 잘못된 길이 검사를 통과한 후 할당된 버퍼 범위를 벗어난 메모리를 읽을 수 있습니다.
💡 쉬운 설명
데이터의 길이를 확인하는 과정에서 계산 오류가 발생하여, 정해진 범위를 넘어선 메모리 영역을 읽어버리는 보안 결함입니다. 이로 인해 시스템의 민감한 정보가 유출될 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ima: fix out-of-bounds read in xattr_verify()
The digest-length check in xattr_verify() mixes int and size_t:
if (xattr_len - sizeof(xattr_value->type) - hash_start >=
iint->ima_hash->length)
sizeof() yields size_t, so the usual arithmetic conversions promote
the whole left-hand side to unsigned 64-bit before the subtraction
runs. For a truncated xattr this underflows instead of going negative:
a 1-byte IMA_XATTR_DIGEST_NG xattr (xattr_len == 1, hash_start == 1)
turns "1 - 1 - 1" into SIZE_MAX, which is trivially >= ima_hash->length.
The check then passes and the following memcmp() reads
iint->ima_hash->length bytes starting past the end of the buffer
vfs_getxattr_alloc() allocated for it.
Nothing upstream clamps xattr_len back into a safe range first:
ima_get_hash_algo() only special-cases xattr_len < 2 to pick a default
algorithm, and evm_verifyxattr() returns INTEGRITY_UNKNOWN rather than
failing when no HMAC key is loaded, so a truncated security.ima value
reaches the length check as-is.
Rewrite the comparison so every operand stays a signed int and no
implicit conversion to size_t can occur.
📍 영향받는 시스템
Linux Kernel (IMA 모듈을 사용하는 시스템)
⚔️ 공격 벡터
조작된(truncated) security.ima 확장 속성(xattr)을 제공하여 메모리 경계 외 읽기 유도
🛡️ 대응 방법
IMA의 xattr_verify() 함수 내 비교 연산을 부호 있는 정수(signed int)를 사용하도록 수정된 최신 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인하십시오.