Bug 2347852 (CVE-2022-49410)

Summary: CVE-2022-49410 kernel: tracing: Fix potential double free in create_var_ref()
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: dfreiber, drow, jburrell, vkumar
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A double-free vulnerability has been identified within the Linux kernel. This issue arises from a sequence of function calls involving create_hist_field(), init_var_ref(), and destroy_hist_field(). Specifically, init_var_ref() allocates memory for fields within a variable (ref_field->system). However, if an error occurs within init_var_ref(), these newly allocated fields are prematurely freed. Subsequently, the calling function invokes destroy_hist_field() as part of its error handling routine. This function then attempts to free the same fields, along with the variable itself, resulting in a double-free condition. Successful exploitation can lead to memory corruption and potentially a denial-of-service.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description OSIDB Bzimport 2025-02-26 03:09:00 UTC
In the Linux kernel, the following vulnerability has been resolved:

tracing: Fix potential double free in create_var_ref()

In create_var_ref(), init_var_ref() is called to initialize the fields
of variable ref_field, which is allocated in the previous function call
to create_hist_field(). Function init_var_ref() allocates the
corresponding fields such as ref_field->system, but frees these fields
when the function encounters an error. The caller later calls
destroy_hist_field() to conduct error handling, which frees the fields
and the variable itself. This results in double free of the fields which
are already freed in the previous function.

Fix this by storing NULL to the corresponding fields when they are freed
in init_var_ref().

Comment 1 Avinash Hanwate 2025-02-26 14:36:46 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025022652-CVE-2022-49410-de6a@gregkh/T

Comment 4 Avinash Hanwate 2025-02-26 18:38:24 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025022652-CVE-2022-49410-de6a@gregkh/T