The Linux kernel, an open-source operating system, has recently patched a vulnerability affecting the ALSA (Advanced Linux Sound Architecture) hda driver for Intel SoundWire-ACPI controllers. This vulnerability is tracked under the identifier CVE-2021-46926 and pertains to the detection of SoundWire controllers in the Linux kernel.

The vulnerability was found in the intel-sdw-acpi.c file, which is responsible for discovering and enumerating Intel SoundWire controllers in the ACPI (Advanced Configuration and Power Interface) subsystem. The existing code in this file sets a pointer to an ACPI handle before checking that it's actually a SoundWire controller. This logic could lead to issues where the graph walk continues and eventually fails, but the pointer was set already.

To resolve this issue, a patch has been applied to change the logic and set the information provided to the caller only when a controller is found. The patch has been merged into the Linux kernel source code, and you can view the details of the changes here:

- Intel-sdw-acpi: Harden Detection of Controller Patch

Here's a snippet of the patch that demonstrates the changes made in the code

/* Original (vulnerable) code */
if (adev->status == ACPI_STATUS_NOT_FOUND) {
    ...
      *sdw_handle = adev->handle; // Pointer set before checking
    ...
      if (retval == SDW_INTEL_ACPI_INFO_MASK)
          return 1;
}

/* Patched (resolved) code */
if (adev->status == ACPI_STATUS_NOT_FOUND) {
    ...
      if (retval == SDW_INTEL_ACPI_INFO_MASK) {
          *sdw_handle = adev->handle; // Pointer set after checking
          return 1;
      }
}

The changes made in the patch help ensure that the pointer to the ACPI handle is set only when a SoundWire controller is actually detected. This prevents potential issues arising from the erroneous setting of pointers and improves the overall security of the Linux kernel.

Please note that this vulnerability is rated as low-severity because it primarily affects systems running with Intel SoundWire controllers using the corresponding ALSA hda driver. If your system is not running with these specific hardware and software configurations, this vulnerability poses minimal risk to your system.

To patch your Linux kernel against this vulnerability, make sure to update your kernel to the latest version available, or apply the patch manually to the kernel source code using the provided patch link above.

For more information on CVE-2021-46926

- CVE-2021-46926 - NIST National Vulnerability Database (NVD)
- Advanced Linux Sound Architecture (ALSA) Project
- Linux Kernel Homepage

Timeline

Published on: 02/27/2024 10:15:07 UTC
Last modified on: 04/10/2024 16:26:55 UTC