From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>,
linux-efi@vger.kernel.org,
Linux ACPI <linux-acpi@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH v1] efi/runtime-wrappers: Avoid crashing on early PRM code invocations
Date: Fri, 15 May 2026 19:10:10 +0200 [thread overview]
Message-ID: <2415513.ElGaqSPkdT@rafael.j.wysocki> (raw)
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
There is a dependency between EFI and ACPI PRM that the latter cannot
run until the former is ready and PRM can be invoked from AML early
through acpi_platformrt_space_handler(). If that happens before
initializing efi_rts_wq, it leads to a NULL pointer dereference.
Avoid that by adding an efi_rts_wq check against NULL to
efi_call_acpi_prm_handler().
Fixes: 5894cf571e14 ("acpi/prmt: Use EFI runtime sandbox to invoke PRM handlers")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: 6.6+ <stable@vger.kernel.org> # 6.6+
---
An alternative would be to somehow ensure that efisubsys_init() will always
run before acpi_init(), but moving any of them to another initcall level is
not an option AFAICS.
---
drivers/firmware/efi/runtime-wrappers.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/firmware/efi/runtime-wrappers.c
+++ b/drivers/firmware/efi/runtime-wrappers.c
@@ -590,6 +590,8 @@ efi_call_acpi_prm_handler(efi_status_t (
if (down_interruptible(&efi_runtime_lock))
return EFI_ABORTED;
+ if (!efi_rts_wq)
+ return EFI_NOT_READY;
status = efi_queue_work(ACPI_PRM_HANDLER, handler_addr,
param_buffer_addr, context);
up(&efi_runtime_lock);
next reply other threads:[~2026-05-15 17:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 17:10 Rafael J. Wysocki [this message]
2026-05-15 17:29 ` [PATCH v1] efi/runtime-wrappers: Avoid crashing on early PRM code invocations Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2415513.ElGaqSPkdT@rafael.j.wysocki \
--to=rafael@kernel.org \
--cc=ardb@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.