CVE-2022-49890

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49890
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49890.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49890
Downstream
Related
Published
2025-05-01T15:16:14Z
Modified
2025-08-09T20:01:26Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
[none]
Details

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

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

In capinodegetsecurity(), we will use vfsgetxattralloc() 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)vfsgetxattralloc(mntuserns, ...) | /* ^^^ alloc for tmpbuf */ |-- value = krealloc(*xattrvalue, 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 vfsgetxattralloc() fails to fix it.

[PM: subject line and backtrace tweaks]

References

Affected packages