Vulnerability in Kernel: efi: Change down_interruptible() in virt_efi_reset_system() to down_trylock()
Summary
GSD-2021-1001911: efi: Change down_interruptible() in virt_efi_reset_system() to down_trylock(). Affects Kernel versions < 85c6f477b3574ba0efa05603247b39e00be0c1b5. 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 Kernel is a critical component of the Linux operating system that manages the system's resources and facilitates communication between hardware and software. It provides essential functionality for the proper functioning of the system. The efi module within the Kernel is responsible for handling the Extensible Firmware Interface (EFI) system calls. EFI is a specification that defines an interface between the operating system and the firmware of a computer system. It is commonly used in modern computers as a replacement for the traditional BIOS. The virt_efi_reset_system() function in the efi module is used to reset the system. However, there is a vulnerability in the implementation of this function that can potentially be exploited by attackers.
Vulnerability Detail
The vulnerability in the virt_efi_reset_system() function arises from the use of the down_interruptible() function, which can lead to a deadlock situation. The function is used to acquire a lock, but if the lock is already held by another process, it will put the calling process to sleep until the lock is released. This can result in a deadlock if the lock is never released, causing the system to become unresponsive. An attacker could potentially exploit this vulnerability to cause a denial-of-service (DoS) condition by repeatedly triggering the virt_efi_reset_system() function and causing the system to deadlock. The impact of this vulnerability can range from a temporary system freeze to a complete system crash, depending on the circumstances.
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
If updating the Kernel is not immediately feasible, a possible workaround is to modify the virt_efi_reset_system() function to use the down_trylock() function instead of down_interruptible(). The down_trylock() function attempts to acquire the lock without putting the calling process to sleep. If the lock is already held by another process, it will return immediately without acquiring the lock. This can help prevent the deadlock situation caused by the vulnerability. Here is an example of the modified code:
void virt_efi_reset_system()
{
if (down_trylock(&lock)) {
// Handle the case when the lock is already held
return;
}
// Rest of the code
}
Please note that this workaround may not fully mitigate the vulnerability and it is still recommended to update the Kernel to the latest version as soon as possible.
Conclusion
The vulnerability in the virt_efi_reset_system() function of the Kernel can potentially be exploited to cause a denial-of-service (DoS) condition. It is recommended to update the Kernel to the latest version to fix the vulnerability. If immediate update is not possible, a workaround involving modifying the code can be applied. However, it is important to note that the workaround may not fully mitigate the vulnerability, and updating the Kernel is still the recommended course of action. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The Kernel is a critical component of the Linux operating system that manages the system's resources and facilitates communication between hardware and software.
EFI stands for Extensible Firmware Interface. It is a specification that defines an interface between the operating system and the firmware of a computer system. It is commonly used in modern computers as a replacement for the traditional BIOS.
The virt_efi_reset_system() function is a part of the efi module in the Kernel. It is used to reset the system.
A deadlock is a situation where two or more processes are unable to proceed because each is waiting for the other to release a resource. In the context of this vulnerability, the use of the down_interruptible() function can lead to a deadlock if the lock is never released.
A denial-of-service (DoS) attack is an attempt to make a computer or network resource unavailable to its intended users by overwhelming it with a flood of illegitimate requests or by exploiting vulnerabilities to cause the system to crash or become unresponsive.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.