🔍 CVE-2025-37988

7.8
CVSS Score
HIGH
2025-05-20
2026-07-30 06:22
✅ 완료

🇰🇷 한글 설명

Linux 커널의 do_move_mount() 함수 내 MNT_TREE_BENEATH 처리 과정에서 경합 조건(Race Condition) 취약점이 발견되었습니다. 적절한 잠금(Locking) 메커니즘 부재로 인해 마운트 작업 중 파일 시스템이 종료되거나 데이터 구조가 손상될 수 있는 위험이 있습니다.

💡 쉬운 설명

컴퓨터의 파일 저장 공간을 연결하는 과정에서 두 가지 작업이 동시에 일어나 충돌이 발생하는 문제입니다. 이 충돌이 발생하면 시스템이 예상치 못한 방식으로 동작하거나 오류를 일으킬 수 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: fix a couple of races in MNT_TREE_BENEATH handling by do_move_mount() Normally do_lock_mount(path, _) is locking a mountpoint pinned by *path and at the time when matching unlock_mount() unlocks that location it is still pinned by the same thing. Unfortunately, for 'beneath' case it's no longer that simple - the object being locked is not the one *path points to. It's the mountpoint of path->mnt. The thing is, without sufficient locking ->mnt_parent may change under us and none of the locks are held at that point. The rules are * mount_lock stabilizes m->mnt_parent for any mount m. * namespace_sem stabilizes m->mnt_parent, provided that m is mounted. * if either of the above holds and refcount of m is positive, we are guaranteed the same for refcount of m->mnt_parent. namespace_sem nests inside inode_lock(), so do_lock_mount() has to take inode_lock() before grabbing namespace_sem. It does recheck that path->mnt is still mounted in the same place after getting namespace_sem, and it does take care to pin the dentry. It is needed, since otherwise we might end up with racing mount --move (or umount) happening while we were getting locks; in that case dentry would no longer be a mountpoint and could've been evicted on memory pressure along with its inode - not something you want when grabbing lock on that inode. However, pinning a dentry is not enough - the matching mount is also pinned only by the fact that path->mnt is mounted on top it and at that point we are not holding any locks whatsoever, so the same kind of races could end up with all references to that mount gone just as we are about to enter inode_lock(). If that happens, we are left with filesystem being shut down while we are holding a dentry reference on it; results are not pretty. What we need to do is grab both dentry and mount at the same time; that makes inode_lock() safe *and* avoids the problem with fs getting shut down under us. After taking namespace_sem we verify that path->mnt is still mounted (which stabilizes its ->mnt_parent) and check that it's still mounted at the same place. From that point on to the matching namespace_unlock() we are guaranteed that mount/dentry pair we'd grabbed are also pinned by being the mountpoint of path->mnt, so we can quietly drop both the dentry reference (as the current code does) and mnt one - it's OK to do under namespace_sem, since we are not dropping the final refs. That solves the problem on do_lock_mount() side; unlock_mount() also has one, since dentry is guaranteed to stay pinned only until the namespace_unlock(). That's easy to fix - just have inode_unlock() done earlier, while it's still pinned by mp->m_dentry.

📍 영향받는 시스템

Linux Kernel (MNT_TREE_BENEATH 관련 기능이 포함된 버전)

⚔️ 공격 벡터

로컬 사용자가 마운트 및 언마운트 작업을 정밀하게 조작하여 커널 내 경합 조건을 유발

🛡️ 대응 방법

해당 취약점이 수정된 최신 Linux 커널 버전으로 업데이트

🔧 검증 코드

출력된 커널 버전을 확인하여 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인합니다.

Shell / Script
uname -r

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

💻 영향받는 소프트웨어

Linux Kernel