[all-commits] [llvm/llvm-project] ae1bd3: [scudo] Add thread-safety annotations on TSD data ...

ChiaHungDuan via All-commits all-commits at lists.llvm.org
Wed Feb 15 15:46:54 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ae1bd3adf02f4f381b3298b794fab8387d794538
      https://github.com/llvm/llvm-project/commit/ae1bd3adf02f4f381b3298b794fab8387d794538
  Author: Chia-hung Duan <chiahungduan at google.com>
  Date:   2023-02-15 (Wed, 15 Feb 2023)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/combined.h
    M compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/tsd_test.cpp
    M compiler-rt/lib/scudo/standalone/tsd.h

  Log Message:
  -----------
  [scudo] Add thread-safety annotations on TSD data members

Ideally, we want to assert that all the operations on
Cache/QuarantineCache always have the `Mutex` acquired. However,
the current architecture of accessing TSD is not easy to cooperate
with the thread-safety analysis because of pointer aliasing. In
alternative, we add the getters for accessing TSD member and attach
proper thread-safety annotations on them.

Reviewed By: cferris

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


  Commit: 94a391b94972b68db03320f27ebf2e279051b3e6
      https://github.com/llvm/llvm-project/commit/94a391b94972b68db03320f27ebf2e279051b3e6
  Author: Chia-hung Duan <chiahungduan at google.com>
  Date:   2023-02-15 (Wed, 15 Feb 2023)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/primary32.h
    M compiler-rt/lib/scudo/standalone/primary64.h
    M compiler-rt/lib/scudo/standalone/secondary.h
    M compiler-rt/lib/scudo/standalone/wrappers_c.inc

  Log Message:
  -----------
  [scudo] Calling iterateOverChunks requires holding lock

Ensure the allocator is disabled before visiting all chunks.

Reviewed By: cferris

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


  Commit: a9269773eb94ddd36ec3e624740013ca3a5885ba
      https://github.com/llvm/llvm-project/commit/a9269773eb94ddd36ec3e624740013ca3a5885ba
  Author: Chia-hung Duan <chiahungduan at google.com>
  Date:   2023-02-15 (Wed, 15 Feb 2023)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/chunk.h
    M compiler-rt/lib/scudo/standalone/combined.h
    M compiler-rt/lib/scudo/standalone/common.h
    M compiler-rt/lib/scudo/standalone/primary32.h
    M compiler-rt/lib/scudo/standalone/primary64.h
    M compiler-rt/lib/scudo/standalone/release.h
    M compiler-rt/lib/scudo/standalone/secondary.h
    M compiler-rt/lib/scudo/standalone/tests/combined_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/release_test.cpp
    M compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
    M compiler-rt/lib/scudo/standalone/trusty.cpp
    M compiler-rt/lib/scudo/standalone/vector.h
    M compiler-rt/lib/scudo/standalone/wrappers_c.inc
    M compiler-rt/lib/scudo/standalone/wrappers_c_checks.h

  Log Message:
  -----------
  [scudo] Improve the uses of roundUpTo/roundDownTo/isAligned

The implementations of those functions require the rounding target to be
power-of-two. It's better to add a debugging check to avoid misuse.
Besides, add a general verion of those three to accommadate non
power-of-two cases.

Also change the name to roundUp/roundDown/isAligned

Reviewed By: cferris, cryptoad

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


Compare: https://github.com/llvm/llvm-project/compare/e7d3f43eafdd...a9269773eb94


More information about the All-commits mailing list