[PATCH] D54656: [hwasan] implement free_checks_tail_magic=1

Kostya Serebryany via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 16 15:39:16 PST 2018


kcc created this revision.
kcc added a reviewer: eugenis.
Herald added subscribers: Sanitizers, delcypher, kubamracek.

With free_checks_tail_magic=1 (default) HWASAN
writes magic bytes to the tail of every heap allocation
(last bytes of the last granule, if the last granule is not fully used)
and checks these bytes on free().

This feature will detect buffer overwires within the last granule
at the time of free().

This is an alternative to malloc_align_right=[1289] that should have
fewer compatibility issues. It is also weaker since it doesn't
detect read overflows and reports bugs at free() instead of at access.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D54656

Files:
  lib/hwasan/hwasan_allocator.cc
  lib/hwasan/hwasan_flags.inc
  lib/hwasan/hwasan_report.cc
  lib/hwasan/hwasan_report.h
  test/hwasan/TestCases/tail-magic.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54656.174467.patch
Type: text/x-patch
Size: 6990 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181116/e403c51c/attachment-0001.bin>


More information about the llvm-commits mailing list