summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpica/dsopcode.c
diff options
context:
space:
mode:
authorJessica Clarke <jrtc27@jrtc27.com>2021-12-22 19:21:25 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-12-27 19:01:28 +0300
commitca25f92b72d25457653dbf2a81f322235804fb05 (patch)
treef2f76e44ffbcc7e0c05e1a0adb4f04ee4b6f2a28 /drivers/acpi/acpica/dsopcode.c
parentf81bdeaf816142e0729eea0cc84c395ec9673151 (diff)
downloadlinux-ca25f92b72d25457653dbf2a81f322235804fb05.tar.xz
ACPICA: Use original data_table_region pointer for accesses
ACPICA commit d9eb82bd7515989f0b29d79deeeb758db4d6529c Currently the pointer to the table is cast to acpi_physical_address and later cast back to a pointer to be dereferenced. Whether or not this is supported is implementation-defined. On CHERI, and thus Arm's experimental Morello prototype architecture, pointers are represented as capabilities, which are unforgeable bounded pointers, providing always-on fine-grained spatial memory safety. This means that any pointer cast to a plain integer will lose all its associated metadata, and when cast back to a pointer it will give a null-derived pointer (one that has the same metadata as null but an address equal to the integer) that will trap on any dereference. As a result, this is an implementation where acpi_physical_address cannot be used as a hack to store real pointers. Thus, add a new field to struct acpi_object_region to store the pointer for table regions, and propagate it to acpi_ex_data_table_space_handler via the region context, to use a more portable implementation that supports CHERI. Link: https://github.com/acpica/acpica/commit/d9eb82bd Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/dsopcode.c')
-rw-r--r--drivers/acpi/acpica/dsopcode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c
index 639635291ab7..44c448269861 100644
--- a/drivers/acpi/acpica/dsopcode.c
+++ b/drivers/acpi/acpica/dsopcode.c
@@ -531,6 +531,7 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
obj_desc->region.address = ACPI_PTR_TO_PHYSADDR(table);
obj_desc->region.length = table->length;
+ obj_desc->region.pointer = table;
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
obj_desc,