🇰🇷 한글 설명
Linux 커널의 s390/dasd 구성 요소에서 정수 오버플로로 인한 버퍼 크기 계산 오류가 발견되었습니다. 64비트 계산 결과가 32비트 변수에 저장되면서 값이 잘리는 현상이 발생하며, 이로 인해 실제 필요한 크기보다 작은 메모리가 할당되어 버퍼 오버플로가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터가 메모리 크기를 계산할 때 숫자가 너무 커서 중간에 잘리는 실수가 발생했습니다. 이로 인해 실제 필요한 공간보다 훨씬 작은 공간만 빌리게 되어, 데이터를 저장할 때 옆 공간을 침범하는 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
s390/dasd: Fix undersized format-check buffer
fmt_buffer_size in dasd_eckd_check_device_format() is declared as
int, even though one of the multiplicands, sizeof(struct eckd_count),
is a size_t. The expression
trkcount * rpt_max * sizeof(struct eckd_count)
is therefore correctly evaluated at 64-bit width, but the result is
silently truncated when it is stored back into the 32-bit
fmt_buffer_size variable. For a sufficiently large track range
(start_unit/stop_unit are caller-controlled) this truncation
yields a buffer size far smaller than the number of tracks actually
requested. kzalloc() then succeeds with an undersized allocation,
while the subsequent channel program build still operates on the
untruncated track count and writes past the end of that buffer.
Compute the buffer size with check_mul_overflow() and keep it in a
size_t, so that a value that no longer fits results in -EINVAL
instead of a silently truncated allocation size.
📍 영향받는 시스템
Linux kernel (s390 architecture, dasd/eckd driver)
⚔️ 공격 벡터
사용자가 제어 가능한 트랙 범위(start_unit/stop_unit)를 통해 의도적으로 큰 값을 입력하여 메모리 할당 크기를 조작함
🛡️ 대응 방법
커널 패치를 적용하여 fmt_buffer_size를 size_t 타입으로 변경하고 check_mul_overflow()를 사용하여 오버플로를 방지함
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 최신 패치 버전인지 확인합니다.