🇰🇷 한글 설명
Linux 커널의 tpm2_get_random() 함수에서 경계 검사 오류(off-by-four)가 발견되었습니다. TPM2_ST_SESSIONS 태그가 포함된 응답 처리 시 4바이트의 파라미터 크기 필드를 건너뛰지만, 경계 검사는 여전히 잘못된 기준으로 수행되어 memcpy() 과정에서 버퍼 범위를 초과해 읽을 수 있습니다. 이로 인해 호출자의 랜덤 바이트에 이전 메모리의 잔여 데이터가 포함될 수 있습니다.
💡 쉬운 설명
컴퓨터가 보안을 위해 무작위 숫자를 만들 때, 메모리의 잘못된 부분을 읽어와서 실제 데이터가 아닌 엉뚱한 정보가 섞일 수 있는 문제입니다. 이로 인해 생성된 무작위 숫자의 보안성이 떨어질 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tpm: fix off-by-four bounds check in tpm2_get_random()
When the response carries the TPM2_ST_SESSIONS tag, tpm2_get_random()
skips the 4-byte parameter size field before locating the random data,
but the bounds check still validates the response length against
TPM_HEADER_SIZE. A truncated response can pass the check and make
memcpy() read up to 4 bytes past the response end, so stale buffer
contents end up in the caller's random bytes.
Fix this by checking the response length against 'offset', which
already includes the skipped parameter size field.
📍 영향받는 시스템
TPM2를 사용하는 Linux 커널 버전 (패치 적용 전 버전)
⚔️ 공격 벡터
조작된(Truncated) TPM 응답을 전달하여 메모리 경계 검사를 우회하고 커널 메모리 내용을 유출
🛡️ 대응 방법
해당 취약점이 수정된 최신 Linux 커널로 업데이트
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인