[all-commits] [llvm/llvm-project] fcf92c: [tsan] Check for nullptr on user_alloc_usable_size...

Northbadge via All-commits all-commits at lists.llvm.org
Mon Jun 12 17:01:13 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fcf92cb8008d802de4b64ae765fed1ffe3871a97
      https://github.com/llvm/llvm-project/commit/fcf92cb8008d802de4b64ae765fed1ffe3871a97
  Author: Jin Xin Ng <njx at google.com>
  Date:   2023-06-13 (Tue, 13 Jun 2023)

  Changed paths:
    M compiler-rt/lib/tsan/rtl/tsan_mman.cpp

  Log Message:
  -----------
  [tsan] Check for nullptr on user_alloc_usable_size_fast

MBlock could be null (in the context of a call from RunFreeHooks)
if a static object was runtime initialized before tsan finished
initializing and that object later did a free().

While having the check isn't strictly required by
__sanitizer_get_allocated_size_fast's contract, a user's static object
would expect ptrs returned from malloc to be valid inputs.

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




More information about the All-commits mailing list