Commit f6b58d29 authored by Eugene Kosov's avatar Eugene Kosov

MDEV-21239 ASAN use-after-poison in a server shutdown in innodb.innodb_buffer_pool_resize

If we manually poison memory region, ASAN requires that we manually unpoison
it too. We didn't do it and munmap() didn't do it too. That was the issue.

os_mem_free_large(): unpoison memory region. Just in case.

https://github.com/google/sanitizers/issues/182
https://github.com/llvm/llvm-project/blob/86acaa9457d3957cbe303e1e801f1e727f66ca89/compiler-rt/include/sanitizer/asan_interface.h#L21
parent c3824766
......@@ -157,6 +157,12 @@ os_mem_free_large(
{
ut_a(os_total_large_mem_allocated >= size);
// We could have manually poisoned that memory for ASAN.
// And we must unpoison it by ourself as specified in documentation
// for __asan_poison_memory_region() in sanitizer/asan_interface.h
// munmap() doesn't do it for us automatically.
UNIV_MEM_ALLOC(ptr, size);
#ifdef HAVE_LINUX_LARGE_PAGES
if (my_use_large_pages && opt_large_page_size && !shmdt(ptr)) {
my_atomic_addlint(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment