]> git.baikalelectronics.ru Git - 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Nov 2022 16:42:07 +0000 (17:42 +0100)
commit5cd10ca9a812b3a0769c7ab546dd662b9506f9ae
tree7bdd9c5a93a2dc225ab03062e90e6414ce8f76cd
parentf7cdf260d26e818e92a654d90555a0cc75fbf861
arm64: efi: Fix handling of misaligned runtime regions and drop warning

commit bc3d122b758dee5c10d77b551cded1671a9dd1f6 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>
arch/arm64/kernel/efi.c