🇰🇷 한글 설명
Linux 커널의 dup_mmap() 과정에서 메모리 할당 실패 시 maple tree가 불안정한 상태로 남을 수 있는 취약점입니다. 이로 인해 불완전하게 초기화된 mm_struct에 접근하게 되어 시스템 안정성에 문제를 일으킬 수 있습니다.
💡 쉬운 설명
컴퓨터의 메모리를 복사하는 과정에서 오류가 발생했을 때, 작업이 완전히 끝나지 않은 불안정한 상태의 메모리 정보가 남게 되는 문제입니다. 이 상태의 정보를 다른 프로그램이 잘못 건드리면 시스템이 충돌하거나 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
kernel: be more careful about dup_mmap() failures and uprobe registering
If a memory allocation fails during dup_mmap(), the maple tree can be left
in an unsafe state for other iterators besides the exit path. All the
locks are dropped before the exit_mmap() call (in mm/mmap.c), but the
incomplete mm_struct can be reached through (at least) the rmap finding
the vmas which have a pointer back to the mm_struct.
Up to this point, there have been no issues with being able to find an
mm_struct that was only partially initialised. Syzbot was able to make
the incomplete mm_struct fail with recent forking changes, so it has been
proven unsafe to use the mm_struct that hasn't been initialised, as
referenced in the link below.
Although 8ac662f5da19f ("fork: avoid inappropriate uprobe access to
invalid mm") fixed the uprobe access, it does not completely remove the
race.
This patch sets the MMF_OOM_SKIP to avoid the iteration of the vmas on the
oom side (even though this is extremely unlikely to be selected as an oom
victim in the race window), and sets MMF_UNSTABLE to avoid other potential
users from using a partially initialised mm_struct.
When registering vmas for uprobe, skip the vmas in an mm that is marked
unstable. Modifying a vma in an unstable mm may cause issues if the mm
isn't fully initialised.
📍 영향받는 시스템
Linux Kernel (dup_mmap() 및 uprobe 관련 기능이 포함된 버전)
⚔️ 공격 벡터
메모리 할당 실패를 유도하여 불완전하게 초기화된 mm_struct에 접근하는 레이스 컨디션 공격
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인하십시오.