CWE
401
Advisory Published
Updated

CVE-2022-49890: capabilities: fix potential memleak on error path from vfs_getxattr_alloc()

First published: Thu May 01 2025(Updated: )

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]

Credit: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Affected SoftwareAffected VersionHow to fix
Linux Kernel
Linux Kernel>=4.14<4.14.299
Linux Kernel>=4.15<4.19.265
Linux Kernel>=4.20<5.4.224
Linux Kernel>=5.5<5.10.154
Linux Kernel>=5.11<5.15.78
Linux Kernel>=5.16<6.0.8
Linux Kernel=6.1-rc1
Linux Kernel=6.1-rc2
Linux Kernel=6.1-rc3

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

  • What is the severity of CVE-2022-49890?

    The CVE-2022-49890 vulnerability has a low severity rating due to the specific conditions needed for exploitation.

  • How do I fix CVE-2022-49890?

    To mitigate CVE-2022-49890, update to the latest version of the Linux Kernel where the vulnerability has been patched.

  • What is the impact of CVE-2022-49890?

    CVE-2022-49890 could potentially lead to a memory leak in the Linux kernel during the execution of specific operations.

  • Is CVE-2022-49890 remotely exploitable?

    CVE-2022-49890 is not considered to be remotely exploitable as it requires local access to the affected system.

  • What versions of the Linux Kernel are affected by CVE-2022-49890?

    CVE-2022-49890 affects multiple versions of the Linux Kernel prior to the security patch release.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203