🇰🇷 한글 설명
Linux 커널의 hwmon adm1275 드라이버에서 초기화되지 않은 스택 메모리를 읽을 수 있는 취약점이 발견되었습니다. I2C 장치로부터 데이터를 읽어올 때 NULL 종료 문자가 보장되지 않아, 문자열 비교 과정에서 스택의 초기화되지 않은 영역까지 읽게 되는 문제입니다.
💡 쉬운 설명
장치에서 이름을 읽어올 때 데이터의 끝을 알려주는 표시가 없어, 컴퓨터가 메모리의 엉뚱한 부분까지 읽어버리는 오류입니다. 이로 인해 메모리에 남아있던 민감한 정보가 유출될 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
hwmon: adm1275: Prevent reading uninitialized stack
While adding support for the ROHM BD127X0 hot-swap controllers, sashiko
reported an error in device-name comparison, which can lead to reading
uninitialized stack memory.
Quoting Sashiko:
This is a pre-existing issue, but I noticed that just before this block in
adm1275_probe(), there might be an out-of-bounds stack read:
ret = i2c_smbus_read_block_data(client, PMBUS_MFR_MODEL, block_buffer);
if (ret < 0) { ... }
for (mid = adm1275_id; mid->name[0]; mid++) {
if (!strncasecmp(mid->name, block_buffer, strlen(mid->name)))
break;
}
Since i2c_smbus_read_block_data() reads up to 32 bytes into the
uninitialized stack array block_buffer without appending a null
terminator, strncasecmp() could read past the valid bytes returned in ret.
For example, if the device returns a shorter string like "adm12", checking
it against "adm1275" up to the length of "adm1275" will continue reading
into uninitialized stack bounds.
Prevent reading uninitialized memory by zeroing the stack array.
📍 영향받는 시스템
Linux kernel (adm1275 driver 포함 버전)
⚔️ 공격 벡터
특수하게 조작된 I2C 장치를 연결하여 커널 스택의 초기화되지 않은 데이터를 읽도록 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하거나, adm1275 드라이버 코드에서 block_buffer를 0으로 초기화하도록 수정
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인