lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMj1kXH6Q2t6ER3kZDtiAFmk6QKj24_LtV9gjfq3bjQCBAVSww@mail.gmail.com>
Date: Sat, 12 Oct 2024 21:46:56 +0200
From: Ard Biesheuvel <ardb@...nel.org>
To: KobaK <kobak@...dia.com>
Cc: Matt Ochs <mochs@...dia.com>, James Morse <james.morse@....com>, 
	"Rafael J . Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>, linux-acpi@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Zhang Rui <rui.zhang@...el.com>, 
	linux-efi@...r.kernel.org
Subject: Re: [PATCH V9] acpi/prmt: find block with specific type

On Sat, 12 Oct 2024 at 21:42, KobaK <kobak@...dia.com> wrote:
>
> From: Koba Ko <kobak@...dia.com>
>
> PRMT needs to find the correct type of block to
> translate the PA-VA mapping for EFI runtime services.
>
> The issue arises because the PRMT is finding a block of
> type EFI_CONVENTIONAL_MEMORY, which is not appropriate for
> runtime services as described in Section 2.2.2 (Runtime
> Services) of the UEFI Specification [1]. Since the PRM handler is
> a type of runtime service, this causes an exception
> when the PRM handler is called.
>
>     [Firmware Bug]: Unable to handle paging request in EFI runtime service
>     WARNING: CPU: 22 PID: 4330 at drivers/firmware/efi/runtime-wrappers.c:341
>         __efi_queue_work+0x11c/0x170
>     Call trace:
>
> Find a block with specific type to fix this.
> PRMT find a block with EFI_MEMORY_RUNTIME for PRM handler and PRM context.
> If no suitable block is found, a warning message will be prompted
> but the procedure continues to manage the next PRM handler.
> However, if the PRM handler is actually called without proper allocation,
> it would result in a failure during error handling.
>
> By using the correct memory types for runtime services,
> ensure that the PRM handler and the context are
> properly mapped in the virtual address space during runtime,
> preventing the paging request error.
>
> The issue is really that only memory that has been remapped for
> runtime by the firmware can be used by the PRM handler, and so the
> region needs to have the EFI_MEMORY_RUNTIME attribute.
>
> [1] https://uefi.org/sites/default/files/resources/UEFI_Spec_2_10_Aug29.pdf
> Fixes: cefc7ca46235 ("ACPI: PRM: implement OperationRegion handler for the PlatformRtMechanism subtype")
> cc: stable@...r.kernel.org
> Signed-off-by: Koba Ko <kobak@...dia.com>
> Reviewed-by: Matthew R. Ochs <mochs@...dia.com>
> Reviewed-by: Zhang Rui <rui.zhang@...el.com>
> Reviewed-by: Ard Biesheuvel <ardb@...nel.org>
> ---
> V2:
> 1. format the changelog and add more about error handling.
> 2. replace goto
> V3: Warn if parts of handler are missed during va-pa translating.
> V4: Fix the 0day
> V5: Fix typo and pr_warn warning
> V6: use EFI_MOMOERY_RUNTIME to find block and split goto refactor as a single
> patch
> V7:
> 1. refine the codes and commit description as per comments
> 2. drop goto refacotr
> V8: Fix 0day and cc to stable
> V9: Describe 0day fix
> cast PA as (void *) in pr_warn

Sigh.

Please read to the end of my previous email and fix the other thing too.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ