🇮🇳
स्वतंत्रता दिवस की हार्दिक शुभकामनाएं! 🇮🇳 Happy Independence Day! | Har Ghar Tiranga | देश के 80वें स्वतंत्रता दिवस पर आज़ादी का अमृत महोत्सव मनाएं! - Celebrate the 80th Independence Day of India!

Linux 7.3 Better Protects Against Buggy EFI Firmware Taking Down The Rest Of User-Space

Linux 7.3 Better Protects Against Buggy EFI Firmware Taking Down The Rest Of User-Space

Linux 7.3 Kernel Introduces EFI Timeouts to Prevent System-Wide Hangs

The development cycle for the upcoming Linux 7.3 kernel has officially begun, and a significant new safeguard for system stability has been merged. Among the latest EFI updates, the most impactful addition is the implementation of a strict timeout for EFI runtime service completions, a move designed to stop buggy firmware from dragging down the entire operating system.

The Problem: Indefinite Hangs

Historically, the Linux kernel has lacked a mechanism to recover when a call to the EFI runtime services fails to return. When firmware hangs during these operations, the kworker assigned to the efi_rts_wq remains trapped indefinitely. Because the caller holds the efi_runtime_lock for the duration of the call, every subsequent request—ranging from efivarfs operations and NVRAM writes to ACPI PRM handlers—becomes blocked.

This creates a cascading failure: user-space processes pile up, entering an uninterruptible sleep state, and the kernel eventually issues “workqueue lockup” reports. Until now, the only way to resolve this was a hard system reboot.

Root Cause and Implementation

The effort to resolve this was spearheaded by Breno Leitao, a Debian developer and kernel engineer at Meta. The issue was identified during operations on NVIDIA Grace server platforms, where firmware would occasionally stop responding, causing systemic stalls that were difficult to diagnose at fleet scale.

In his patch series documentation, Leitao explained that while the kernel cannot patch the underlying firmware bugs, it can isolate the failure. “This series doesn’t fix the firmware bug… but it stops one stuck EFI call from taking the rest of userspace down with it,” Leitao noted. The patch effectively converts a cryptic “stalled-task” mystery into a clear, unambiguous diagnostic signal in dmesg indicating that the EFI firmware is at fault.

A 120-Second Safety Net

The kernel will now enforce a 120-second timeout on EFI runtime service calls. This duration was selected because it comfortably exceeds the requirements for any plausible, legitimate operation that would interact with the firmware. If a service call takes longer than two minutes, the kernel will declare the firmware “wedged” and terminate the process, allowing the rest of the system to continue functioning.

This new protective mechanism is part of the broader Linux 7.3 EFI feature merge. By ensuring that one faulty piece of hardware or firmware can no longer hold the entire Linux stack hostage, this update significantly improves the reliability and maintainability of Linux-based server deployments.

Leave a Reply

Your email address will not be published. Required fields are marked *