gopalshankar / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

__sanitizer_sanitize functions should setup GOT pointer on i386 #286

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
i386 ABI mandates that exported functions setup pointer to GOT table in EBX 
register before calling any external symbols from PLT. Otherwise calls to these 
functions from other shared objects are likely to fail (because they will use 
pointers to invalid GOTs which will likely cause a segfault).

I suggest to setup EBX right before __asan_report_store1@PLT to avoid slowing 
down the fast path.

What steps will reproduce the problem?
1. call __sanitizer_sanitize_store1 from DSO

What is the expected output? What do you see instead?

==26920==ERROR: AddressSanitizer: SEGV on unknown address 0x00000000 (pc 
0x00000000 sp 0xffffb69c bp 0xffffb6b4 T0)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ??:0 ??
==26920==ABORTING

Original issue reported on code.google.com by tetra2...@gmail.com on 31 Mar 2014 at 3:36

GoogleCodeExporter commented 9 years ago

Original comment by euge...@google.com on 1 Apr 2014 at 9:09

GoogleCodeExporter commented 9 years ago
Sounds good.

Original comment by euge...@google.com on 1 Apr 2014 at 9:44