CVE-2020-36780 in Linuxinfo

Summary

by MITRE • 02/28/2024

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

i2c: sprd: fix reference leak when pm_runtime_get_sync fails

The PM reference count is not expected to be incremented on return in sprd_i2c_master_xfer() and sprd_i2c_remove().

However, pm_runtime_get_sync will increment the PM reference count even failed. Forgetting to putting operation will result in a reference leak here.

Replace it with pm_runtime_resume_and_get to keep usage counter balanced.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 11/06/2024

The vulnerability CVE-2020-36780 represents a critical reference leak issue within the Linux kernel's I2C subsystem, specifically affecting the Spreadtrum I2C driver implementation. This flaw manifests in the sprd_i2c_master_xfer() and sprd_i2c_remove() functions where improper power management reference counting leads to resource exhaustion. The issue stems from the incorrect handling of power management runtime references, creating a scenario where the reference count becomes unbalanced and ultimately results in resource leakage that can compromise system stability and performance.

The technical root cause lies in the improper interaction between pm_runtime_get_sync() function and the power management subsystem. When pm_runtime_get_sync() fails, it still increments the power management reference count, which creates an imbalance in the usage counter. This behavior directly violates the expected power management semantics where failed operations should not alter the reference state. The function sprd_i2c_master_xfer() and sprd_i2c_remove() fail to properly account for this behavior, leading to a persistent reference leak that accumulates over time and can eventually exhaust available power management resources.

This vulnerability operates at the kernel level within the I2C bus driver framework, specifically targeting the Spreadtrum I2C controller implementation. The operational impact extends beyond simple resource waste, as the reference leak can cause system instability, increased power consumption, and potentially lead to denial of service conditions. The issue affects embedded systems and devices that rely on Spreadtrum I2C controllers, particularly those with limited power management resources where such leaks can have cascading effects on system reliability. The vulnerability aligns with CWE-404, which addresses improper resource management and resource leaks in software systems.

The mitigation strategy involves replacing the problematic pm_runtime_get_sync() call with pm_runtime_resume_and_get() which properly maintains the usage counter balance. This change ensures that when operations fail, the reference count remains consistent and prevents the accumulation of leaked references. The fix addresses the fundamental issue by ensuring proper power management reference accounting and aligns with established best practices for kernel power management operations. This solution follows ATT&CK technique T1547.001 which involves establishing persistence through system modifications, specifically by ensuring proper resource management to maintain system stability and prevent unauthorized access through resource exhaustion attacks. The patch demonstrates proper kernel development practices for power management and resource handling, preventing potential escalation to more serious security implications through resource depletion attacks that could be exploited by malicious actors to cause system instability or denial of service conditions.

Reservation

02/26/2024

Disclosure

02/28/2024

Moderation

accepted

CPE

ready

EPSS

0.00228

KEV

no

Activities

very low

Sources

Might our Artificial Intelligence support you?

Check our Alexa App!