mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 03:38:31 +00:00
Improve alloca() memory safety
Now that all the bugs have been wormed out of the ASAN memory module we can successfully check for underruns on large stack allocations.
This commit is contained in:
parent
1ff1854107
commit
38cb6e71ca
4 changed files with 10 additions and 13 deletions
|
@ -1240,8 +1240,7 @@ void __asan_unpoison_stack_memory(uintptr_t addr, size_t size) {
|
|||
}
|
||||
|
||||
void __asan_alloca_poison(uintptr_t addr, size_t size) {
|
||||
/* TODO(jart): Make sense of this function. */
|
||||
/* __asan_poison(addr - 32, 32, kAsanAllocaUnderrun); */
|
||||
__asan_poison(addr - 32, 32, kAsanAllocaUnderrun);
|
||||
__asan_poison(ROUNDUP(addr + size, 32), 32, kAsanAllocaOverrun);
|
||||
__asan_unpoison(addr, ROUNDUP(addr + size, 32) - (addr + size) + 32 + size);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue