🔍 CVE-2026-64191

7.8
CVSS Score
HIGH
2026-07-20
2026-10-19 21:17
✅ 완료

🇰🇷 한글 설명

Linux 커널의 i2c-stub 드라이버에서 I2C_SMBUS_I2C_BLOCK_DATA 요청 시 데이터 길이를 적절히 검증하지 않는 취약점이 발견되었습니다. 이로 인해 지정된 버퍼 범위를 초과하여 읽거나 쓰는 스택 기반의 Out-of-bounds 오류가 발생할 수 있습니다.

💡 쉬운 설명

I2C라는 통신 도구를 테스트하는 기능에서 데이터 크기를 확인하지 않아, 정해진 그릇보다 더 큰 데이터를 넣으려 할 때 시스템 메모리가 망가질 수 있는 문제입니다. 공격자가 이를 이용해 시스템의 중요한 정보를 읽거나 조작할 위험이 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: i2c: stub: Reject I2C block transfers with invalid length The I2C_SMBUS_I2C_BLOCK_DATA case in stub_xfer() uses data->block[0] as the transfer length. The existing check only clamps it to avoid overrunning the chip->words[256] register array, but does not validate it against I2C_SMBUS_BLOCK_MAX (32), which is the limit of the union i2c_smbus_data.block buffer (34 bytes total). The driver is a development/test tool (CONFIG_I2C_STUB=m, not built by default) that must be loaded with a chip_addr= parameter. A local user with access to /dev/i2c-* can issue an I2C_SMBUS ioctl with I2C_SMBUS_I2C_BLOCK_DATA and data->block[0] > 32, causing stub_xfer() to read or write past the end of the union i2c_smbus_data.block buffer: BUG: KASAN: stack-out-of-bounds in stub_xfer (drivers/i2c/i2c-stub.c:223) Read of size 1 at addr ffff88800abcfd92 by task exploit/81 Call Trace: <TASK> stub_xfer (drivers/i2c/i2c-stub.c:223) __i2c_smbus_xfer (drivers/i2c/i2c-core-smbus.c:593) i2c_smbus_xfer (drivers/i2c/i2c-core-smbus.c:536) i2cdev_ioctl_smbus (drivers/i2c/i2c-dev.c:391) i2cdev_ioctl (drivers/i2c/i2c-dev.c:478) __x64_sys_ioctl (fs/ioctl.c:583) do_syscall_64 (arch/x86/entry/syscall_64.c:94) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) </TASK> The bug exists because i2c-stub implements .smbus_xfer directly, bypassing the I2C_SMBUS_BLOCK_MAX validation in i2c_smbus_xfer_emulated(). The I2C_SMBUS_BLOCK_DATA case in the same function correctly validates against I2C_SMBUS_BLOCK_MAX, but the I2C_SMBUS_I2C_BLOCK_DATA case does not. Fix by rejecting transfers with data->block[0] == 0 or data->block[0] > I2C_SMBUS_BLOCK_MAX with -EINVAL, consistent with both the I2C_SMBUS_BLOCK_DATA case in the same function and the I2C_SMBUS_I2C_BLOCK_DATA validation in i2c_smbus_xfer_emulated().

📍 영향받는 시스템

CONFIG_I2C_STUB 모듈이 활성화된 Linux 커널 시스템

⚔️ 공격 벡터

로컬 사용자가 /dev/i2c-* 장치에 접근하여 잘못된 길이를 가진 I2C_SMBUS ioctl 명령을 실행

🛡️ 대응 방법

Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 I2C_SMBUS_BLOCK_MAX 검증 로직을 적용

🔧 검증 코드

i2c_stub 모듈이 로드되어 있는지 확인하고, 현재 커널 버전이 해당 취약점이 수정된 버전인지 확인합니다.

Shell / Script
lsmod | grep i2c_stub && uname -r

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

💻 영향받는 소프트웨어

Linux Kernel