[all-commits] [llvm/llvm-project] 612ead: Expose __hwasan_tag_mismatch_stub

David Tellenbach via All-commits all-commits at lists.llvm.org
Thu Oct 24 03:05:43 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 612eadb7bc06b8f1a094976e06155f46ebd70d7c
      https://github.com/llvm/llvm-project/commit/612eadb7bc06b8f1a094976e06155f46ebd70d7c
  Author: David Tellenbach <david.tellenbach at arm.com>
  Date:   2019-10-24 (Thu, 24 Oct 2019)

  Changed paths:
    M compiler-rt/lib/hwasan/hwasan_interface_internal.h
    M compiler-rt/lib/hwasan/hwasan_linux.cpp
    M compiler-rt/lib/hwasan/hwasan_tag_mismatch_aarch64.S

  Log Message:
  -----------
  Expose __hwasan_tag_mismatch_stub

Summary:
GCC would like to emit a function call to report a tag mismatch
rather than hard-code the `brk` instruction directly.

__hwasan_tag_mismatch_stub contains most of the functionality to do
this already, but requires exposure in the dynamic library.

This patch moves __hwasan_tag_mismatch_stub outside of the anonymous
namespace that it was defined in and declares it in
hwasan_interface_internal.h.

We also add the ability to pass sizes larger than 16 bytes to this
reporting function by providing a fourth parameter that is only looked
at when the size provided is not in the original accepted range.

This does not change the behaviour where it is already being called,
since the previous definition only accepted sizes up to 16 bytes and
hence the change in behaviour is not seen by existing users.
The change in declaration does not matter, since the only existing use
is in the __hwasan_tag_mismatch function written in assembly.

Tested with gcc and clang on an AArch64 vm.

Reviewers: eugenis, kcc, pcc, #sanitizers

Reviewed By: eugenis, #sanitizers

Subscribers: kristof.beyls, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D69113




More information about the All-commits mailing list