[all-commits] [llvm/llvm-project] eaea9e: [hwasan] Reset current thread pointer on thread exit.

Evgenii Stepanov via All-commits all-commits at lists.llvm.org
Fri May 8 10:31:52 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: eaea9ed83509d283db40aeeb324f2d4b235e816b
      https://github.com/llvm/llvm-project/commit/eaea9ed83509d283db40aeeb324f2d4b235e816b
  Author: Evgenii Stepanov <eugenis at google.com>
  Date:   2020-05-08 (Fri, 08 May 2020)

  Changed paths:
    M compiler-rt/lib/hwasan/hwasan.cpp
    M compiler-rt/lib/hwasan/hwasan_linux.cpp
    M compiler-rt/lib/hwasan/hwasan_thread.cpp
    A compiler-rt/test/hwasan/TestCases/libc_thread_freeres.c

  Log Message:
  -----------
  [hwasan] Reset current thread pointer on thread exit.

Summary:
This is necessary to handle calls to free() after __hwasan_thread_exit,
which is possible in glibc.

Also, add a null check to GetCurrentThread, otherwise the logic in
GetThreadByBufferAddress turns it into a non-null value. This means that
all of the checks for GetCurrentThread() != nullptr do not have any
effect at all right now!

Reviewers: pcc, hctim

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers

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




More information about the All-commits mailing list