CVE-2022-49890: capabilities: fix potential memleak on error path from vfs_getxattr_alloc()
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]
Security readout for executives and security teams
Plain-English summary
This is a Linux kernel memory leak in an error path for capability extended-attribute handling. A local low-privileged user could potentially drive kernel memory consumption and affect availability. The source bundle does not show data theft, data modification, remote access, or confirmed active exploitation.
Executive priority
Treat as routine but real availability risk. Patch through normal kernel maintenance, prioritizing shared Linux hosts and environments with untrusted local users or workloads. No emergency remote-exploitation signal is present in the supplied sources.
Technical view
cap_inode_getsecurity() can leak memory when vfs_getxattr_alloc() allocates tmpbuf and handler->get() later fails. The issue is classified as CWE-401 with CVSS 5.5, local attack vector, low privileges required, no user interaction, and high availability impact only.
Likely exposure
Exposure is most relevant on Linux systems running affected kernel versions or downstream packages containing the vulnerable capability xattr code. The bundle indicates local access is required; no network attack vector is identified.
Exploitation context
The bundle marks KEV as false and provides no cited evidence of active exploitation. Any exploitation assessment should stay limited to local availability impact unless vendor advisories add more detail.
Researcher notes
Evidence supports a kernel memory leak in an error path, not a confidentiality or integrity issue. Affected-version data in the bundle is coarse; researchers should map downstream kernels to the referenced stable commits and distribution backports before declaring exposure.
Mitigation direction
Inventory Linux kernel versions across servers, containers hosts, appliances, and embedded systems.
Apply vendor kernel updates that include the referenced stable Linux fixes.
Check distribution advisories for exact package names and fixed build numbers.
Prioritize multi-user systems and hosts running untrusted local workloads.
Monitor CVE and vendor guidance for any exploitation-status changes.
Validation and detection
Compare running kernel versions with vendor fixed package guidance.
Confirm whether kernel source includes one of the referenced stable commits.
Review asset inventory for systems allowing local shell or workload execution.
Check vulnerability scanner logic against distribution backport metadata.
Validate update deployment with normal kernel version and package checks.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-401: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-401 · source CWE mapping
Missing Release of Memory after Effective Lifetime
Missing Release of Memory after Effective Lifetime represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.