summaryrefslogtreecommitdiff
path: root/source/components/executer/excreate.c
diff options
context:
space:
mode:
authorJessica Clarke <jrtc27@jrtc27.com>2021-10-02 21:50:06 +0100
committerJessica Clarke <jrtc27@jrtc27.com>2021-10-03 16:20:09 +0100
commitd9eb82bd7515989f0b29d79deeeb758db4d6529c (patch)
treeea5a56ffe0ad35ee6d61dd659af78fd09e842aa6 /source/components/executer/excreate.c
parente01cc6b3d12b5f73f44d46fa15a7f569c793b328 (diff)
downloadacpica-d9eb82bd7515989f0b29d79deeeb758db4d6529c.tar.gz
Use original DataTableRegion pointer for accesses
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 ACPI_OBJECT_REGION to store the pointer for table regions, and propagate it to AcpiExDataTableSpaceHandler via the region context, to use a more portable implementation that supports CHERI.
Diffstat (limited to 'source/components/executer/excreate.c')
-rw-r--r--source/components/executer/excreate.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/components/executer/excreate.c b/source/components/executer/excreate.c
index 8afae43c7..18a3af2f1 100644
--- a/source/components/executer/excreate.c
+++ b/source/components/executer/excreate.c
@@ -451,6 +451,7 @@ AcpiExCreateRegion (
ObjDesc->Region.SpaceId = SpaceId;
ObjDesc->Region.Address = 0;
ObjDesc->Region.Length = 0;
+ ObjDesc->Region.Pointer = NULL;
ObjDesc->Region.Node = Node;
ObjDesc->Region.Handler = NULL;
ObjDesc->Common.Flags &=