CVE-2022-48996 in Linuxinfo

Summary

by MITRE • 10/21/2024

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

mm/damon/sysfs: fix wrong empty schemes assumption under online tuning in damon_sysfs_set_schemes()

Commit da87878010e5 ("mm/damon/sysfs: support online inputs update") made 'damon_sysfs_set_schemes()' to be called for running DAMON context, which could have schemes. In the case, DAMON sysfs interface is supposed to update, remove, or add schemes to reflect the sysfs files. However, the code is assuming the DAMON context wouldn't have schemes at all, and therefore creates and adds new schemes. As a result, the code doesn't work as intended for online schemes tuning and could have more than expected memory footprint. The schemes are all in the DAMON context, so it doesn't leak the memory, though.

Remove the wrong asssumption (the DAMON context wouldn't have schemes) in 'damon_sysfs_set_schemes()' to fix the bug.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 01/18/2026

The vulnerability CVE-2022-48996 resides within the Linux kernel's DAMON (Dynamic AMD/Optimization for Memory) subsystem, specifically in the memory management component mm/damon/sysfs. This issue manifests when attempting to perform online tuning of DAMON schemes through the sysfs interface while a DAMON context is already active and contains existing schemes. The fundamental problem stems from a flawed assumption within the damon_sysfs_set_schemes() function that when called for running DAMON contexts, these contexts would be devoid of any existing schemes. This erroneous presumption directly contradicts the intended functionality of online scheme modification, where users expect to update, remove, or add schemes dynamically without disrupting existing configurations.

The technical flaw occurs in the damon_sysfs_set_schemes() function which was modified in commit da8787878010e5 to support online inputs update capabilities. When this function processes a running DAMON context that already contains schemes, it incorrectly assumes no schemes exist and proceeds to create and add new schemes rather than properly managing the existing ones. This leads to improper scheme handling where the system fails to correctly update or remove existing schemes, resulting in a discrepancy between the intended configuration and the actual DAMON behavior. The memory management aspect becomes particularly concerning as the function creates additional scheme structures without properly accounting for existing ones, potentially leading to increased memory footprint beyond expected levels.

The operational impact of this vulnerability extends beyond simple functional failures to encompass potential resource management issues within the Linux kernel's memory subsystem. While the vulnerability does not cause direct memory leaks since all schemes remain properly contained within the DAMON context, the improper handling can lead to inconsistent state management and unexpected behavior during online scheme modifications. This affects system administrators and developers who rely on DAMON's online tuning capabilities for memory optimization and monitoring, as their configuration changes may not be properly applied or may result in unintended scheme accumulation. The issue particularly impacts systems where dynamic memory management policies need to be adjusted in real-time without system interruption.

The fix for CVE-2022-48996 involves removing the incorrect assumption that DAMON contexts cannot contain schemes when damon_sysfs_set_schemes() is called. This modification ensures that the function properly recognizes and handles existing schemes within active DAMON contexts, allowing for correct online scheme updates, additions, and removals. The resolution aligns with the broader ATT&CK framework's approach to system integrity and kernel-level security by addressing improper state management in kernel subsystems. This vulnerability relates to CWE-252, which covers improper handling of exceptional conditions, and CWE-457, concerning use of uninitialized variables, as the function operates on assumptions that may not hold true in all operational scenarios. The fix ensures proper adherence to kernel memory management principles and maintains the expected behavior of the DAMON subsystem's online tuning interface, thereby preserving system stability and resource utilization efficiency.

Responsible

Linux

Reservation

08/22/2024

Disclosure

10/21/2024

Moderation

accepted

CPE

ready

EPSS

0.00211

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!