[all-commits] [llvm/llvm-project] c201f2: hwasan: Emit the globals note even when globals ar...

pcc via All-commits all-commits at lists.llvm.org
Thu Aug 13 16:33:52 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c201f27225857a6d0ba85df6ef7d5cbcc2c04e44
      https://github.com/llvm/llvm-project/commit/c201f27225857a6d0ba85df6ef7d5cbcc2c04e44
  Author: Peter Collingbourne <peter at pcc.me.uk>
  Date:   2020-08-13 (Thu, 13 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
    M llvm/test/Instrumentation/HWAddressSanitizer/globals.ll

  Log Message:
  -----------
  hwasan: Emit the globals note even when globals are uninstrumented.

This lets us support the scenario where a binary is linked from a mix
of object files with both instrumented and non-instrumented globals.
This is likely to occur on Android where the decision of whether to use
instrumented globals is based on the API level, which is user-facing.

Previously, in this scenario, it was possible for the comdat from
one of the object files with non-instrumented globals to be selected,
and since this comdat did not contain the note it would mean that the
note would be missing in the linked binary and the globals' shadow
memory would be left uninitialized, leading to a tag mismatch failure
at runtime when accessing one of the instrumented globals.

It is harmless to include the note when targeting a runtime that does
not support instrumenting globals because it will just be ignored.

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




More information about the All-commits mailing list