Categories
CVE-2022-49648

tracing/histograms: Fix memory leak problem

Summary

tracing/histograms: Fix memory leak problem

Original description

The description as published by the source.

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 parse_var_defs() if there is a problem allocating
var_defs.expr, the earlier var_defs.name is freed.
This free is duplicated by free_var_defs() which frees
the rest of the list.

However, if there is a problem allocating N-th var_defs.expr:

  • in parse_var_defs(), the freed 'earlier var_defs.name' is
    actually the N-th var_defs.name;

  • then in free_var_defs(), the names from 0th to (N-1)-th are freed;

                    IF ALLOCATING PROBLEM HAPPENED HERE!!! -+
                                                             \
                                                              |
      0th           1th                 (N-1)-th      N-th    V
      +-------------+-------------+-----+-------------+-----------
    

var_defs: | 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 var_defs.name" is not freed.

If enable CONFIG_DEBUG_KMEMLEAK and inject a fault at where the N-th
var_defs.expr al…

Source: OSV.dev (Open Source Vulnerabilities) NVD OSV

Affected packages

Linux Kernel
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.19.253"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.20.0"},{"fixed":"5.4.207"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.5.0"},{"fixed":"5.10.132"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.9.0"},{"fixed":"5.15.56"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.18.13"}]}]

Fix status by distribution

Fixed packages published by each distribution for this CVE

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details