CVE-2026-43118 (GCVE-0-2026-43118)

Vulnerability from cvelistv5 – Published: 2026-05-06 07:40 – Updated: 2026-05-07 17:14
VLAI?
Title
btrfs: fix zero size inode with non-zero size after log replay
Summary
In the Linux kernel, the following vulnerability has been resolved: btrfs: fix zero size inode with non-zero size after log replay When logging that an inode exists, as part of logging a new name or logging new dir entries for a directory, we always set the generation of the logged inode item to 0. This is to signal during log replay (in overwrite_item()), that we should not set the i_size since we only logged that an inode exists, so the i_size of the inode in the subvolume tree must be preserved (as when we log new names or that an inode exists, we don't log extents). This works fine except when we have already logged an inode in full mode or it's the first time we are logging an inode created in a past transaction, that inode has a new i_size of 0 and then we log a new name for the inode (due to a new hardlink or a rename), in which case we log an i_size of 0 for the inode and a generation of 0, which causes the log replay code to not update the inode's i_size to 0 (in overwrite_item()). An example scenario: mkdir /mnt/dir xfs_io -f -c "pwrite 0 64K" /mnt/dir/foo sync xfs_io -c "truncate 0" -c "fsync" /mnt/dir/foo ln /mnt/dir/foo /mnt/dir/bar xfs_io -c "fsync" /mnt/dir <power fail> After log replay the file remains with a size of 64K. This is because when we first log the inode, when we fsync file foo, we log its current i_size of 0, and then when we create a hard link we log again the inode in exists mode (LOG_INODE_EXISTS) but we set a generation of 0 for the inode item we add to the log tree, so during log replay overwrite_item() sees that the generation is 0 and i_size is 0 so we skip updating the inode's i_size from 64K to 0. Fix this by making sure at fill_inode_item() we always log the real generation of the inode if it was logged in the current transaction with the i_size we logged before. Also if an inode created in a previous transaction is logged in exists mode only, make sure we log the i_size stored in the inode item located from the commit root, so that if we log multiple times that the inode exists we get the correct i_size. A test case for fstests will follow soon.
Severity ?
No CVSS data available.
Assigner
Impacted products
Vendor Product Version
Linux Linux Affected: 12fcfd22fe5bf4fe74710232098bc101af497995 , < fddb157536e67a055597f00a8b4922d5f5ed0826 (git)
Affected: 12fcfd22fe5bf4fe74710232098bc101af497995 , < 03e966b63df5b06790310c1faaf3e0cb43adea8b (git)
Affected: 12fcfd22fe5bf4fe74710232098bc101af497995 , < 5254d4181add9dfaa5e3519edd71cc8f752b2f85 (git)
Create a notification for this product.
    Linux Linux Affected: 2.6.30
Unaffected: 0 , < 2.6.30 (semver)
Unaffected: 6.18.24 , ≤ 6.18.* (semver)
Unaffected: 6.19.14 , ≤ 6.19.* (semver)
Unaffected: 7.0 , ≤ * (original_commit_for_fix)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/btrfs/tree-log.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "fddb157536e67a055597f00a8b4922d5f5ed0826",
              "status": "affected",
              "version": "12fcfd22fe5bf4fe74710232098bc101af497995",
              "versionType": "git"
            },
            {
              "lessThan": "03e966b63df5b06790310c1faaf3e0cb43adea8b",
              "status": "affected",
              "version": "12fcfd22fe5bf4fe74710232098bc101af497995",
              "versionType": "git"
            },
            {
              "lessThan": "5254d4181add9dfaa5e3519edd71cc8f752b2f85",
              "status": "affected",
              "version": "12fcfd22fe5bf4fe74710232098bc101af497995",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/btrfs/tree-log.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "2.6.30"
            },
            {
              "lessThan": "2.6.30",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.18.*",
              "status": "unaffected",
              "version": "6.18.24",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.19.*",
              "status": "unaffected",
              "version": "6.19.14",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "7.0",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.18.24",
                  "versionStartIncluding": "2.6.30",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.19.14",
                  "versionStartIncluding": "2.6.30",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "7.0",
                  "versionStartIncluding": "2.6.30",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: fix zero size inode with non-zero size after log replay\n\nWhen logging that an inode exists, as part of logging a new name or\nlogging new dir entries for a directory, we always set the generation of\nthe logged inode item to 0. This is to signal during log replay (in\noverwrite_item()), that we should not set the i_size since we only logged\nthat an inode exists, so the i_size of the inode in the subvolume tree\nmust be preserved (as when we log new names or that an inode exists, we\ndon\u0027t log extents).\n\nThis works fine except when we have already logged an inode in full mode\nor it\u0027s the first time we are logging an inode created in a past\ntransaction, that inode has a new i_size of 0 and then we log a new name\nfor the inode (due to a new hardlink or a rename), in which case we log\nan i_size of 0 for the inode and a generation of 0, which causes the log\nreplay code to not update the inode\u0027s i_size to 0 (in overwrite_item()).\n\nAn example scenario:\n\n  mkdir /mnt/dir\n  xfs_io -f -c \"pwrite 0 64K\" /mnt/dir/foo\n\n  sync\n\n  xfs_io -c \"truncate 0\" -c \"fsync\" /mnt/dir/foo\n\n  ln /mnt/dir/foo /mnt/dir/bar\n\n  xfs_io -c \"fsync\" /mnt/dir\n\n  \u003cpower fail\u003e\n\nAfter log replay the file remains with a size of 64K. This is because when\nwe first log the inode, when we fsync file foo, we log its current i_size\nof 0, and then when we create a hard link we log again the inode in exists\nmode (LOG_INODE_EXISTS) but we set a generation of 0 for the inode item we\nadd to the log tree, so during log replay overwrite_item() sees that the\ngeneration is 0 and i_size is 0 so we skip updating the inode\u0027s i_size\nfrom 64K to 0.\n\nFix this by making sure at fill_inode_item() we always log the real\ngeneration of the inode if it was logged in the current transaction with\nthe i_size we logged before. Also if an inode created in a previous\ntransaction is logged in exists mode only, make sure we log the i_size\nstored in the inode item located from the commit root, so that if we log\nmultiple times that the inode exists we get the correct i_size.\n\nA test case for fstests will follow soon."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-05-07T17:14:13.251Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/fddb157536e67a055597f00a8b4922d5f5ed0826"
        },
        {
          "url": "https://git.kernel.org/stable/c/03e966b63df5b06790310c1faaf3e0cb43adea8b"
        },
        {
          "url": "https://git.kernel.org/stable/c/5254d4181add9dfaa5e3519edd71cc8f752b2f85"
        }
      ],
      "title": "btrfs: fix zero size inode with non-zero size after log replay",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2026-43118",
    "datePublished": "2026-05-06T07:40:42.598Z",
    "dateReserved": "2026-05-01T14:12:55.987Z",
    "dateUpdated": "2026-05-07T17:14:13.251Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2026-43118",
      "date": "2026-05-10",
      "epss": "0.00012",
      "percentile": "0.01638"
    },
    "nvd": "{\"cve\":{\"id\":\"CVE-2026-43118\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2026-05-06T10:16:25.633\",\"lastModified\":\"2026-05-08T17:30:34.710\",\"vulnStatus\":\"Analyzed\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nbtrfs: fix zero size inode with non-zero size after log replay\\n\\nWhen logging that an inode exists, as part of logging a new name or\\nlogging new dir entries for a directory, we always set the generation of\\nthe logged inode item to 0. This is to signal during log replay (in\\noverwrite_item()), that we should not set the i_size since we only logged\\nthat an inode exists, so the i_size of the inode in the subvolume tree\\nmust be preserved (as when we log new names or that an inode exists, we\\ndon\u0027t log extents).\\n\\nThis works fine except when we have already logged an inode in full mode\\nor it\u0027s the first time we are logging an inode created in a past\\ntransaction, that inode has a new i_size of 0 and then we log a new name\\nfor the inode (due to a new hardlink or a rename), in which case we log\\nan i_size of 0 for the inode and a generation of 0, which causes the log\\nreplay code to not update the inode\u0027s i_size to 0 (in overwrite_item()).\\n\\nAn example scenario:\\n\\n  mkdir /mnt/dir\\n  xfs_io -f -c \\\"pwrite 0 64K\\\" /mnt/dir/foo\\n\\n  sync\\n\\n  xfs_io -c \\\"truncate 0\\\" -c \\\"fsync\\\" /mnt/dir/foo\\n\\n  ln /mnt/dir/foo /mnt/dir/bar\\n\\n  xfs_io -c \\\"fsync\\\" /mnt/dir\\n\\n  \u003cpower fail\u003e\\n\\nAfter log replay the file remains with a size of 64K. This is because when\\nwe first log the inode, when we fsync file foo, we log its current i_size\\nof 0, and then when we create a hard link we log again the inode in exists\\nmode (LOG_INODE_EXISTS) but we set a generation of 0 for the inode item we\\nadd to the log tree, so during log replay overwrite_item() sees that the\\ngeneration is 0 and i_size is 0 so we skip updating the inode\u0027s i_size\\nfrom 64K to 0.\\n\\nFix this by making sure at fill_inode_item() we always log the real\\ngeneration of the inode if it was logged in the current transaction with\\nthe i_size we logged before. Also if an inode created in a previous\\ntransaction is logged in exists mode only, make sure we log the i_size\\nstored in the inode item located from the commit root, so that if we log\\nmultiple times that the inode exists we get the correct i_size.\\n\\nA test case for fstests will follow soon.\"}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H\",\"baseScore\":5.5,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":3.6}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"NVD-CWE-noinfo\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"2.6.30\",\"versionEndExcluding\":\"6.18.24\",\"matchCriteriaId\":\"7560884D-457B-4E3F-9047-894A786C1273\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"6.19\",\"versionEndExcluding\":\"6.19.14\",\"matchCriteriaId\":\"D6A8A074-BBF4-4803-ABED-519A839435BB\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:*\",\"matchCriteriaId\":\"F253B622-8837-4245-BCE5-A7BF8FC76A16\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:*\",\"matchCriteriaId\":\"4AE85AD8-4641-4E7C-A2F4-305E2CD9EE64\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:7.0:rc3:*:*:*:*:*:*\",\"matchCriteriaId\":\"F666C8D8-6538-46D4-B318-87610DE64C34\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:7.0:rc4:*:*:*:*:*:*\",\"matchCriteriaId\":\"02259FDA-961B-47BC-AE7F-93D7EC6E90C2\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:7.0:rc5:*:*:*:*:*:*\",\"matchCriteriaId\":\"58A9FEFF-C040-420D-8F0A-BFDAAA1DF258\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/03e966b63df5b06790310c1faaf3e0cb43adea8b\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/5254d4181add9dfaa5e3519edd71cc8f752b2f85\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]},{\"url\":\"https://git.kernel.org/stable/c/fddb157536e67a055597f00a8b4922d5f5ed0826\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…
Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…