Vulnerability · Published May 20, 2024 · Assigned by Linux

CVE-2024-36001netfs: Fix the pre-flush when appending to a file in writethrough mode

High 7.8

In plain English

A high-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 11% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.8High
Exploit odds (30 days)0.2%top 89.3% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

In the Linux kernel, the following vulnerability has been resolved: netfs: Fix the pre-flush when appending to a file in writethrough mode In netfs_perform_write(), when the file is marked NETFS_ICTX_WRITETHROUGH or O_*SYNC or RWF_*SYNC was specified, write-through caching is performed on a buffered file. When setting up for write-through, we flush any conflicting writes in the region and wait for the write to complete, failing if there's a write error to return. The issue arises if we're writing at or above the EOF position because we skip the flush and - more importantly - the wait. This becomes a problem if there's a partial folio at the end of the file that is being written out and we want to make a write to it too. Both the already-running write and the write we start both want to clear the writeback mark, but whoever is second causes a warning looking something like: ------------[ cut here ]------------ R=00000012: folio 11 is not under writeback WARNING: CPU: 34 PID: 654 at fs/netfs/write_collect.c:105 ... CPU: 34 PID: 654 Comm: kworker/u386:27 Tainted: G S ... ... Workqueue: events_unbound netfs_write_collection_worker ... RIP: 0010:netfs_writeback_lookup_folio Fix this by making the flush-and-wait unconditional. It will do nothing if there are no folios in the pagecache and will return quickly if there are no folios in the region specified. Further, move the WBC attachment above the flush call as the flush is going to attach a WBC and detach it again if it is not present - and since we need one anyway we might as well share it.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:13linux6.8.9-1DEBIAN-CVE-2024-36001
Debian:14linux6.8.9-1DEBIAN-CVE-2024-36001
Ubuntu:24.04:LTSlinux6.8.0-40.40UBUNTU-CVE-2024-36001
Ubuntu:24.04:LTSlinux6.8.0-40.40USN-6949-1
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-36001
Ubuntu:24.04:LTSlinux-aws6.8.0-1013.14USN-6949-1
Ubuntu:24.04:LTSlinux-aws6.8.0-1013.14UBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-aws-6.86.8.0-1013.14~22.04.1UBUNTU-CVE-2024-36001
Ubuntu:24.04:LTSlinux-azure6.8.0-1012.14UBUNTU-CVE-2024-36001
Ubuntu:24.04:LTSlinux-azure6.8.0-1012.14USN-6952-2
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-azure-6.86.8.0-1012.14~22.04.1UBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-36001
Ubuntu:24.04:LTSlinux-gcp6.8.0-1012.13USN-6949-1
Ubuntu:24.04:LTSlinux-gcp6.8.0-1012.13UBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-gcp-6.86.8.0-1012.13~22.04.1UBUNTU-CVE-2024-36001
Ubuntu:24.04:LTSlinux-gke6.8.0-1008.11UBUNTU-CVE-2024-36001
Ubuntu:24.04:LTSlinux-gke6.8.0-1008.11USN-6949-1
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-hwe-6.86.8.0-40.40~22.04.3UBUNTU-CVE-2024-36001
Ubuntu:24.04:LTSlinux-ibm6.8.0-1010.10UBUNTU-CVE-2024-36001
Ubuntu:24.04:LTSlinux-ibm6.8.0-1010.10USN-6949-1
Ubuntu:22.04:LTSlinux-intel-iot-realtimeno fix listedUBUNTU-CVE-2024-36001
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-40.40.1USN-6949-2
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-40.40.1UBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.86.8.0-40.40.1~22.04.1UBUNTU-CVE-2024-36001
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1011.11USN-6949-1
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1011.11UBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1011.11~22.04.1USN-6949-1
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1011.11~22.04.1UBUNTU-CVE-2024-36001
Ubuntu:24.04:LTSlinux-nvidia-lowlatency6.8.0-1011.11.1USN-6952-1
Ubuntu:24.04:LTSlinux-nvidia-lowlatency6.8.0-1011.11.1UBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-36001
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1010.10UBUNTU-CVE-2024-36001
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1010.10USN-6955-1
Ubuntu:24.04:LTSlinux-oracle6.8.0-1010.10USN-6952-1
Ubuntu:24.04:LTSlinux-oracle6.8.0-1010.10UBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-oracle-6.86.8.0-1010.10~22.04.1UBUNTU-CVE-2024-36001
Ubuntu:24.04:LTSlinux-raspi6.8.0-1009.10USN-6949-2
Ubuntu:24.04:LTSlinux-raspi6.8.0-1009.10UBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-36001
Ubuntu:24.04:LTSlinux-riscv6.8.0-40.40.1UBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-riscv-6.86.8.0-40.40.1~22.04.1UBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-36001
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-36001

Affected products (as reported)

VendorProductVersions
Linux Linux 41d8e7673a7726cba57cb8112d81c89cfb6c3e35 – before 5eaf23b2e81349f6614f88396dc468fda89fc0b941d8e7673a7726cba57cb8112d81c89cfb6c3e35 – before c97f59e276d4e93480f29a70accbd0d7273cf3f5
Linux Linux 6.8

References