[all-commits] [llvm/llvm-project] 54c309: Do not initialize the allocator on free(nullptr). ...

Evgenii Stepanov via All-commits all-commits at lists.llvm.org
Mon Dec 4 13:45:50 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 54c30953b9374e3bcc1c79b53a231e4b53ceafed
      https://github.com/llvm/llvm-project/commit/54c30953b9374e3bcc1c79b53a231e4b53ceafed
  Author: Evgenii Stepanov <eugeni.stepanov at gmail.com>
  Date:   2023-12-04 (Mon, 04 Dec 2023)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/combined.h

  Log Message:
  -----------
  Do not initialize the allocator on free(nullptr). (#74366)

free(nullptr) is guaranteed by ISO and POSIX to be a no-op, we should not pay for the overhead of maybeInit() in this case.

Additionally, Bionic calls free(nullptr) before the allocator settings are finalized.
Scudo should not run allocator initialization at that time. Doing so
causes various bad things to happen, like mapping primary regions with
the wrong PROT_MTE setting.




More information about the All-commits mailing list