# CVE-2022-49890: capabilities: fix potential memleak on error path from vfs\_getxattr\_alloc()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.29% (percentile 14, 2026-11-26)
- **CWE:** CWE-401
- **Published:** 2025-05-01T14:10:34.481Z
- **Modified:** 2026-06-17T05:19:26.050Z

## Who should check

- Anyone running Linux \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 6bb00eb21c0fbf18e5d3538c9ff0cf63fd0ace85; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 90577bcc01c4188416a47269f8433f70502abe98; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 0c3e6288da650d1ec911a259c77bc2d88e498603; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< cdf01c807e974048c43c7fd3ca574f6086a57906; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 2de8eec8afb75792440b8900a01d52b8f6742fd1; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 7480aeff0093d8c54377553ec6b31110bea37b4d; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 8cf0a1bc12870d148ae830a4ba88cfdf0e879cee
- Anyone running Linux 4.14

## Description

In the Linux kernel, the following vulnerability has been resolved:

capabilities: fix potential memleak on error path from vfs\_getxattr\_alloc()

In cap\_inode\_getsecurity(), we will use vfs\_getxattr\_alloc() to
complete the memory allocation of tmpbuf, if we have completed
the memory allocation of tmpbuf, but failed to call handler-\>get(...),
there will be a memleak in below logic:

  \|-- ret = (int)vfs\_getxattr\_alloc(mnt\_userns, ...)
    \|           /\* ^^^ alloc for tmpbuf \*/
    \|-- value = krealloc(\*xattr\_value, error + 1, flags)
    \|           /\* ^^^ alloc memory \*/
    \|-- error = handler-\>get(handler, ...)
    \|           /\* error! \*/
    \|-- \*xattr\_value = value
    \|           /\* xattr\_value is &tmpbuf (memory leak!) \*/

So we will try to free(tmpbuf) after vfs\_getxattr\_alloc() fails to fix it.

\[PM: subject line and backtrace tweaks\]

## Affected and fixed versions

- Linux: \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 6bb00eb21c0fbf18e5d3538c9ff0cf63fd0ace85; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 90577bcc01c4188416a47269f8433f70502abe98; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 0c3e6288da650d1ec911a259c77bc2d88e498603; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< cdf01c807e974048c43c7fd3ca574f6086a57906; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 2de8eec8afb75792440b8900a01d52b8f6742fd1; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 7480aeff0093d8c54377553ec6b31110bea37b4d; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 8cf0a1bc12870d148ae830a4ba88cfdf0e879cee (cvelist)
- Linux: 4.14 (cvelist)

## Mitigation

- Upgrade Linux to 8cf0a1bc12870d148ae830a4ba88cfdf0e879cee or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-49890. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-49890.md
Affected: Linux >= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, < 6bb00eb21c0fbf18e5d3538c9ff0cf63fd0ace85; >= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, < 90577bcc01c4188416a47269f8433f70502abe98; >= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, < 0c3e6288da650d1ec911a259c77bc2d88e498603; >= 8db6c34f1dbc8e06aa016a9…
Fixed in: Linux 6bb00eb21c0fbf18e5d3538c9ff0cf63fd0ace85, Linux 90577bcc01c4188416a47269f8433f70502abe98, Linux 0c3e6288da650d1ec911a259c77bc2d88e498603, Linux 2de8eec8afb75792440b8900a01d52b8f6742fd1, Linux 7480aeff0093d8c54377553ec6b31110bea37b4d, Linux 8cf0a1bc12870d148ae830a4ba88cfdf0e879cee

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-49890 being exploited?

There is no confirmed exploitation: CVE-2022-49890 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.29% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-49890?

Medium: CVSS 5.5 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-49890?

Linux \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 6bb00eb21c0fbf18e5d3538c9ff0cf63fd0ace85; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 90577bcc01c4188416a47269f8433f70502abe98; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 0c3e6288da650d1ec911a259c77bc2d88e498603; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< cdf01c807e974048c43c7fd3ca574f6086a57906; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 2de8eec8afb75792440b8900a01d52b8f6742fd1; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 7480aeff0093d8c54377553ec6b31110bea37b4d; \>= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, \< 8cf0a1bc12870d148ae830a4ba88cfdf0e879cee; Linux 4.14.

### Is there a fix for CVE-2022-49890?

Yes. Fixed in Linux 6bb00eb21c0fbf18e5d3538c9ff0cf63fd0ace85, Linux 90577bcc01c4188416a47269f8433f70502abe98, Linux 0c3e6288da650d1ec911a259c77bc2d88e498603, Linux 2de8eec8afb75792440b8900a01d52b8f6742fd1, Linux 7480aeff0093d8c54377553ec6b31110bea37b4d, Linux 8cf0a1bc12870d148ae830a4ba88cfdf0e879cee. Upgrade Linux to 8cf0a1bc12870d148ae830a4ba88cfdf0e879cee or later.

### How do I check if I'm affected by CVE-2022-49890?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/6bb00eb21c0fbf18e5d3538c9ff0cf63fd0ace85>
- patch: <https://git.kernel.org/stable/c/90577bcc01c4188416a47269f8433f70502abe98>
- patch: <https://git.kernel.org/stable/c/0c3e6288da650d1ec911a259c77bc2d88e498603>
- patch: <https://git.kernel.org/stable/c/cdf01c807e974048c43c7fd3ca574f6086a57906>
- patch: <https://git.kernel.org/stable/c/2de8eec8afb75792440b8900a01d52b8f6742fd1>
- patch: <https://git.kernel.org/stable/c/7480aeff0093d8c54377553ec6b31110bea37b4d>
- patch: <https://git.kernel.org/stable/c/8cf0a1bc12870d148ae830a4ba88cfdf0e879cee>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-49890>

HTML: <https://flawdb.com/CVE-2022-49890> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-49890>
