aboutsummaryrefslogtreecommitdiff
path: root/libctf/testsuite/libctf-writable/libctf-errors.lk
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2025-08-05 10:44:48 -0700
committerKeith Seitz <keiths@redhat.com>2025-08-08 11:01:54 -0700
commitbe10a32638c481d4152d92b6157beb18e3210953 (patch)
tree75e512222752860b129fc1562030dd09ac228332 /libctf/testsuite/libctf-writable/libctf-errors.lk
parenta99fc443dc9a825e373e9e25576e0bf611167bc2 (diff)
downloadbinutils-be10a32638c481d4152d92b6157beb18e3210953.zip
binutils-be10a32638c481d4152d92b6157beb18e3210953.tar.gz
binutils-be10a32638c481d4152d92b6157beb18e3210953.tar.bz2
should_validate_memtags: Do not dereference references
should_validate_memtags uses value_as_address to evalute whether an address for a value is tagged. The comments for that function simply say, "Extract a value as a C pointer." While that sounds innoncuous, that function calls coerce_array, which will dereference any references. This is not what is desired here. This can be demonstrated on an MTE-enabled host, such as aarch64- based Ampere (example taken from tests introduced in this patch): (gdb) p b.get_foo () Could not validate memory tag: Value can't be converted to integer. $2 = (const foo &) @0xffffffffed88: {m_a = 42} While the command completes, gdb didn't actually attempt to evaluate any memory tags. Fix this by using unpack_pointer instead. Tested on x86_64 Fedora 40 and aarch64 RHEL 9.6.
Diffstat (limited to 'libctf/testsuite/libctf-writable/libctf-errors.lk')
0 files changed, 0 insertions, 0 deletions