Windows ASan GetProcAddress replacement

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 15:42:39 PDT 2015


Thanks for the diagnosis and patch! I applied it in r245377.

We're all set on the licensing front because you appear to also be the
original author of the code you cited in the mozilla repo, and since you're
sending us a patch, I'm assuming that you're OK with distributing that code
under the UIUC license (pretty vanilla BSD).

On Tue, Aug 18, 2015 at 2:18 PM, David Major via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> On Windows, it's not possible to hook malloc using
> GetProcAddress(...,"malloc") because the GetProcAddress API will run the
> target DLL's initialize routine, which can cause mallocs to happen
> before the hook is installed. This was observed in
> https://llvm.org/bugs/show_bug.cgi?id=24237#c2.
>
> This patch adds a GetProcAddress replacement that manually walks the
> target library's export table, without calling the initialization
> routine.
>
> (A large part of this is taken from Mozilla code at
>
> https://hg.mozilla.org/mozilla-central/file/tip/toolkit/xre/WindowsCrtPatch.h
> .
> I hope that's okay license-wise.)
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150818/43121b73/attachment.html>


More information about the llvm-commits mailing list