[llvm-commits] Fix a use-after-return in AddressSanitizer runtime

Kostya Serebryany kcc at google.com
Thu Dec 15 09:31:31 PST 2011


Could you please describe what the bug is?

I see that we have a use-after-return in __asan_register_global(uintptr_t
addr, size_t size, const char *name)
but this function is only used by the gcc variant which I did not touch for
ages. (Still, OMG)

In void __asan_register_globals(__asan_global *globals, size_t n),
which is used by the LLVM variant, I don't see a use-after-return.

(I like the idea to poison the memory allocated by LowLevelAllocator, I'll
land a patch shortly).

--kcc


On Thu, Dec 15, 2011 at 7:32 AM, Alexander Potapenko <glider at google.com>wrote:

> The attached patch fixes a use-after-return in ASan runtime.
> Previously stack-local objects representing global variables were
> passed to RegisterGlobal and put into the globals list that was
> scanned later, when those objects had been overwritten.
>
> Related changes: s/Print/Report in RegisterGlobal (we may need the
> PIDs when analyzing the logs), poison the memory returned by the
> LowLevelAllocator to prevent possible corruptions.
>
>
> Alexander Potapenko
> Software Engineer
> Google Moscow
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111215/20d768c6/attachment.html>


More information about the llvm-commits mailing list