🇰🇷 한글 설명
Linux 커널의 TEE(Trusted Execution Environment) 공유 메모리 동적 할당 함수 tee_dyn_shm_alloc_helper()가 사용자가 지정한 크기 0을 검증 없이 처리하여, alloc_pages_exact(0) 호출 시 정의되지 않은 동작과 페이지 할당기 경고가 발생합니다. 수정으로 0 페이지 할당 요청을 거부하도록 변경되었습니다.
💡 쉬운 설명
크기가 0인 메모리 할당 요청이 들어오면 커널이 잘못 처리하여 경고가 발생하고 할당에 실패합니다. panic_on_warn 설정 시에는 시스템 부팅이 중단될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tee: shm: reject zero-sized allocations in tee_dyn_shm_alloc_helper()
tee_dyn_shm_alloc_helper() derives nr_pages from a caller-supplied size
and passes it to alloc_pages_exact() without checking it. For size == 0
nr_pages is 0, and alloc_pages_exact(0) calls get_order(0), which is
documented as undefined and returns BITS_PER_LONG - PAGE_SHIFT. The page
allocator then trips its order > MAX_PAGE_ORDER warning and fails the
allocation; on a panic_on_warn kernel that ends the boot.
This can be triggered by TEE_IOC_SHM_ALLOC with struct
tee_ioctl_shm_alloc_data where size is 0.
Reject a zero page count, as register_shm_helper() already does for the
register path.
📍 영향받는 시스템
패치 이전의 Linux 커널 (TEE 드라이버 및 tee_dyn_shm_alloc_helper를 사용하는 버전)
⚔️ 공격 벡터
TEE_IOC_SHM_ALLOC ioctl에 size가 0인 tee_ioctl_shm_alloc_data 구조체를 전달하여 커널 경고 또는 패닉을 유발
🛡️ 대응 방법
Linux 커널을 해당 CVE 수정이 포함된 최신 안정 버전으로 업데이트하고 재부팅
🔧 검증 코드
출력된 커널 버전을 배포판 보안 공지 또는 커널 changelog와 대조하여 수정 패치 포함 여부를 확인하며, 패치가 포함되지 않았다면 업데이트가 필요합니다.