Skip to content
Tcl Source Code Attachment Details
Login

Attachment Details

Overview

Artifact ID: 8dce5b43481acc605e8343c97a1ac76b00c88e90c91849392c3d24ddac145181
Ticket: 37108037b980ea6e705f56a9d983e05ee218dd0c
Date: 2022-08-12 23:21:20
User: jrtc27
Artifact Attached: e858d625f2a570a48495d757a3eaaf9936a25d1d03a88c7e1ca7619315504158
Filename:0005-testcmdtoken-Don-t-rely-on-round-tripping-pointers-t.patch
Description:[PATCH 5/8] testcmdtoken: Don't rely on round-tripping pointers through strings This is needed to support CHERI, and thus Arm's experimental Morello prototype, where pointers are implemented using unforgeable capabilities that include bounds and permissions metadata to provide fine-grained spatial and referential memory safety, as well as revocation by sweeping memory to provide heap temporal memory safety. Whilst a capability can be printed and scanf can read that back in, the unforgeable nature of capabilities means its tag bit (which marks the capability as valid/not forged) will be clear and thus it will trap on dereference (in fact, printf will only print the address and thus all the metadata will be stripped, but that's not important here as the unforgeability is the important part). Since this test doesn't really need the pointer to be in the string, just some identifier that can be used to get back to the Tcl_Command, rewrite this to build up a list of these pointers, each with a unique integer that we use as the handle passed to and from the Tcl world instead. This is inspired by the list that testasync builds up in adjacent code. It also happens to remove an assumption that a Tcl_Command can be cast to and from a pointer.
Content:
(file is 0 bytes of binary data)