CVE-2022-49513 in Linuxinfo

Summary

by MITRE • 02/26/2025

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

cpufreq: governor: Use kobject release() method to free dbs_data

The struct dbs_data embeds a struct gov_attr_set and the struct gov_attr_set embeds a kobject. Since every kobject must have a release() method and we can't use kfree() to free it directly, so introduce cpufreq_dbs_data_release() to release the dbs_data via the kobject::release() method. This fixes the calltrace like below:

ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x34 WARNING: CPU: 12 PID: 810 at lib/debugobjects.c:505 debug_print_object+0xb8/0x100 Modules linked in: CPU: 12 PID: 810 Comm: sh Not tainted 5.16.0-next-20220120-yocto-standard+ #536 Hardware name: Marvell OcteonTX CN96XX board (DT) pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : debug_print_object+0xb8/0x100 lr : debug_print_object+0xb8/0x100 sp : ffff80001dfcf9a0 x29: ffff80001dfcf9a0 x28: 0000000000000001 x27: ffff0001464f0000 x26: 0000000000000000 x25: ffff8000090e3f00 x24: ffff80000af60210 x23: ffff8000094dfb78 x22: ffff8000090e3f00 x21: ffff0001080b7118 x20: ffff80000aeb2430 x19: ffff800009e8f5e0 x18: 0000000000000000 x17: 0000000000000002 x16: 00004d62e58be040 x15: 013590470523aff8 x14: ffff8000090e1828 x13: 0000000001359047 x12: 00000000f5257d14 x11: 0000000000040591 x10: 0000000066c1ffea x9 : ffff8000080d15e0 x8 : ffff80000a1765a8 x7 : 0000000000000000 x6 : 0000000000000001 x5 : ffff800009e8c000 x4 : ffff800009e8c760 x3 : 0000000000000000 x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0001474ed040 Call trace: debug_print_object+0xb8/0x100 __debug_check_no_obj_freed+0x1d0/0x25c debug_check_no_obj_freed+0x24/0xa0 kfree+0x11c/0x440 cpufreq_dbs_governor_exit+0xa8/0xac cpufreq_exit_governor+0x44/0x90 cpufreq_set_policy+0x29c/0x570 store_scaling_governor+0x110/0x154 store+0xb0/0xe0 sysfs_kf_write+0x58/0x84 kernfs_fop_write_iter+0x12c/0x1c0 new_sync_write+0xf0/0x18c vfs_write+0x1cc/0x220 ksys_write+0x74/0x100 __arm64_sys_write+0x28/0x3c invoke_syscall.constprop.0+0x58/0xf0 do_el0_svc+0x70/0x170 el0_svc+0x54/0x190 el0t_64_sync_handler+0xa4/0x130 el0t_64_sync+0x1a0/0x1a4 irq event stamp: 189006 hardirqs last enabled at (189005): [] finish_task_switch.isra.0+0xe0/0x2c0
hardirqs last disabled at (189006): [] el1_dbg+0x24/0xa0
softirqs last enabled at (188966): [] __do_softirq+0x4b0/0x6a0
softirqs last disabled at (188957): [] __irq_exit_rcu+0x108/0x1a4

[ rjw: Because can be freed by the gov_attr_set_put() in
cpufreq_dbs_governor_exit() now, it is also necessary to put the invocation of the governor ->exit() callback into the new cpufreq_dbs_data_release() function. ]

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 10/21/2025

The vulnerability described in CVE-2022-49513 resides within the Linux kernel's cpufreq subsystem, specifically concerning the improper handling of memory allocation and deallocation for the dbs_data structure. This flaw manifests when the kernel attempts to free memory associated with a cpufreq governor, particularly during system shutdown or governor transitions. The dbs_data structure contains embedded components including gov_attr_set, which in turn embeds a kobject. As per kernel object management conventions, kobjects must be freed using their designated release() method rather than direct kfree() calls. This requirement stems from the kernel's object tracking mechanisms designed to detect memory corruption and ensure proper lifecycle management of kernel objects.

The technical root cause of this vulnerability lies in the incorrect memory deallocation pattern within the cpufreq governor subsystem. When the cpufreq_dbs_governor_exit function is invoked, it attempts to free the dbs_data structure directly using kfree(), bypassing the proper kobject release mechanism. This improper approach triggers kernel debug checks that detect the use of freed objects, resulting in the observed call trace showing ODEBUG warnings and kernel panic indicators. The debug objects subsystem specifically flags this as a "free active object" error, indicating that an object was freed while still in use or in an active state. The kernel's memory management system detects this violation and generates warnings that can lead to system instability or crashes during normal operation.

The operational impact of this vulnerability extends beyond simple memory corruption, potentially leading to system crashes, kernel panics, and denial of service conditions. The error message pattern indicates that this issue occurs during governor transitions or system shutdown scenarios, where the kernel attempts to clean up cpufreq governor resources. The specific error trace shows the call sequence leading to the issue, with the final stack trace pointing to debug_print_object and debug_check_no_obj_freed functions within lib/debugobjects.c, which are part of the kernel's object validation subsystem. This vulnerability affects systems running Linux kernels with cpufreq governor functionality, particularly those utilizing the dbs (Dynamic Power Management) governor, and can be exploited to cause system instability during normal operation.

The fix implemented addresses this vulnerability by introducing a dedicated cpufreq_dbs_data_release() function that properly handles the kobject release mechanism for the dbs_data structure. This new function ensures that the memory cleanup process follows the correct kernel object lifecycle management patterns, preventing the direct kfree() calls that were causing the system to flag freed objects as active. The solution incorporates proper reference counting and object release handling, ensuring that the gov_attr_set_put() function can properly manage the lifecycle of the embedded kobject structure. This approach aligns with the kernel's established patterns for managing reference-counted objects and adheres to the principles outlined in the Common Weakness Enumeration (CWE) category CWE-415, which addresses double free errors and improper object management. The fix also implements the necessary callback management within the new release function, ensuring that the governor's exit callback is properly invoked during the cleanup process, as noted in the patch description.

This vulnerability demonstrates the critical importance of proper kernel object management and memory lifecycle handling in operating system development. The issue represents a classic example of improper resource management that can lead to system instability and potential security implications. The fix ensures compliance with kernel development best practices and the established kernel object management framework, where kobjects must be freed through their release methods to maintain the integrity of the kernel's memory management subsystem. The solution directly addresses the ATT&CK technique T1490, which involves exploitation of system resource management flaws, and aligns with the broader security principles of preventing memory corruption vulnerabilities that could be leveraged for privilege escalation or system compromise. Organizations should ensure their Linux systems are updated with patches addressing this vulnerability to prevent potential system instability during governor transitions or shutdown operations.

Responsible

Linux

Reservation

02/26/2025

Disclosure

02/26/2025

Moderation

accepted

CPE

ready

EPSS

0.00246

KEV

no

Activities

very low

Sources

Might our Artificial Intelligence support you?

Check our Alexa App!