CVE-2022-49192: drivers: ethernet: cpsw: fix panic when interrupt coaleceing is set via ethtool
In the Linux kernel, the following vulnerability has been resolved:
drivers: ethernet: cpsw: fix panic when interrupt coaleceing is set via ethtool
cpswethtoolbegin directly returns the result of pmruntimegetsync when successful. pmruntimegetsync returns -error code on failure and 0 on successful resume but also 1 when the device is already active. So the common case for cpswethtoolbegin is to return 1. That leads to inconsistent calls to pmruntimeput in the call-chain so that pmruntimeput is called one too many times and as result leaving the cpsw dev behind suspended.
The suspended cpsw dev leads to an access violation later on by different parts of the cpsw driver.
Fix this by calling the return-friendly pmruntimeresumeandget function.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.17.3-1 - Compensating control
In the cpsw driver, replace calls to pm_runtime_get_sync in cpsw_ethtool_begin with the return-friendly pm_runtime_resume_and_get function to avoid inconsistent pm_runtime_put calls and prevent the device from being left suspended.