CVE-2022-49648: tracing/histograms: Fix memory leak problem

Published Feb 26, 2025
·
Updated

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

tracing/histograms: Fix memory leak problem

This reverts commit 46bbe5c671e06f070428b9be142cc4ee5cedebac.

As commit 46bbe5c671e0 ("tracing: fix double free") said, the "double free" problem reported by clang static analyzer is: In parsevardefs() if there is a problem allocating vardefs.expr, the earlier vardefs.name is freed. This free is duplicated by freevardefs() which frees the rest of the list.

However, if there is a problem allocating N-th vardefs.expr: + in parsevardefs(), the freed 'earlier vardefs.name' is actually the N-th vardefs.name; + then in freevardefs(), the names from 0th to (N-1)-th are freed;

IF ALLOCATING PROBLEM HAPPENED HERE!!! -+ \ | 0th 1th (N-1)-th N-th V +-------------+-------------+-----+-------------+----------- vardefs: | name | expr | name | expr | ... | name | expr | name | /// +-------------+-------------+-----+-------------+-----------

These two frees don't act on same name, so there was no "double free" problem before. Conversely, after that commit, we get a "memory leak" problem because the above "N-th vardefs.name" is not freed.

If enable CONFIGDEBUGKMEMLEAK and inject a fault at where the N-th vardefs.expr allocated, then execute on shell like: $ echo 'hist:key=callsite:val=$v1,$v2:v1=bytesreq,v2=bytesalloc' \ /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger

Then kmemleak reports: unreferenced object 0xffff8fb100ef3518 (size 8): comm "bash", pid 196, jiffies 4295681690 (age 28.538s) hex dump (first 8 bytes): 76 31 00 00 b1 8f ff ff v1...... backtrace: [0000000038fe4895] kstrdup+0x2d/0x60 [00000000c99c049a] eventhisttriggerparse+0x206f/0x20e0 [00000000ae70d2cc] triggerprocessregex+0xc0/0x110 [0000000066737a4c] eventtriggerwrite+0x75/0xd0 [000000007341e40c] vfswrite+0xbb/0x2a0 [0000000087fde4c2] ksyswrite+0x59/0xd0 [00000000581e9cdf] dosyscall64+0x3a/0x80 [00000000cf3b065c] entrySYSCALL64afterhwframe+0x46/0xb0

Other sources

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

tracing/histograms: Fix memory leak problem

This reverts commit 46bbe5c671e06f070428b9be142cc4ee5cedebac.

As commit 46bbe5c671e0 ("tracing: fix double free") said, the "double free" problem reported by clang static analyzer is: > In parsevardefs() if there is a problem allocating > vardefs.expr, the earlier vardefs.name is freed. > This free is duplicated by freevardefs() which frees > the rest of the list.

However, if there is a problem allocating N-th vardefs.expr: + in parsevardefs(), the freed 'earlier vardefs.name' is actually the N-th vardefs.name; + then in freevardefs(), the names from 0th to (N-1)-th are freed;

IF ALLOCATING PROBLEM HAPPENED HERE!!! -+ \ | 0th 1th (N-1)-th N-th V +-------------+-------------+-----+-------------+----------- vardefs: | name | expr | name | expr | ... | name | expr | name | /// +-------------+-------------+-----+-------------+-----------

These two frees don't act on same name, so there was no "double free" problem before. Conversely, after that commit, we get a "memory leak" problem because the above "N-th vardefs.name" is not freed.

If enable CONFIGDEBUGKMEMLEAK and inject a fault at where the N-th vardefs.expr allocated, then execute on shell like: $ echo 'hist:key=callsite:val=$v1,$v2:v1=bytesreq,v2=bytesalloc' > \ /sys/kernel/debug/tracing/events/kmem/kmalloc/trigger

Then kmemleak reports: unreferenced object 0xffff8fb100ef3518 (size 8): comm "bash", pid 196, jiffies 4295681690 (age 28.538s) hex dump (first 8 bytes): 76 31 00 00 b1 8f ff ff v1...... backtrace: [<0000000038fe4895>] kstrdup+0x2d/0x60 [<00000000c99c049a>] eventhisttriggerparse+0x206f/0x20e0 [<00000000ae70d2cc>] triggerprocessregex+0xc0/0x110 [<0000000066737a4c>] eventtriggerwrite+0x75/0xd0 [<000000007341e40c>] vfswrite+0xbb/0x2a0 [<0000000087fde4c2>] ksyswrite+0x59/0xd0 [<00000000581e9cdf>] dosyscall64+0x3a/0x80 [<00000000cf3b065c>] entrySYSCALL64afterhwframe+0x46/0xb0

NVD

Affected Software

16 affected components
Linux Linux kernel
Linux Linux kernel>=4.19.149<4.19.253
Linux Linux kernel>=5.4.69<5.4.207
Linux Linux kernel>=5.8.13<5.10.132
Linux Linux kernel>=5.11<5.15.56
Linux Linux kernel>=5.16<5.18.13
Linux Linux kernel=5.19-rc1
Linux Linux kernel=5.19-rc2
Linux Linux kernel=5.19-rc3
Linux Linux kernel=5.19-rc4
Linux Linux kernel=5.19-rc5
Linux Linux kernel=5.19-rc6
IBM Verify Identity Access<=11.0 - 11.0.2
IBM Security Verify Access<=10.0 - 10.0.9.1
IBM Verify Identity Access Container<=11.0 - 11.0.2
IBM Security Verify Access Container<=10.0 - 10.0.9.1

Event History

Feb 26, 2025
CVE Published
via MITRE·02:23 AM
Data Sourced
via MITRE·02:23 AM
Description
Data Sourced
via Red Hat·03:23 AM
DescriptionSeverityAffected Software
Data Sourced
via NVD·07:01 AM
RemedyDescriptionSeverityWeaknessAffected Software
Jul 8, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2022-49648?

CVE-2022-49648 has not been assigned a CVSS score, but it addresses a memory leak vulnerability in the Linux kernel.

2

How do I fix CVE-2022-49648?

To fix CVE-2022-49648, you should update to the latest Linux kernel version that contains the patch for this vulnerability.

3

What versions of the Linux kernel are affected by CVE-2022-49648?

CVE-2022-49648 affects several versions of the Linux kernel, including versions between 4.19.149 to 4.19.253, 5.4.69 to 5.4.207, and others as detailed in the vulnerability report.

4

Is CVE-2022-49648 a critical vulnerability?

While CVE-2022-49648 may lead to resource leaks, its criticality depends on the specific system configuration and usage.

5

Can CVE-2022-49648 lead to system crashes?

CVE-2022-49648 primarily involves a memory leak that could potentially lead to performance degradation but not necessarily a system crash.

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.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203