[all-commits] [llvm/llvm-project] fd51ab: [hwasan] Don't report short-granule shadow as over...

Mitch Phillips via All-commits all-commits at lists.llvm.org
Wed Aug 18 11:26:20 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd51ab634143e0c1be49a62e16616ba5ab89273e
      https://github.com/llvm/llvm-project/commit/fd51ab634143e0c1be49a62e16616ba5ab89273e
  Author: Mitch Phillips <31459023+hctim at users.noreply.github.com>
  Date:   2021-08-18 (Wed, 18 Aug 2021)

  Changed paths:
    M compiler-rt/lib/hwasan/hwasan_allocator.cpp
    M compiler-rt/lib/hwasan/hwasan_report.cpp
    M compiler-rt/test/hwasan/TestCases/tail-magic.c

  Log Message:
  -----------
  [hwasan] Don't report short-granule shadow as overwritten.

The shadow for a short granule is stored in the last byte of the
granule. Currently, if there's a tail-overwrite report (a
buffer-overflow-write in uninstrumented code), we report the shadow byte
as a mismatch against the magic.

Fix this bug by slapping the shadow into the expected value. This also
makes sure that if the uninstrumented WRITE does clobber the shadow
byte, it reports the shadow was actually clobbered as well.

Reviewed By: eugenis, fmayer

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




More information about the All-commits mailing list