]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: permit ACPI core to map kernel memory used for table overrides
authorArd Biesheuvel <ardb@kernel.org>
Tue, 29 Sep 2020 13:25:22 +0000 (15:25 +0200)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 30 Sep 2020 21:27:51 +0000 (22:27 +0100)
commitfa3808183d3d8b58aa284d7abf5ed7c07dd77819
tree184e21de28cb19106d700d4e2bd11a1a415ba034
parentaed58adfa2b0cffdb0e8328bbb37e3b7f5c8b470
arm64: permit ACPI core to map kernel memory used for table overrides

Jonathan reports that the strict policy for memory mapped by the
ACPI core breaks the use case of passing ACPI table overrides via
initramfs. This is due to the fact that the memory type used for
loading the initramfs in memory is not recognized as a memory type
that is typically used by firmware to pass firmware tables.

Since the purpose of the strict policy is to ensure that no AML or
other ACPI code can manipulate any memory that is used by the kernel
to keep its internal state or the state of user tasks, we can relax
the permission check, and allow mappings of memory that is reserved
and marked as NOMAP via memblock, and therefore not covered by the
linear mapping to begin with.

Fixes: da782b767e96 ("arm64/acpi: disallow AML memory opregions to access kernel memory")
Fixes: feba62a99b87 ("arm64/acpi: disallow writeable AML opregion mapping for EFI code regions")
Reported-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Link: https://lore.kernel.org/r/20200929132522.18067-1-ardb@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/acpi.c
include/linux/acpi.h