Re: [PATCH] efi: Allocate runtime workqueue before ACPI init
"Ard Biesheuvel" <[email protected]> Tue, 19 May 2026 17:24:31 +0200
| Newsgroups | org.kernel.vger.linux-efi,org.kernel.vger.linux-acpi |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 19 May 2026, at 16:12, Rafael J. Wysocki wrote: > On Tue, May 19, 2026 at 10:23 AM Ard Biesheuvel <[email protected]> wrote: >> >> From: Ard Biesheuvel <[email protected]> >> >> Since commit >> >> 5894cf571e14 ("acpi/prmt: Use EFI runtime sandbox to invoke PRM handlers") >> >> ACPI PRM calls are delegated to a workqueue which runs in a kernel >> thread, making it easier to detect and mitigate faulting memory accesses >> performed by the firmware. >> >> Rafael reports that such PRM accesses may occur before efisubsys_init() >> executes, which is where the workqueue is allocated, leading to NULL >> pointer dereferences. Since acpi_init() [which triggers the early PRM >> accesses] executes as a subsys_initcall() as well, and has its own >> dependencies that may be sensitive to initcall ordering, deferring >> acpi_init() is not an option. >> >> So instead, split off the workqueue allocation into its own postcore >> initcall, as this is the only missing piece to allow EFI runtime calls >> to be made. This ensures that EFI runtime call (including PRM calls) are >> accessible to all code running at subsys_initcall() level. >> >> Fixes: 5894cf571e14 ("acpi/prmt: Use EFI runtime sandbox to invoke PRM handlers") >> Reported-by: "Rafael J. Wysocki" <[email protected]> >> Signed-off-by: Ard Biesheuvel <[email protected]> > > This should work AFAICS, so > > Reviewed-by: Rafael J. Wysocki (Intel) <[email protected]> > OK, I'll queue this up.