On Fri, Nov 30, 2018 at 12:44:04PM +0100, Martin Liška wrote:
> Ok, I'm sending updated version of the patch. I factored out the shadow memory
> byte emission into a class, it's responsible for underlying flushing and 
> guarantees
> that stores are 4B aligned (when beginning of stack vars is properly aligned
> to ASAN_RED_ZONE_SIZE).
> 
> So far I tested the patch on x86_64-linux-gnu and ppc64le-linux-gnu machine.

Can you please do a bootstrap-asan too at least on the former to test it
some more?
Ok for trunk if that succeeds or doesn't regress compared to without this patch.

Thanks.

> 2018-11-30  Martin Liska  <mli...@suse.cz>
> 
>       PR sanitizer/81715
>       * asan.c (asan_shadow_cst): Remove, partially transform
>       into flush_redzone_payload.
>       (RZ_BUFFER_SIZE): New.
>       (struct asan_redzone_buffer): New.
>       (asan_redzone_buffer::emit_redzone_byte): Likewise.
>       (asan_redzone_buffer::flush_redzone_payload): Likewise.
>       (asan_redzone_buffer::flush_if_full): Likewise.
>       (asan_emit_stack_protection): Use asan_redzone_buffer class
>       that is responsible for proper aligned stores and flushing
>       of shadow memory payload.
>       * asan.h (ASAN_MIN_RED_ZONE_SIZE): New.
>       (asan_var_and_redzone_size): Likewise.
>       * cfgexpand.c (expand_stack_vars): Use smaller alignment
>       (ASAN_MIN_RED_ZONE_SIZE) in order to make shadow memory
>       for automatic variables more compact.
> 
> gcc/testsuite/ChangeLog:
> 
> 2018-11-30  Martin Liska  <mli...@suse.cz>
> 
>       PR sanitizer/81715
>       * c-c++-common/asan/asan-stack-small.c: New test.

        Jakub

Reply via email to