llvm-project/compiler-rt/test/scudo
Kostya Kortchinsky 43917720a7 [scudo] Application & platform compatibility changes
Summary:
This patch changes a few (small) things around for compatibility purposes for
the current Android & Fuchsia work:
- `realloc`'ing some memory that was not allocated with `malloc`, `calloc` or
  `realloc`, while UB according to http://pubs.opengroup.org/onlinepubs/009695399/functions/realloc.html
  is more common that one would think. We now only check this if
  `DeallocationTypeMismatch` is set; change the "mismatch" error
  messages to be more homogeneous;
- some sketchily written but widely used libraries expect a call to `realloc`
  to copy the usable size of the old chunk to the new one instead of the
  requested size. We have to begrundingly abide by this de-facto standard.
  This doesn't seem to impact security either way, unless someone comes up with
  something we didn't think about;
- the CRC32 intrinsics for 64-bit take a 64-bit first argument. This is
  misleading as the upper 32 bits end up being ignored. This was also raising
  `-Wconversion` errors. Change things to take a `u32` as first argument.
  This also means we were (and are) only using 32 bits of the Cookie - not a
  big thing, but worth mentioning.
- Includes-wise: prefer `stddef.h` to `cstddef`, move `scudo_flags.h` where it
  is actually needed.
- Add tests for the memalign-realloc case, and the realloc-usable-size one.

(Edited typos)

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: llvm-commits

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

llvm-svn: 311018
2017-08-16 16:40:48 +00:00
..
CMakeLists.txt [scudo] Use the macro get_test_cc_for_arch for the tests 2016-12-23 18:40:47 +00:00
alignment.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
double-free.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
interface.cpp [scudo] Fix buildbot test error on ARM 2017-02-03 21:59:00 +00:00
lit.cfg [scudo] Fix standalone compiler-rt test breakage 2017-02-06 17:24:52 +00:00
lit.site.cfg.in [scudo] 32-bit and hardware agnostic support 2016-11-30 17:32:20 +00:00
malloc.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
memalign.cpp [scudo] Check for pvalloc overflow 2017-07-25 21:18:02 +00:00
mismatch.cpp [scudo] Application & platform compatibility changes 2017-08-16 16:40:48 +00:00
options.cpp [scudo] Application & platform compatibility changes 2017-08-16 16:40:48 +00:00
overflow.cpp [scudo] Quarantine overhaul 2017-07-24 15:29:38 +00:00
preinit.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
quarantine.cpp [scudo] Fix QuarantineChunksUpToSize failing test on AArch64 2017-07-24 18:22:33 +00:00
random_shuffle.cpp [scudo] Enabling MIPS support for Scudo 2017-06-19 11:28:59 +00:00
realloc.cpp [scudo] Application & platform compatibility changes 2017-08-16 16:40:48 +00:00
secondary.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
sized-delete.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
sizes.cpp [Sanitizers] Operator new() interceptors always die on allocation error 2017-06-28 21:58:57 +00:00
threads.cpp [scudo] Add test exercising pthreads 2017-03-23 19:21:10 +00:00
valloc.cpp [scudo] Check for pvalloc overflow 2017-07-25 21:18:02 +00:00