[llvm-commits] [compiler-rt] PATCH: asan_interceptors.cc: strncmp does not call ENSURE_ASAN_INITED();

Nick Kralevich nnk at google.com
Fri Jul 27 09:18:31 PDT 2012


On Fri, Jul 27, 2012 at 12:11 AM, Kostya Serebryany <kcc at google.com> wrote:

> Hi Nick,
> Thanks for the bug report!
> I've submitted r160853 which fixes both strcmp and strncmp.
>

r160853 solves the problem for "strncmp", but it doesn't solve the problem
for "strcmp". Please see my comment in
http://code.google.com/p/address-sanitizer/issues/detail?id=94 .


>
> On Fri, Jul 27, 2012 at 12:57 AM, Nick Kralevich <nnk at google.com> wrote:
>
>> I filed http://code.google.com/p/address-sanitizer/issues/detail?id=94,
>> but I was told that this mailing list is a better place to submit
>> patches.
>>
>
> Either one is fine.
>

Sorry for the duplicate messages. I'll continue this conversation in
http://code.google.com/p/address-sanitizer/issues/detail?id=94


>
> --kcc
>
>
>>
>> If ASAN's strncmp function is called early enough in a program's
>> lifecycle, ASAN will segfault. This is due to ASAN's strncmp not
>> calling ENSURE_ASAN_INITED().  More details are in the bug above.
>>
>> A 1 line patch is attached which resolves this issue.
>>
>> A similar bug is present in ASAN's strcmp function.  It too does not
>> call ENSURE_ASAN_INITED().  It's not clear to me whether this is
>> intentional or not.
>>
>> -- Nick
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>


-- 
Nick Kralevich | Android Security | nnk at google.com | 650.214.4037
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120727/714891a3/attachment.html>


More information about the llvm-commits mailing list