CVE-2022-50305 in Linuxinfo

Summary

by MITRE • 09/15/2025

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

ASoC: sof_es8336: fix possible use-after-free in sof_es8336_remove()

sof_es8336_remove() calls cancel_delayed_work(). However, that function does not wait until the work function finishes. This means that the callback function may still be running after the driver's remove function has finished, which would result in a use-after-free.

Fix by calling cancel_delayed_work_sync(), which ensures that the work is properly cancelled, no longer running, and unable to re-schedule itself.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 01/10/2026

The vulnerability described in CVE-2022-50305 represents a critical use-after-free condition within the Linux kernel's sound subsystem, specifically affecting the sof_es8336 driver component. This issue resides in the Advanced SoC (ASoC) framework which manages audio codec drivers for Intel's Sound Open Firmware platform. The problem manifests when the driver's remove function is invoked during system shutdown or module unloading, creating a dangerous race condition that can lead to memory corruption and system instability.

The technical flaw stems from improper handling of delayed work structures within the driver's cleanup routine. The sof_es8336_remove() function employs cancel_delayed_work() to terminate pending work items, but this function merely schedules cancellation without ensuring the work function has completed execution. This asynchronous behavior creates a window where the work callback can continue executing even after the driver's remove function has returned, leading to access of freed memory locations. The underlying issue is classified as a use-after-free vulnerability, which is categorized under CWE-416, representing the use of memory after it has been freed, a common and dangerous class of memory safety issues.

The operational impact of this vulnerability extends beyond simple driver malfunction, potentially compromising system stability and security. When the work function executes after the driver's memory has been deallocated, it can cause kernel panics, system crashes, or even allow for privilege escalation attacks if the freed memory is subsequently reallocated for malicious purposes. The vulnerability affects systems running Linux kernels with the Intel Sound Open Firmware driver support, particularly those utilizing the ES8336 audio codec. This presents a significant risk in embedded systems, servers, and desktop environments where audio functionality is critical and system reliability is paramount.

The fix implemented addresses this vulnerability by replacing cancel_delayed_work() with cancel_delayed_work_sync(), which provides synchronous cancellation of work items. This change ensures that the work function completes execution before the function returns, eliminating the race condition that enabled the use-after-free scenario. The solution aligns with best practices for kernel development and security hardening as outlined in various security frameworks including the Linux Kernel Security Best Practices and follows ATT&CK technique T1068 which covers the exploitation of system vulnerabilities. The mitigation strategy directly addresses the root cause rather than merely patching symptoms, making it a robust solution that prevents similar issues in other driver components that might employ similar patterns without proper synchronization mechanisms.

Responsible

Linux

Reservation

09/15/2025

Disclosure

09/15/2025

Moderation

accepted

CPE

ready

EPSS

0.00147

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!