🇰🇷 한글 설명
Linux 커널의 hwmon(pmbus/adm1266) 드라이버에서 GPIO 상태를 읽을 때 짧은 블록 읽기 응답에 대한 길이 검증이 누락되었습니다. 이로 인해 장치가 예상보다 적은 데이터를 반환할 경우 초기화되지 않은 커널 스택 메모리가 사용자 공간으로 유출될 수 있습니다.
💡 쉬운 설명
하드웨어 장치로부터 정보를 읽어올 때 데이터가 충분한지 확인하지 않아 발생하는 문제입니다. 이 결함을 이용하면 컴퓨터 내부의 민감한 메모리 정보가 외부로 조금씩 새어나갈 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
hwmon: (pmbus/adm1266) reject short block-read responses in the GPIO accessors
adm1266_gpio_get() and adm1266_gpio_get_multiple() both compose the
pin-status word as
pins_status = read_buf[0] + (read_buf[1] << 8);
right after i2c_smbus_read_block_data(), guarding only against an
error return. A well-behaved device returns 2 bytes for
GPIO_STATUS/PDIO_STATUS, but the helper happily reports a 0- or
1-byte response too. If the device returns 0 bytes, both read_buf
slots are uninitialized stack memory; if it returns 1 byte, read_buf[1]
is.
The composed value then flows through set_bit() into the caller's
*bits in adm1266_gpio_get_multiple(), or into the return value of
adm1266_gpio_get(), and ends up in userspace via gpiolib (sysfs and
the char-dev ioctls). That leaks a few bits of kernel stack per
request on any device whose firmware glitch, bus error, or hostile
slave produces a short block-read response.
Add the missing length check to both call sites and surface a short
response as -EIO.
📍 영향받는 시스템
Linux kernel (hwmon/pmbus/adm1266 드라이버를 사용하는 시스템)
⚔️ 공격 벡터
악의적인 하드웨어 장치나 버스 오류를 통해 짧은 응답을 전송하여 커널 스택 메모리 유출 유도
🛡️ 대응 방법
adm1266_gpio_get 및 adm1266_gpio_get_multiple 함수에 데이터 길이 검증 로직을 추가한 최신 커널로 업데이트
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 패치된 버전인지 확인합니다.