🇰🇷 한글 설명
Linux 커널의 HID 드라이버에서 long format 아이템 처리 시 타입 혼동(Type Confusion) 취약점이 발견되었습니다. HID_ITEM_TAG_LONG 태그를 가진 아이템을 처리할 때 포인터 값을 숫자로 잘못 해석하여 커널 메모리 주소의 일부가 dmesg 로그에 노출될 수 있습니다.
💡 쉬운 설명
특수한 장치를 컴퓨터에 연결하면 컴퓨터 내부의 비밀스러운 메모리 주소가 로그 파일에 찍혀 나올 수 있는 문제입니다. 이로 인해 해커가 시스템의 내부 구조를 파악하는 데 도움을 줄 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
HID: core: fix number/pointer type confusion on long items
When fetch_item() is called by hid_scan_report() on an item with
HID_ITEM_TAG_LONG, it stores a pointer to the item data in
item->data.longdata instead of storing a value directly in
item->data.{u8/u16/u32}.
When item_udata() or item_sdata() encounters such an item, it incorrectly
assumes that the item is in short format, and therefore returns the lower
part of a kernel pointer reinterpreted as a number.
When a HID device is connected whose descriptor contains a
HID_GLOBAL_ITEM_TAG_REPORT_SIZE encoded in long format with size=4, this
causes the lower half of a kernel pointer to be printed into dmesg as a
number, like this:
hid (null): invalid report_size 107953555
To fix it, let item_udata() and item_sdata() verify that the item is in
short format.
Note that this bug only affects hid_scan_report(), while the main parsing
pass hid_parse_collections() will always bail out when encountering a long
item.
Sidenote: There are currently no users of data.longdata; maybe we should
just remove any parsing of long-format descriptors as a follow-up.
📍 영향받는 시스템
HID 드라이버를 사용하는 Linux 커널 (long format descriptor를 처리하는 hid_scan_report 함수 포함 버전)
⚔️ 공격 벡터
HID_GLOBAL_ITEM_TAG_REPORT_SIZE가 long format(size=4)으로 인코딩된 악의적인 HID 장치를 연결
🛡️ 대응 방법
커널 패치를 적용하여 item_udata() 및 item_sdata() 함수가 아이템 형식을 올바르게 검증하도록 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 최신 보안 패치 버전인지 확인