Memory Leak Affecting kernel-tools package, versions *


Severity

Recommended
0.0
medium
0
10

Based on CentOS security rating.

Threat Intelligence

EPSS
0.02% (6th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Memory Leak vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-CENTOS7-KERNELTOOLS-9944944
  • published2 May 2025
  • disclosed1 May 2025

Introduced: 1 May 2025

NewCVE-2022-49890  (opens in a new tab)
CWE-401  (opens in a new tab)

How to fix?

There is no fixed version for Centos:7 kernel-tools.

NVD Description

Note: Versions mentioned in the description apply only to the upstream kernel-tools package and not the kernel-tools package as distributed by Centos. See How to fix? for Centos:7 relevant fixed versions and status.

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]

CVSS Base Scores

version 3.1