🇰🇷 한글 설명
Linux 커널의 I2C dev 드라이버에서 I2C_TIMEOUT ioctl 호출 시 정수 오버플로가 발생할 수 있는 취약점입니다. 공격자가 조작된 값을 전달하면 타임아웃 값이 음수로 해석되어 SMBus 상태 머신을 손상시키고 로컬 서비스 거부(DoS)를 유발할 수 있습니다.
💡 쉬운 설명
사용자가 입력한 숫자가 너무 커서 계산 과정 중 오류가 발생해 시스템이 오작동하는 문제입니다. 이로 인해 장치 제어 기능이 멈추거나 시스템 서비스가 중단될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
i2c: dev: prevent integer overflow in I2C_TIMEOUT ioctl
While fuzzing with Syzkaller, a persistent `schedule_timeout: wrong
timeout value` warning was observed, accompanied by SMBus controller
state machine corruption.
The I2C_TIMEOUT ioctl accepts a user-provided timeout in multiples of
10 ms. The user argument is checked against INT_MAX, but it is
subsequently multiplied by 10 before being passed to msecs_to_jiffies().
A malicious user can pass a large value (e.g., 429496729) that passes
the `arg > INT_MAX` check but overflows when multiplied by 10. This
results in a truncated 32-bit unsigned value that bypasses the
internal `(int)m < 0` check in `msecs_to_jiffies()`.
The truncated value is then assigned to `client->adapter->timeout`
(a signed 32-bit int), which is reinterpreted as a negative number.
When passed to wait_for_completion_timeout(), this negative value
undergoes sign extension to a 64-bit unsigned long, triggering the
`schedule_timeout` warning and causing premature returns. This leaves
the SMBus state machine in an unrecoverable state, constituting a
local Denial of Service (DoS).
Fix this by bounding the user argument to `INT_MAX / 10`.
[wsa: move the comment as well]
📍 영향받는 시스템
Linux kernel (I2C dev driver 포함 버전)
⚔️ 공격 벡터
로컬 사용자가 조작된 I2C_TIMEOUT ioctl 인자값을 전달하여 정수 오버플로 유발
🛡️ 대응 방법
사용자 입력 인자값을 INT_MAX / 10 범위 내로 제한하도록 커널 패치 적용
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 수정된 최신 보안 패치 버전인지 확인합니다.