🇰🇷 한글 설명
Linux 커널의 GFS2 파일 시스템에서 메모리 회수 과정이 재귀적으로 호출되어 스택 메모리를 과다하게 소비하거나 데드락(교착 상태)을 유발할 수 있는 취약점입니다. inode 생성 시 gfp_mask에 __GFP_FS 플래그가 포함되어 파일 시스템 메모리 회수가 다시 파일 시스템 코드를 호출하는 문제가 있었습니다. 이를 해결하기 위해 gfp_mask에서 __GFP_FS 플래그를 제거하여 재귀 호출을 방지합니다.
💡 쉬운 설명
컴퓨터가 메모리를 정리하는 과정에서 실수로 자기 자신을 계속 호출하여 시스템이 멈추거나 과부하가 걸릴 수 있는 문제입니다. 이로 인해 시스템이 응답하지 않는 상태(데드락)에 빠질 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
gfs2: Prevent recursive memory reclaim
Function new_inode() returns a new inode with inode->i_mapping->gfp_mask
set to GFP_HIGHUSER_MOVABLE. This value includes the __GFP_FS flag, so
allocations in that address space can recurse into filesystem memory
reclaim. We don't want that to happen because it can consume a
significant amount of stack memory.
Worse than that is that it can also deadlock: for example, in several
places, gfs2_unstuff_dinode() is called inside filesystem transactions.
This calls filemap_grab_folio(), which can allocate a new folio, which
can trigger memory reclaim. If memory reclaim recurses into the
filesystem and starts another transaction, a deadlock will ensue.
To fix these kinds of problems, prevent memory reclaim from recursing
into filesystem code by making sure that the gfp_mask of inode address
spaces doesn't include __GFP_FS.
The "meta" and resource group address spaces were already using GFP_NOFS
as their gfp_mask (which doesn't include __GFP_FS). The default value
of GFP_HIGHUSER_MOVABLE is less restrictive than GFP_NOFS, though. To
avoid being overly limiting, use the default value and only knock off
the __GFP_FS flag. I'm not sure if this will actually make a
difference, but it also shouldn't hurt.
This patch is loosely based on commit ad22c7a043c2 ("xfs: prevent stack
overflows from page cache allocation").
Fixes xfstest generic/273.
📍 영향받는 시스템
Linux kernel (GFS2 파일 시스템을 사용하는 시스템)
⚔️ 공격 벡터
특정 파일 시스템 작업(예: inode 생성 및 트랜잭션 처리)을 유도하여 메모리 재귀 호출 및 데드락 유발
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인하십시오.