[compiler-rt] [win/asan] Improve SharedReAlloc with HEAP_REALLOC_IN_PLACE_ONLY. (PR #132558)
via llvm-commits
llvm-commits at lists.llvm.org
Mon May 26 14:21:16 PDT 2025
bernhardu wrote:
Thanks for having a look.
> > Currently it prints only a "use-after-poison" message, not a proper "heap-buffer-overflow" with a hint to a reallocation.
>
> This will be confusing to users and could lead them on a wild good chase, looking for bugs in poisoning.
I will try to improve the message and try to avoid the bare "use-after-poison".
> Would this approach in general make bug detection worse? The existing behavior of realloc always returning a new pointer (with the old memory marked inaccessible) can catch erroneous code that assumes the realloc is in place (or worse, inconsistently uses both the old pointer and the return value of realloc).
I am a little confused now - when I read the [documentation to HeapReAlloc](https://learn.microsoft.com/en-us/windows/win32/api/heapapi/nf-heapapi-heaprealloc) I understand the paragraph of HEAP_REALLOC_IN_PLACE_ONLY as it is not allowed to return a different pointer. And if resize cannot be done in place it has to fail e.g return NULL.
This patch should just modify behaviour when HEAP_REALLOC_IN_PLACE_ONLY is given.
https://github.com/llvm/llvm-project/pull/132558
More information about the llvm-commits
mailing list