CVE-2022-49890

capabilities: fix potential memleak on error path from vfs_getxattr_alloc()

MEDIUM
5.5
CVSS Score
Published: May 1, 2025 at 02:10 PM UTC
Updated: June 17, 2026 at 05:19 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

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

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

4.14 ≤ v < 4.14.2994.14 ≤ v < 4.19.2654.14 ≤ v < 5.10.1544.14 ≤ v < 5.15.784.14 ≤ v < 5.4.2244.14 ≤ v < 6.0.84.14 ≤ v < 6.14.15 ≤ v < 4.19.2654.20 ≤ v < 5.4.2245.11 ≤ v < 5.15.785.16 ≤ v < 6.0.85.5 ≤ v < 5.10.1546.1 rc16.1 rc26.1 rc38db6c34f1dbc8e06aa016a9b829b06902c3e1340
Vendor states this is fixed in 0c3e6288da650d1ec911a259c77bc2d88e498603 (fixed)
Vendor states this is fixed in 2de8eec8afb75792440b8900a01d52b8f6742fd1 (fixed)
Vendor states this is fixed in 6bb00eb21c0fbf18e5d3538c9ff0cf63fd0ace85 (fixed)
Vendor states this is fixed in 7480aeff0093d8c54377553ec6b31110bea37b4d (fixed)
Vendor states this is fixed in 8cf0a1bc12870d148ae830a4ba88cfdf0e879cee (fixed)
Vendor states this is fixed in 90577bcc01c4188416a47269f8433f70502abe98 (fixed)
Vendor states this is fixed in cdf01c807e974048c43c7fd3ca574f6086a57906 (fixed)
Vendor states this is fixed in 4.14 (unaffected)
Vendor states this is fixed in 4.14.299 (unaffected)
Vendor states this is fixed in 4.19.265 (unaffected)
Vendor states this is fixed in 5.10.154 (unaffected)
Vendor states this is fixed in 5.15.78 (unaffected)
Vendor states this is fixed in 5.4.224 (unaffected)
Vendor states this is fixed in 6.0.8 (unaffected)
Vendor states this is fixed in 6.1 (unaffected)

References (7)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/0c3e6288da650d1ec911a259c77bc2d88e498603
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/2de8eec8afb75792440b8900a01d52b8f6742fd1
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/6bb00eb21c0fbf18e5d3538c9ff0cf63fd0ace85
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/7480aeff0093d8c54377553ec6b31110bea37b4d
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/8cf0a1bc12870d148ae830a4ba88cfdf0e879cee
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/90577bcc01c4188416a47269f8433f70502abe98
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/cdf01c807e974048c43c7fd3ca574f6086a57906

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

5.5MEDIUMCISA-ADP
Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-401

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card