CVE-2024-47740

Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
21/10/2024
Last modified:
03/11/2025

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> f2fs: Require FMODE_WRITE for atomic write ioctls<br /> <br /> The F2FS ioctls for starting and committing atomic writes check for<br /> inode_owner_or_capable(), but this does not give LSMs like SELinux or<br /> Landlock an opportunity to deny the write access - if the caller&amp;#39;s FSUID<br /> matches the inode&amp;#39;s UID, inode_owner_or_capable() immediately returns true.<br /> <br /> There are scenarios where LSMs want to deny a process the ability to write<br /> particular files, even files that the FSUID of the process owns; but this<br /> can currently partially be bypassed using atomic write ioctls in two ways:<br /> <br /> - F2FS_IOC_START_ATOMIC_REPLACE + F2FS_IOC_COMMIT_ATOMIC_WRITE can<br /> truncate an inode to size 0<br /> - F2FS_IOC_START_ATOMIC_WRITE + F2FS_IOC_ABORT_ATOMIC_WRITE can revert<br /> changes another process concurrently made to a file<br /> <br /> Fix it by requiring FMODE_WRITE for these operations, just like for<br /> F2FS_IOC_MOVE_RANGE. Since any legitimate caller should only be using these<br /> ioctls when intending to write into the file, that seems unlikely to break<br /> anything.

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 3.18 (including) 4.19.323 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 4.20 (including) 5.4.285 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.5 (including) 5.10.227 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.11 (including) 5.15.168 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.16 (including) 6.1.113 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.2 (including) 6.6.54 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.7 (including) 6.10.13 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.11 (including) 6.11.2 (excluding)