diff options
| author | Kostya Serebryany <kcc@google.com> | 2012-12-28 15:24:16 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2012-12-28 15:24:16 +0000 |
| commit | cb510e50e2c8d2b8b54e0bd221e3ce0881827544 (patch) | |
| tree | ecaac7fd8599de0f4f73a5479cb9cc714f3d0145 /compiler-rt/lib/sanitizer_common/sanitizer_libc.h | |
| parent | 405d6813402cf933ef171b06dac8a86550eaee3c (diff) | |
| download | bcm5719-llvm-cb510e50e2c8d2b8b54e0bd221e3ce0881827544.tar.gz bcm5719-llvm-cb510e50e2c8d2b8b54e0bd221e3ce0881827544.zip | |
[asan] implement more strict checking for memset/etc parameters. Instead of checking the first and the last byte, we check the entire shadow region. This costs ~10 slowdown for the instrumented functions. Motivated by a nasty memset-buffer-overflow-by-140-bytes in chrome which was reported as a use-after-free or not at all
llvm-svn: 171198
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_libc.h')
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_libc.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_libc.h b/compiler-rt/lib/sanitizer_common/sanitizer_libc.h index 79794839d28..aa052c654d3 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_libc.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_libc.h @@ -47,6 +47,11 @@ char *internal_strstr(const char *haystack, const char *needle); // Works only for base=10 and doesn't set errno. s64 internal_simple_strtoll(const char *nptr, char **endptr, int base); +// Return true if all bytes in [mem, mem+size) are zero. +// Optimized for the case when the result is true. +bool mem_is_zero(const char *mem, uptr size); + + // Memory void *internal_mmap(void *addr, uptr length, int prot, int flags, int fd, u64 offset); |

