[all-commits] [llvm/llvm-project] 75867f: [scudo] Fix realloc hooks behavior (#74149)
ChiaHungDuan via All-commits
all-commits at lists.llvm.org
Fri Dec 1 14:42:00 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 75867f8e4a9a06df3b2cafe662d13ee78bb7fc67
https://github.com/llvm/llvm-project/commit/75867f8e4a9a06df3b2cafe662d13ee78bb7fc67
Author: ChiaHungDuan <chiahungduan at google.com>
Date: 2023-12-01 (Fri, 01 Dec 2023)
Changed paths:
M compiler-rt/lib/scudo/standalone/combined.h
M compiler-rt/lib/scudo/standalone/include/scudo/interface.h
M compiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp
M compiler-rt/lib/scudo/standalone/wrappers_c.inc
Log Message:
-----------
[scudo] Fix realloc hooks behavior (#74149)
`realloc` may involve both allocation and deallocation. Given that the
reporting the events is not atomic and which may lead the hook user to a
false case that the double-use pattern happens, we always report the old
pointer is released and report the new allocation afterward (even it's
the same pointer).
This also fixes that we didn't report the new size when it doesn't need
to allocate a new space.
More information about the All-commits
mailing list