🇰🇷 한글 설명
Linux 커널의 HID 코어에서 hid_set_field() 함수가 경계 검사 이전에 hid_dump_input()을 호출하여 발생하는 Out-of-Bounds(OOB) 읽기 취약점입니다. 특정 조건에서 offset 값이 report_count를 초과할 경우, 인접한 메모리 영역을 읽어 들여 정보 유출이나 시스템 불안정을 초래할 수 있습니다.
💡 쉬운 설명
컴퓨터의 입력 장치(마우스, 키보드 등)를 처리하는 과정에서, 정해진 범위를 벗어난 메모리 주소를 읽어버리는 오류가 발견되었습니다. 이로 인해 시스템의 민감한 정보가 노출되거나 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
HID: core: fix OOB read of field->usage in hid_set_field()
hid_set_field() hands field->usage + offset to hid_dump_input() before
the guard that bounds offset:
hid_dump_input(field->report->device, field->usage + offset, value);
if (offset >= field->report_count) {
hid_err(...);
return -1;
}
Under CONFIG_DEBUG_FS hid_dump_input() dereferences that pointer, with
buf = hid_resolv_usage(usage->hid, NULL). The usage[] array is
allocated inline with the hid_field in hid_register_field() and holds
field->maxusage entries, so an offset past it reads off the end of the
kvzalloc()ed allocation and into a neighbouring object. Had the guard
run first, offset < report_count <= maxusage would already have confined
the pointer to the array.
A caller supplies such an offset today. picolcd_fb_send_tile()
validates only report->maxfield before issuing
hid_set_field(report->field[0], 11 + i, ...) for i = 0..31, so its
offsets are fixed at 11..42 and are never checked against the bound
field. When the device registers that field with fewer usages, the
framebuffer deferred-io work drives the read on every tile. KASAN
reports a 4-byte slab-out-of-bounds read in hid_dump_input() below
hid_set_field(), and the same boot logs "offset (1) exceeds
report_count (1)" from the guard that runs only afterwards.
Move the hid_dump_input() call below the guard. Because
field->maxusage >= field->report_count, the guard then establishes that
field->usage + offset lies inside the array before it is dereferenced,
for every caller and without changing behaviour on the valid path.
Discovered by XBOW, triaged by Baul Lee <
[email protected]>
📍 영향받는 시스템
Linux Kernel (CONFIG_DEBUG_FS가 활성화된 환경)
⚔️ 공격 벡터
특정 하드웨어(예: picolcd_fb)가 잘못된 오프셋 값을 전달하여 커널 메모리 경계를 넘어서는 읽기 동작 유도
🛡️ 대응 방법
커널 패치를 통해 hid_dump_input() 호출 위치를 경계 검사(guard) 이후로 이동시켜 메모리 접근 제한 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 최신 패치 버전인지 확인합니다.