]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
arm64: efi: Fix handling of misaligned runtime regions and drop warning
authorArd Biesheuvel <ardb@kernel.org>
Sun, 6 Nov 2022 14:53:54 +0000 (15:53 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 14 Dec 2022 12:59:05 +0000 (13:59 +0100)
commit221d231edc6a8a6ef6a79e683b4a4caf6e6001f4
treecffaf2c82374d5a18042d2611ef2c5d100dd24bf
parent4533e6cb96bb1c4a35fb53ac827f51cd893d863b
arm64: efi: Fix handling of misaligned runtime regions and drop warning

commit 9b9eaee9828fe98b030cf43ac50065a54a2f5d52 upstream.

Currently, when mapping the EFI runtime regions in the EFI page tables,
we complain about misaligned regions in a rather noisy way, using
WARN().

Not only does this produce a lot of irrelevant clutter in the log, it is
factually incorrect, as misaligned runtime regions are actually allowed
by the EFI spec as long as they don't require conflicting memory types
within the same 64k page.

So let's drop the warning, and tweak the code so that we
- take both the start and end of the region into account when checking
  for misalignment
- only revert to RWX mappings for non-code regions if misaligned code
  regions are also known to exist.

Cc: <stable@vger.kernel.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9713ceffa40aa0ded8a6241e14f902c35b3a670e)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
arch/arm64/kernel/efi.c