[all-commits] [llvm/llvm-project] 0ebb75: [hwasan] Add __hwasan_init constructor to runtime ...

Mitch Phillips via All-commits all-commits at lists.llvm.org
Wed Aug 4 11:18:49 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0ebb75608759cc1ee1016699e15d03e8e3f30d14
      https://github.com/llvm/llvm-project/commit/0ebb75608759cc1ee1016699e15d03e8e3f30d14
  Author: Mitch Phillips <31459023+hctim at users.noreply.github.com>
  Date:   2021-08-04 (Wed, 04 Aug 2021)

  Changed paths:
    M compiler-rt/lib/hwasan/hwasan.cpp

  Log Message:
  -----------
  [hwasan] Add __hwasan_init constructor to runtime lib.

Found by an Android toolchain upgrade, inherited module constructors
(like init_have_lse_atomics from the builtins) can sneak into the hwasan
runtime. If these inherited constructors call hwasanified libc
functions, then the HWASan runtime isn't setup enough, and the code
crashes.

Mark the initialized as a high-priority initializer to fix this.

Reviewed By: pcc, yabinc

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




More information about the All-commits mailing list