🇰🇷 한글 설명
Linux 커널의 nouveau 드라이버에서 대형 폴리오(folio)가 분할될 때 할당된 카운트가 제대로 업데이트되지 않아 발생하는 언더플로우 취약점입니다. 폴리오 분할 시 하위 폴리오에 대한 카운트 처리가 누락되어, 메모리 해제 과정에서 카운트가 음수로 변하며 메모리 누수가 발생하고 자원 회수가 불가능해집니다.
💡 쉬운 설명
메모리를 관리하는 장부에서 숫자가 잘못 계산되어, 사용이 끝난 메모리를 시스템이 다시 가져오지 못하게 만드는 오류입니다. 이로 인해 시스템의 메모리가 계속 낭비되는 현상이 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
drm/nouveau/dmem: fix callocated underflow on large folio split
nouveau_dmem_folio_free() drops chunk->callocated once per freed folio,
while a large (compound) device-private folio is only counted once when
it is allocated. When such a folio is split, the mm core invokes
->folio_split() (nouveau_dmem_folio_split()) once for each new
sub-folio, but the hook only fixes up the sub-folio metadata and leaves
chunk->callocated unchanged.
Each resulting sub-folio is later freed separately, so after a split
the single allocation (+1) is met by N frees (-N), leaving
chunk->callocated short by N-1. On the first split/free cycle it
underflows: WARN_ON(!chunk->callocated) fires, the unsigned counter
wraps and never returns to zero, so the chunk can no longer be
reclaimed (nouveau_dmem_fini() also warns on the leaked count).
Account for the new sub-folio in the split hook, under the same lock as
nouveau_dmem_folio_free(), so the count stays balanced.
📍 영향받는 시스템
Linux kernel (nouveau DRM driver 포함 버전)
⚔️ 공격 벡터
로컬 공격자가 특정 메모리 할당 및 분할을 유도하여 메모리 누수 유발 가능
🛡️ 대응 방법
nouveau_dmem_folio_split() 훅에서 하위 폴리오의 카운트를 적절히 업데이트하도록 수정된 최신 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 버전인지 확인