[all-commits] [llvm/llvm-project] 8434e5: [dfsan] Don't clear shadow on dlopen(NULL, flags)

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Jan 18 15:05:00 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8434e5d0a16b11ccdc29fc66a3843a94b0ad19f1
      https://github.com/llvm/llvm-project/commit/8434e5d0a16b11ccdc29fc66a3843a94b0ad19f1
  Author: Fangrui Song <i at maskray.me>
  Date:   2024-01-18 (Thu, 18 Jan 2024)

  Changed paths:
    M compiler-rt/lib/dfsan/dfsan_custom.cpp
    M compiler-rt/test/dfsan/custom.cpp

  Log Message:
  -----------
  [dfsan] Don't clear shadow on dlopen(NULL, flags)

This ports msan https://reviews.llvm.org/D14795 to dfsan.
dfsan, like msan, clears shadow for globals in a newly opened DSO in
case the DSO occupies the address of a previously labeled/poisoned area.
The operation should not happen on the main executable.

In addition, for a DT_EXEC executable, l_addr is zero and will lead to a
null pointer dereference in ForEachMappedRegion.




More information about the All-commits mailing list