Critical Vulnerability in Linux Kernel: Avoiding smp_processor_id() in Preemptible Code
Summary
CVE-2021-47178: In the Linux kernel, the following vulnerability has been resolved: scsi: target: core: Avoid smp_processor_id() in preemptible code The BUG message "BUG: using smp_processor_id() in preemptible [00000000] code" was obse... Affects linux versions 5.10.103-1 – 6.9.9-1. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Linux kernel is the core component of many operating systems, providing essential services for hardware and software interactions. It is known for its robustness and flexibility, supporting a wide range of devices and architectures. However, it is also susceptible to vulnerabilities that can compromise system stability and security. This specific vulnerability affects the SCSI target subsystem, particularly impacting TCMU devices, which are used for block storage operations.
Vulnerability Detail
In the Linux kernel, a vulnerability has been identified where the function smp_processor_id() is called within preemptible code. This can lead to unexpected behavior and system crashes, particularly when running tests like blktests block/005 on TCMU devices. The issue arises from a commit that modified work queue handling, resulting in the CPU ID being accessed inappropriately during command processing. The vulnerability can manifest during normal operations and system shutdowns, leading to potential data loss or system instability.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, users can avoid running tests that trigger the vulnerability, such as blktests block/005, especially on TCMU devices. Additionally, it is advisable to ensure that TCMU devices are properly cleaned up before system shutdown to prevent the issue from occurring.
Conclusion
The vulnerability identified in the Linux kernel regarding the use of smp_processor_id() in preemptible code poses significant risks to system stability, particularly for TCMU devices. Users are strongly advised to upgrade their kernel to the latest version to mitigate these risks. Temporary workarounds are available, but a permanent fix through an upgrade is essential for long-term security.
See every vulnerability recorded for linux →
FAQ
The vulnerability can lead to system crashes and instability, particularly during operations involving TCMU devices.
You can use tools like Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check your application without any signup.
The vulnerability affects various versions of the Linux kernel prior to the fix included in version 5.14.6-1.
Yes, updating to the latest version of the Linux kernel that includes the fix is the permanent solution.
If an immediate upgrade is not possible, avoid running tests that trigger the vulnerability and ensure proper cleanup of TCMU devices before shutdown.
Related vulnerabilities
Recent vulnerabilities recorded for linux.