🇰🇷 한글 설명
Linux 커널의 ACPI pfr_update 구성 요소에서 query_capability() 함수가 펌웨어로부터 전달받은 버퍼 길이를 검증하지 않고 memcpy를 사용하여 스택 버퍼 오버플로우가 발생합니다. 펌웨어가 16바이트보다 큰 데이터를 반환할 경우, 고정 크기 배열을 넘어 스택 메모리에 쓰기를 수행하여 시스템 불안정이나 권한 상승을 초래할 수 있습니다.
💡 쉬운 설명
컴퓨터의 하드웨어를 제어하는 소프트웨어가 펌웨어로부터 받은 정보의 크기를 확인하지 않고 그대로 메모리에 복사하다가 발생하는 오류입니다. 잘못된 크기의 정보가 들어오면 컴퓨터의 중요한 메모리 영역을 침범하여 시스템이 멈추거나 해킹될 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ACPI: pfr_update: fix stack buffer overflow in query_capability()
query_capability() copies four ACPI buffer objects returned by the
firmware _DSM into fixed-size u8[16] fields in struct
pfru_update_cap_info using memcpy with the firmware-supplied length:
memcpy(&cap_hdr->code_type,
elements[CAP_CODE_TYPE_IDX].buffer.pointer,
elements[CAP_CODE_TYPE_IDX].buffer.length);
The same pattern repeats for drv_type, platform_id, and oem_id.
If the firmware returns buffer.length > 16 for any of these fields,
memcpy writes past the destination array.
struct pfru_update_cap_info is stack-allocated in pfru_ioctl().
Confirmed with KASAN on 7.2-rc6: three stack-out-of-bounds reports
are generated when a DSM returns 64-byte buffers, with writes reaching
44 bytes past the end of cap_hdr's [64, 156) frame window into
adjacent stack redzones.
Introduce a helper pointer to out_obj->package.elements and use it
to validate each buffer length against its destination field size
before copying, returning -EINVAL if the firmware supplies an
oversized buffer.
📍 영향받는 시스템
Linux kernel (7.2-rc6 및 관련 ACPI pfr_update 기능을 사용하는 버전)
⚔️ 공격 벡터
악의적으로 조작된 ACPI _DSM(Device Specific Method) 데이터를 반환하는 취약한 펌웨어를 통한 로컬 공격
🛡️ 대응 방법
커널 패치를 적용하여 memcpy 호출 전 버퍼 길이를 검증하도록 업데이트하거나 최신 안정화 버전의 커널로 업그레이드
🔧 검증 코드
출력된 커널 버전이 취약점이 수정된 패치 버전인지 확인