[all-commits] [llvm/llvm-project] dbc641: [sanitizer] Reduce redzone size for small size glo...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed May 19 19:19:08 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dbc641deb9883c502b5650e36a31c23d11a358fe
      https://github.com/llvm/llvm-project/commit/dbc641deb9883c502b5650e36a31c23d11a358fe
  Author: Zhiwei Chen <chenzhiwei03 at kuaishou.com>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M clang/test/CodeGen/asan-globals-alias.cpp
    M clang/test/CodeGen/asan-globals-odr.cpp
    M clang/test/CodeGen/asan-globals.cpp
    M clang/test/CodeGen/asan-static-odr.cpp
    M llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
    M llvm/test/Instrumentation/AddressSanitizer/AMDGPU/adaptive_constant_global_redzones.ll
    M llvm/test/Instrumentation/AddressSanitizer/AMDGPU/adaptive_global_redzones.ll
    M llvm/test/Instrumentation/AddressSanitizer/adaptive_global_redzones.ll
    M llvm/test/Instrumentation/AddressSanitizer/debug-info-global-var.ll
    M llvm/test/Instrumentation/AddressSanitizer/global_cstring_darwin.ll
    M llvm/test/Instrumentation/AddressSanitizer/global_lto_merge.ll
    M llvm/test/Instrumentation/AddressSanitizer/global_metadata.ll
    M llvm/test/Instrumentation/AddressSanitizer/global_metadata_array.ll
    M llvm/test/Instrumentation/AddressSanitizer/global_metadata_windows.ll
    M llvm/test/Instrumentation/AddressSanitizer/global_with_comdat.ll
    M llvm/test/Instrumentation/AddressSanitizer/local_alias.ll
    M llvm/test/Instrumentation/AddressSanitizer/odr-check-ignore.ll
    M llvm/test/Instrumentation/AddressSanitizer/win-string-literal.ll

  Log Message:
  -----------
  [sanitizer] Reduce redzone size for small size global objects

Currently 1 byte global object has a ridiculous 63 bytes redzone.
This patch reduces the redzone size to be less than 32 if the size of global object is less than or equal to half of 32 (the minimal size of redzone).
A 12 bytes object has a 20 bytes redzone, a 20 bytes object has a 44 bytes redzone.

Reviewed By: MaskRay, #sanitizers, vitalybuka

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




More information about the All-commits mailing list