]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
efi: Allocate runtime workqueue before ACPI init
authorArd Biesheuvel <ardb@kernel.org>
Tue, 19 May 2026 08:03:00 +0000 (10:03 +0200)
committerArd Biesheuvel <ardb@kernel.org>
Tue, 19 May 2026 15:24:00 +0000 (17:24 +0200)
commit13c6da02e767152c9ac4330962247a5e47011035
tree022ae97e855b218101768d6e43f9988ff6a05845
parent2c340aab5485ebe9e33c01437dd4815ef33c8df5
efi: Allocate runtime workqueue before ACPI init

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.

Cc: <stable@vger.kernel.org>
Fixes: 5894cf571e14 ("acpi/prmt: Use EFI runtime sandbox to invoke PRM handlers")
Reviewed-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/efi.c