🇰🇷 한글 설명
Linux 커널의 mm/hugetlb 구성 요소에서 hugetlb folio 복사 중 오류가 발생할 경우 VMA 예약 정보가 복구되지 않는 취약점입니다. 이로 인해 예약된 주소 공간의 리소스가 누수되며, 특정 상황에서 프로세스가 SIGBUS 신호를 받고 종료될 수 있습니다.
💡 쉬운 설명
컴퓨터 메모리를 관리하는 과정에서 오류가 났을 때, 사용했던 예약 정보를 제대로 돌려놓지 않아 발생하는 문제입니다. 이 문제가 반복되면 시스템이 메모리 사용 중 오류를 일으키며 프로그램이 갑자기 꺼질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
mm/hugetlb: restore reservation on error in hugetlb folio copy paths
Two sites in mm/hugetlb.c allocate a hugetlb folio via
alloc_hugetlb_folio() (consuming a VMA reservation) and then call
copy_user_large_folio(), which became int-returning in commit 1cb9dc4b475c
("mm: hwpoison: support recovery from HugePage copy-on-write faults") and
can now fail (e.g. -EHWPOISON on a hwpoisoned source page). On the
failure path, folio_put() restores the global hugetlb pool count through
free_huge_folio(), but the per-VMA reservation map entry is left marked
consumed:
- hugetlb_mfill_atomic_pte() resubmission path (UFFDIO_COPY)
- copy_hugetlb_page_range() fork-time CoW path when
hugetlb_try_dup_anon_rmap() fails (rare: pinned hugetlb anon
folio under fork)
User-visible effect: on UFFDIO_COPY into a private hugetlb VMA where the
resubmission copy fails, the reservation for that address is leaked from
the VMA's reserve map. A subsequent fault at the same address takes the
no-reservation path, and under hugetlb pool pressure the task is SIGBUSed
at an address it had previously reserved. The fork-time CoW path leaks
the same way in the child VMA's reserve map, though it requires the much
rarer combination of pinned hugetlb anon page + hwpoisoned source.
Add the missing restore_reserve_on_error() call before folio_put() on both
error paths.
📍 영향받는 시스템
Linux Kernel (hugetlb 관련 모듈 사용 시스템)
⚔️ 공격 벡터
로컬 공격자가 특정 메모리 복사 작업(UFFDIO_COPY 등)을 유도하여 리소스 누수 및 서비스 거부(DoS) 유발
🛡️ 대응 방법
커널 패치를 적용하여 오류 발생 시 restore_reserve_on_error() 함수가 호출되도록 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 최신 패치 버전인지 확인