[all-commits] [llvm/llvm-project] e1eeb0: [hwasan] Fix Thread reuse.

Evgenii Stepanov via All-commits all-commits at lists.llvm.org
Tue Nov 10 17:24:52 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e1eeb026e66c38add2a1f8f1271e1f618c2f7a72
      https://github.com/llvm/llvm-project/commit/e1eeb026e66c38add2a1f8f1271e1f618c2f7a72
  Author: Evgenii Stepanov <eugenis at google.com>
  Date:   2020-11-10 (Tue, 10 Nov 2020)

  Changed paths:
    M compiler-rt/lib/hwasan/hwasan_thread.h
    M compiler-rt/lib/hwasan/hwasan_thread_list.h
    M compiler-rt/lib/sanitizer_common/sanitizer_common.h
    M compiler-rt/lib/sanitizer_common/tests/sanitizer_common_test.cpp
    A compiler-rt/test/hwasan/TestCases/Linux/reuse-threads.cpp
    M compiler-rt/test/hwasan/TestCases/thread-uaf.c

  Log Message:
  -----------
  [hwasan] Fix Thread reuse.

HwasanThreadList::DontNeedThread clobbers Thread::next_, breaking the
freelist. As a result, only the top of the freelist ever gets reused,
and the rest of it is lost.

Since the Thread object its associated ring buffer is only 8Kb, this is
typically only noticable in long running processes, such as fuzzers.

Fix the problem by switching from an intrusive linked list to a vector.

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




More information about the All-commits mailing list