cve-2022-49913
Vulnerability from cvelistv5
Published
2025-05-01 14:10
Modified
2025-05-04 08:48
Severity ?
Summary
btrfs: fix inode list leak during backref walking at find_parent_nodes()
Impacted products
LinuxLinux
LinuxLinux
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/btrfs/backref.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "6a6731a0df8c47ecc703bd7bb73459df767051e0",
              "status": "affected",
              "version": "86d5f994425252d8a40e2184c94a2682ae8ecfbf",
              "versionType": "git"
            },
            {
              "lessThan": "61e06128113711df0534c404fb6bb528eb7d2332",
              "status": "affected",
              "version": "86d5f994425252d8a40e2184c94a2682ae8ecfbf",
              "versionType": "git"
            },
            {
              "lessThan": "222a3d533027b9492d5b7f5ecdc01a90f57bb5a9",
              "status": "affected",
              "version": "86d5f994425252d8a40e2184c94a2682ae8ecfbf",
              "versionType": "git"
            },
            {
              "lessThan": "83ea8c5b54d452a5769e605e3c5c687e8ca06d89",
              "status": "affected",
              "version": "86d5f994425252d8a40e2184c94a2682ae8ecfbf",
              "versionType": "git"
            },
            {
              "lessThan": "92876eec382a0f19f33d09d2c939e9ca49038ae5",
              "status": "affected",
              "version": "86d5f994425252d8a40e2184c94a2682ae8ecfbf",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/btrfs/backref.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "4.14"
            },
            {
              "lessThan": "4.14",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.224",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.154",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.78",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.0.*",
              "status": "unaffected",
              "version": "6.0.8",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.1",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.4.224",
                  "versionStartIncluding": "4.14",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.10.154",
                  "versionStartIncluding": "4.14",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.78",
                  "versionStartIncluding": "4.14",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.0.8",
                  "versionStartIncluding": "4.14",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1",
                  "versionStartIncluding": "4.14",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: fix inode list leak during backref walking at find_parent_nodes()\n\nDuring backref walking, at find_parent_nodes(), if we are dealing with a\ndata extent and we get an error while resolving the indirect backrefs, at\nresolve_indirect_refs(), or in the while loop that iterates over the refs\nin the direct refs rbtree, we end up leaking the inode lists attached to\nthe direct refs we have in the direct refs rbtree that were not yet added\nto the refs ulist passed as argument to find_parent_nodes(). Since they\nwere not yet added to the refs ulist and prelim_release() does not free\nthe lists, on error the caller can only free the lists attached to the\nrefs that were added to the refs ulist, all the remaining refs get their\ninode lists never freed, therefore leaking their memory.\n\nFix this by having prelim_release() always free any attached inode list\nto each ref found in the rbtree, and have find_parent_nodes() set the\nref\u0027s inode list to NULL once it transfers ownership of the inode list\nto a ref added to the refs ulist passed to find_parent_nodes()."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-05-04T08:48:33.936Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/6a6731a0df8c47ecc703bd7bb73459df767051e0"
        },
        {
          "url": "https://git.kernel.org/stable/c/61e06128113711df0534c404fb6bb528eb7d2332"
        },
        {
          "url": "https://git.kernel.org/stable/c/222a3d533027b9492d5b7f5ecdc01a90f57bb5a9"
        },
        {
          "url": "https://git.kernel.org/stable/c/83ea8c5b54d452a5769e605e3c5c687e8ca06d89"
        },
        {
          "url": "https://git.kernel.org/stable/c/92876eec382a0f19f33d09d2c939e9ca49038ae5"
        }
      ],
      "title": "btrfs: fix inode list leak during backref walking at find_parent_nodes()",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2022-49913",
    "datePublished": "2025-05-01T14:10:54.899Z",
    "dateReserved": "2025-05-01T14:05:17.250Z",
    "dateUpdated": "2025-05-04T08:48:33.936Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2022-49913\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-05-01T15:16:16.477\",\"lastModified\":\"2025-05-02T13:52:51.693\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nbtrfs: fix inode list leak during backref walking at find_parent_nodes()\\n\\nDuring backref walking, at find_parent_nodes(), if we are dealing with a\\ndata extent and we get an error while resolving the indirect backrefs, at\\nresolve_indirect_refs(), or in the while loop that iterates over the refs\\nin the direct refs rbtree, we end up leaking the inode lists attached to\\nthe direct refs we have in the direct refs rbtree that were not yet added\\nto the refs ulist passed as argument to find_parent_nodes(). Since they\\nwere not yet added to the refs ulist and prelim_release() does not free\\nthe lists, on error the caller can only free the lists attached to the\\nrefs that were added to the refs ulist, all the remaining refs get their\\ninode lists never freed, therefore leaking their memory.\\n\\nFix this by having prelim_release() always free any attached inode list\\nto each ref found in the rbtree, and have find_parent_nodes() set the\\nref\u0027s inode list to NULL once it transfers ownership of the inode list\\nto a ref added to the refs ulist passed to find_parent_nodes().\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: btrfs: correcci\u00f3n de fuga de lista de inodos durante el recorrido de backref en find_parent_nodes() Durante el recorrido de backref, en find_parent_nodes(), si estamos tratando con una extensi\u00f3n de datos y obtenemos un error al resolver los backrefs indirectos, en resolve_indirect_refs(), o en el bucle while que itera sobre los refs en el rbtree de refs directos, terminamos filtrando las listas de inodos adjuntas a los refs directos que tenemos en el rbtree de refs directos que a\u00fan no se agregaron a la ulist de refs pasada como argumento a find_parent_nodes(). Dado que a\u00fan no se agregaron a la ulist de refs y prelim_release() no libera las listas, en caso de error, el llamador solo puede liberar las listas adjuntas a los refs que se agregaron a la ulist de refs, todas las referencias restantes obtienen sus listas de inodos nunca liberadas, por lo tanto, filtran su memoria. Para solucionar este problema, haga que prelim_release() siempre libere cualquier lista de inodos adjunta a cada referencia encontrada en el rbtree y que find_parent_nodes() establezca la lista de inodos de la referencia en NULL una vez que transfiera la propiedad de la lista de inodos a una referencia agregada a la lista de referencias pasada a find_parent_nodes().\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/222a3d533027b9492d5b7f5ecdc01a90f57bb5a9\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/61e06128113711df0534c404fb6bb528eb7d2332\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/6a6731a0df8c47ecc703bd7bb73459df767051e0\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/83ea8c5b54d452a5769e605e3c5c687e8ca06d89\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/92876eec382a0f19f33d09d2c939e9ca49038ae5\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading...

Loading...

Loading...
  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.