cve-2022-49890
Vulnerability from cvelistv5
Published
2025-05-01 14:10
Modified
2025-05-01 14:10
Severity ?
Summary
capabilities: fix potential memleak on error path from vfs_getxattr_alloc()
Impacted products
LinuxLinux
LinuxLinux
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "security/commoncap.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "6bb00eb21c0fbf18e5d3538c9ff0cf63fd0ace85",
              "status": "affected",
              "version": "8db6c34f1dbc8e06aa016a9b829b06902c3e1340",
              "versionType": "git"
            },
            {
              "lessThan": "90577bcc01c4188416a47269f8433f70502abe98",
              "status": "affected",
              "version": "8db6c34f1dbc8e06aa016a9b829b06902c3e1340",
              "versionType": "git"
            },
            {
              "lessThan": "0c3e6288da650d1ec911a259c77bc2d88e498603",
              "status": "affected",
              "version": "8db6c34f1dbc8e06aa016a9b829b06902c3e1340",
              "versionType": "git"
            },
            {
              "lessThan": "cdf01c807e974048c43c7fd3ca574f6086a57906",
              "status": "affected",
              "version": "8db6c34f1dbc8e06aa016a9b829b06902c3e1340",
              "versionType": "git"
            },
            {
              "lessThan": "2de8eec8afb75792440b8900a01d52b8f6742fd1",
              "status": "affected",
              "version": "8db6c34f1dbc8e06aa016a9b829b06902c3e1340",
              "versionType": "git"
            },
            {
              "lessThan": "7480aeff0093d8c54377553ec6b31110bea37b4d",
              "status": "affected",
              "version": "8db6c34f1dbc8e06aa016a9b829b06902c3e1340",
              "versionType": "git"
            },
            {
              "lessThan": "8cf0a1bc12870d148ae830a4ba88cfdf0e879cee",
              "status": "affected",
              "version": "8db6c34f1dbc8e06aa016a9b829b06902c3e1340",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "security/commoncap.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": "4.14.*",
              "status": "unaffected",
              "version": "4.14.299",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "4.19.*",
              "status": "unaffected",
              "version": "4.19.265",
              "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"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ncapabilities: fix potential memleak on error path from vfs_getxattr_alloc()\n\nIn cap_inode_getsecurity(), we will use vfs_getxattr_alloc() to\ncomplete the memory allocation of tmpbuf, if we have completed\nthe memory allocation of tmpbuf, but failed to call handler-\u003eget(...),\nthere will be a memleak in below logic:\n\n  |-- ret = (int)vfs_getxattr_alloc(mnt_userns, ...)\n    |           /* ^^^ alloc for tmpbuf */\n    |-- value = krealloc(*xattr_value, error + 1, flags)\n    |           /* ^^^ alloc memory */\n    |-- error = handler-\u003eget(handler, ...)\n    |           /* error! */\n    |-- *xattr_value = value\n    |           /* xattr_value is \u0026tmpbuf (memory leak!) */\n\nSo we will try to free(tmpbuf) after vfs_getxattr_alloc() fails to fix it.\n\n[PM: subject line and backtrace tweaks]"
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-05-01T14:10:34.481Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/6bb00eb21c0fbf18e5d3538c9ff0cf63fd0ace85"
        },
        {
          "url": "https://git.kernel.org/stable/c/90577bcc01c4188416a47269f8433f70502abe98"
        },
        {
          "url": "https://git.kernel.org/stable/c/0c3e6288da650d1ec911a259c77bc2d88e498603"
        },
        {
          "url": "https://git.kernel.org/stable/c/cdf01c807e974048c43c7fd3ca574f6086a57906"
        },
        {
          "url": "https://git.kernel.org/stable/c/2de8eec8afb75792440b8900a01d52b8f6742fd1"
        },
        {
          "url": "https://git.kernel.org/stable/c/7480aeff0093d8c54377553ec6b31110bea37b4d"
        },
        {
          "url": "https://git.kernel.org/stable/c/8cf0a1bc12870d148ae830a4ba88cfdf0e879cee"
        }
      ],
      "title": "capabilities: fix potential memleak on error path from vfs_getxattr_alloc()",
      "x_generator": {
        "engine": "bippy-1.1.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2022-49890",
    "datePublished": "2025-05-01T14:10:34.481Z",
    "dateReserved": "2025-05-01T14:05:17.242Z",
    "dateUpdated": "2025-05-01T14:10:34.481Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2022-49890\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-05-01T15:16:14.000\",\"lastModified\":\"2025-05-01T15:16:14.000\",\"vulnStatus\":\"Received\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\ncapabilities: fix potential memleak on error path from vfs_getxattr_alloc()\\n\\nIn cap_inode_getsecurity(), we will use vfs_getxattr_alloc() to\\ncomplete the memory allocation of tmpbuf, if we have completed\\nthe memory allocation of tmpbuf, but failed to call handler-\u003eget(...),\\nthere will be a memleak in below logic:\\n\\n  |-- ret = (int)vfs_getxattr_alloc(mnt_userns, ...)\\n    |           /* ^^^ alloc for tmpbuf */\\n    |-- value = krealloc(*xattr_value, error + 1, flags)\\n    |           /* ^^^ alloc memory */\\n    |-- error = handler-\u003eget(handler, ...)\\n    |           /* error! */\\n    |-- *xattr_value = value\\n    |           /* xattr_value is \u0026tmpbuf (memory leak!) */\\n\\nSo we will try to free(tmpbuf) after vfs_getxattr_alloc() fails to fix it.\\n\\n[PM: subject line and backtrace tweaks]\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/0c3e6288da650d1ec911a259c77bc2d88e498603\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/2de8eec8afb75792440b8900a01d52b8f6742fd1\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/6bb00eb21c0fbf18e5d3538c9ff0cf63fd0ace85\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/7480aeff0093d8c54377553ec6b31110bea37b4d\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/8cf0a1bc12870d148ae830a4ba88cfdf0e879cee\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/90577bcc01c4188416a47269f8433f70502abe98\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/cdf01c807e974048c43c7fd3ca574f6086a57906\",\"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.