llvm-project/compiler-rt/test/scudo
Kostya Kortchinsky 65fdf677f2 [scudo] Check for pvalloc overflow
Summary:
Previously we were rounding up the size passed to `pvalloc` to the next
multiple of page size no matter what. There is an overflow possibility that
wasn't accounted for. So now, return null in the event of an overflow. The man
page doesn't seem to indicate the errno to set in this particular situation,
but the glibc unit tests go for ENOMEM (https://code.woboq.org/userspace/glibc/malloc/tst-pvalloc.c.html#54)
so we'll do the same.
Update the aligned allocation funtions tests to check for properly aligned
returned pointers, and the `pvalloc` corner cases.

@alekseyshl: do you want me to do the same in the other Sanitizers?

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: kubamracek, alekseyshl, llvm-commits

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

llvm-svn: 309033
2017-07-25 21:18:02 +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] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
options.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +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] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +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