🇰🇷 한글 설명
Linux 커널의 synaptics-rmi4 드라이버에서 GPIO 개수와 실제 할당된 키맵 배열 크기 간의 불일치로 인해 발생하는 취약점입니다. 공격자가 조작된 GPIO 개수를 보고하는 장치를 사용할 경우, 메모리 경계를 벗어난 읽기 및 쓰기가 발생하여 인접한 슬랩 메모리가 유출되거나 임의의 값이 쓰여질 수 있습니다.
💡 쉬운 설명
입력 장치가 실제보다 더 많은 버튼이 있다고 거짓말을 하면, 컴퓨터가 잘못된 메모리 영역을 읽거나 써서 중요한 정보를 유출하거나 시스템을 망가뜨릴 수 있는 문제입니다. 이는 장치 드라이버가 장치가 말하는 숫자를 그대로 믿기 때문에 발생합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
Input: synaptics-rmi4 - bound the F3A keymap to the GPIO count
rmi_f3a_initialize() takes the GPIO count from the device query register
(f3a->gpio_count = buf & RMI_F3A_GPIO_COUNT, range 0..127).
rmi_f3a_map_gpios() then allocates gpio_key_map with
min(gpio_count, TRACKSTICK_RANGE_END) == at most 6 entries, but
rmi_f3a_attention() iterates the full gpio_count and dereferences
gpio_key_map[i], and input->keycodemax is set to the full gpio_count
while input->keycode points at the 6-entry allocation.
A device that reports gpio_count > 6 therefore causes an out-of-bounds
read of gpio_key_map[] on every attention interrupt, and out-of-bounds
accesses through the input core's default keymap ioctls: EVIOCGKEYCODE
reads past the buffer (leaking adjacent slab memory to user space) and
EVIOCSKEYCODE writes a caller-controlled value past it, for any process
able to open the evdev node, since input_default_getkeycode() and
input_default_setkeycode() only bound the index against keycodemax.
Size the keymap for the full gpio_count. The mapping loop is unchanged:
it still assigns only the first min(gpio_count, TRACKSTICK_RANGE_END)
entries; the remaining slots stay KEY_RESERVED (devm_kcalloc zero-fills)
and are skipped when reporting.
📍 영향받는 시스템
Linux kernel (synaptics-rmi4 driver 포함 버전)
⚔️ 공격 벡터
조작된 GPIO count를 보고하는 악성 하드웨어 장치를 연결하거나 관련 인터럽트를 유도하여 evdev 노드를 통해 공격
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 rmi_f3a_map_gpios()의 할당 로직 수정 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.