f2fs: Require FMODE_WRITE for atomic write ioctls
Published Oct 21, 2024
7.1
HIGHCVSS 3.1
EPSS 0.23%
Description
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.
Affected products
-
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version
-
- Version 3.18StatusaffectedConstraints-
- Version 0StatusunaffectedConstraints<3.18
- Version 4.19.323StatusunaffectedConstraints<=4.19.*
- Version 5.10.227StatusunaffectedConstraints<=5.10.*
- Version 5.15.168StatusunaffectedConstraints<=5.15.*
- Version 5.4.285StatusunaffectedConstraints<=5.4.*
- Version 6.1.113StatusunaffectedConstraints<=6.1.*
- Version 6.10.13StatusunaffectedConstraints<=6.10.*
- Version 6.11.2StatusunaffectedConstraints<=6.11.*
- Version 6.12StatusunaffectedConstraints<=*
- Version 6.6.54StatusunaffectedConstraints<=6.6.*
- Version
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
| Vendor | Product | Default status | Versions | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Linux | Linux | unaffected |
| ||||||||||||||||||||||||||||||||||||
| Linux | Linux | affected |
|
- ≥ 3.18 · < 4.19.323
- ≥ 4.20 · < 5.4.285
- ≥ 5.5 · < 5.10.227
- ≥ 5.11 · < 5.15.168
- ≥ 5.16 · < 6.1.113
- ≥ 6.2 · < 6.6.54
- ≥ 6.7 · < 6.10.13
- ≥ 6.11 · < 6.11.2
No data.
Red Hat Enterprise Linux 6
kernel
Not affected
Red Hat Enterprise Linux 7
kernel
Not affected
Red Hat Enterprise Linux 7
kernel-rt
Not affected
Red Hat Enterprise Linux 8
kernel
Not affected
Red Hat Enterprise Linux 8
kernel-rt
Not affected
Red Hat Enterprise Linux 9
kernel
Not affected
Red Hat Enterprise Linux 9
kernel-rt
Not affected
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 6 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 7 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 7 | kernel-rt | Not affected | n/a |
| Red Hat Enterprise Linux 8 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 8 | kernel-rt | Not affected | n/a |
| Red Hat Enterprise Linux 9 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 9 | kernel-rt | Not affected | n/a |
No package ranges for this CVE.
Remediation
No remediation recorded yet.
References (17)
- https://access.redhat.com/security/cve/CVE-2024-47740 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=2320193 Issue Tracking
- https://euvd.enisa.europa.eu/vulnerability/EUVD-2024-42657 Advisory
- https://git.kernel.org/stable/c/000bab8753ae29a259feb339b99ee759795a48ac Patch
- https://git.kernel.org/stable/c/32f348ecc149e9ca70a1c424ae8fa9b6919d2713 Patch
- https://git.kernel.org/stable/c/4583290898c13c2c2e5eb8773886d153c2c5121d Patch
- https://git.kernel.org/stable/c/4ce87674c3a6b4d3b3d45f85b584ab8618a3cece Patch
- https://git.kernel.org/stable/c/4f5a100f87f32cb65d4bb1ad282a08c92f6f591e Patch
- https://git.kernel.org/stable/c/5e0de753bfe87768ebe6744d869caa92f35e5731 Patch
- https://git.kernel.org/stable/c/700f3a7c7fa5764c9f24bbf7c78e0b6e479fa653 Patch
- https://git.kernel.org/stable/c/88ff021e1fea2d9b40b2d5efd9013c89f7be04ac Patch
- https://git.kernel.org/stable/c/f3bfac2cabf5333506b263bc0c8497c95302f32d Patch
- https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html
- https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html
- https://lore.kernel.org/linux-cve-announce/2024102109-CVE-2024-47740-ae86@gregkh/T
- https://nvd.nist.gov/vuln/detail/CVE-2024-47740
- https://www.cve.org/CVERecord?id=CVE-2024-47740
Change history (0)
No recorded changes yet.