🇰🇷 한글 설명
Linux 커널의 F2FS 파일 시스템에서 원자적 쓰기(atomic write) ioctl 작업 시 쓰기 권한(FMODE_WRITE)을 제대로 검증하지 않는 취약점입니다. 이로 인해 SELinux나 Landlock 같은 보안 모듈(LSM)의 제한을 우회하여 파일 크기를 0으로 만들거나 다른 프로세스의 변경 사항을 되돌릴 수 있습니다.
💡 쉬운 설명
파일을 수정할 권한이 없는 프로그램이 특수한 명령을 사용하여 파일을 삭제하거나 내용을 마음대로 되돌릴 수 있는 보안 구멍입니다. 보안 시스템이 막으려고 해도 이 특수한 명령을 통하면 보안 규칙을 피해갈 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
f2fs: Require FMODE_WRITE for atomic write ioctls
The F2FS ioctls for starting and committing atomic writes check for
inode_owner_or_capable(), but this does not give LSMs like SELinux or
Landlock an opportunity to deny the write access - if the caller's FSUID
matches the inode's UID, inode_owner_or_capable() immediately returns true.
There are scenarios where LSMs want to deny a process the ability to write
particular files, even files that the FSUID of the process owns; but this
can currently partially be bypassed using atomic write ioctls in two ways:
- F2FS_IOC_START_ATOMIC_REPLACE + F2FS_IOC_COMMIT_ATOMIC_WRITE can
truncate an inode to size 0
- F2FS_IOC_START_ATOMIC_WRITE + F2FS_IOC_ABORT_ATOMIC_WRITE can revert
changes another process concurrently made to a file
Fix it by requiring FMODE_WRITE for these operations, just like for
F2FS_IOC_MOVE_RANGE. Since any legitimate caller should only be using these
ioctls when intending to write into the file, that seems unlikely to break
anything.
📍 영향받는 시스템
F2FS 파일 시스템을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
권한이 제한된 프로세스가 F2FS 원자적 쓰기 관련 ioctl 명령을 호출하여 보안 정책을 우회함
🛡️ 대응 방법
F2FS 원자적 쓰기 작업 시 FMODE_WRITE 권한을 요구하도록 커널을 최신 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인