[Ping v2] [PATCH PR64820] Fix ASan UAR detection fails on 32-bit targets if SSP is enabled.

Maxim Ostapenko m.ostapenko@partner.samsung.com
Wed Feb 25 14:50:00 GMT 2015


On 02/16/2015 10:58 AM, Maxim Ostapenko wrote:
> Hi,
>
> when testing I noticed, that if compile with both -fsanitize=address and
> -fstack-protector for 32-bit architectures and run with
> ASAN_OPTIONS=detect_stack_use_after_return=1, libsanitizer fails with:
>
>   ==7299==AddressSanitizer CHECK failed:
> /home/max/workspace/downloads/gcc/libsanitizer/asan/asan_poisoning.cc:25
> "((AddrIsAlignedByGranularity(addr + size))) != (0)" (0x0, 0x0)
>      #0 0xf72d8afc in AsanCheckFailed
> /home/max/workspace/downloads/gcc/libsanitizer/asan/asan_rtl.cc:68
>      #1 0xf72dda89 in __sanitizer::CheckFailed(char const*, int, char
> const*, unsigned long long, unsigned long long)
> /home/max/workspace/downloads/gcc/libsanitizer/sanitizer_common/sanitizer_common.cc:72 
>
>
> This happens because ssp inserts a stack guard into a function, that
> confuses asan_emit_stack_protection to calculate right size parameter
> for asan_stack_malloc.
>
> This tiny patch resolves the issue.
>
> Regtested with make -j12 -k check
> RUNTESTFLAGS='--target_board=unix\{-m32,-m64\}' on 
> x86_64-unknown-linux-gnu.
>
> Bootstrapped, ASan-bootstrapped on x86_64-unknown-linux-gnu.
>
> Ok to commit?
>
> -Maxim
>
>

Ping.

-Maxim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ssp_asan-6.diff
Type: text/x-patch
Size: 3679 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150225/dcc79cac/attachment.bin>


More information about the Gcc-patches mailing list