[PATCH] D139377: [compiler-rt][hwasan] Let CheckAddressSized eventually call HandleTagMismatch on Fuchsia

Leonard Chan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 16:11:51 PST 2022


leonardchan created this revision.
leonardchan added reviewers: mcgrathr, vitalybuka, eugenis.
leonardchan added a project: Sanitizers.
Herald added subscribers: Enna1, abrachet, kristof.beyls, dberris.
Herald added a project: All.
leonardchan requested review of this revision.
Herald added a subscriber: Sanitizers.

Any hwasan tag checking done through runtime calls like `__hwasan_mem*` or `__hwasan_load/store*` currently raise a sigtrap on a tag mismatch. Hwasan dumps as much information it knows on the tag mismatch by placing important values in specific registers before the `brk` and encoding the access information in the optional argument supplied to the `brk`. If the platform hwasan runs on uses signal handlers, then users can see the typical pretty hwasan error report, but Fuchsia doesn't use signal handlers, so it's left up to the platform exception handler to print all this encoded information.

This patch attempts to enter the regular error reporting path via `HandleTagMismatch` if a new macro `CAN_GET_REGISTERS` is set. For now this is only defined for Fuchsia + aarch64, but can be expanded for other platforms.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139377

Files:
  compiler-rt/lib/hwasan/hwasan_checks.h
  compiler-rt/lib/hwasan/hwasan_registers.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139377.480271.patch
Type: text/x-patch
Size: 7411 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221206/c7aabcd5/attachment-0001.bin>


More information about the llvm-commits mailing list