[Lldb-commits] [PATCH] D106880: [lldb][AArch64] Mark mismatched tags in tag read output

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 27 08:21:56 PDT 2021


DavidSpickett created this revision.
Herald added subscribers: danielkiss, kristof.beyls.
DavidSpickett requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

The "memory tag read" command will now tell you
when the allocation tag read does not match the logical
tag.

(lldb) memory tag read mte_buf+(8*16) mte_buf+(8*16)+48
Logical tag: 0x9
Allocation tags:
[0xfffff7ff7080, 0xfffff7ff7090): 0x8 (mismatch)
[0xfffff7ff7090, 0xfffff7ff70a0): 0x9
[0xfffff7ff70a0, 0xfffff7ff70b0): 0xa (mismatch)

The logical tag will be taken from the start address
so the end could have a different tag. You could for example
read from ptr_to_array_1 to ptr_to_array_2. Where the latter
is tagged differently to prevent buffer overflow.

The existing command will read 1 granule if you leave
off the end address. So you can also use it as a quick way
to check a single location.

(lldb) memory tag read mte_buf
Logical tag: 0x9
Allocation tags:
[0xfffff7ff7000, 0xfffff7ff7010): 0x0 (mismatch)

This avoids the need for a seperate "memory tag check" command.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106880

Files:
  lldb/source/Commands/CommandObjectMemoryTag.cpp
  lldb/test/API/linux/aarch64/mte_tag_access/TestAArch64LinuxMTEMemoryTagAccess.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106880.362038.patch
Type: text/x-patch
Size: 10341 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210727/30a4a2fe/attachment-0001.bin>


More information about the lldb-commits mailing list