On Thu, Dec 19, 2013 at 04:02:47PM +0400, Maxim Ostapenko wrote:
> Sorry, ChangeLog and patch, of course.

> 2013-12-19  Max Ostapenko  <m.ostape...@partner.samsung.com>
> 
>       * cfgexpand.c (expand_stack_vars): Optionally disable asan stack 
> protection.

Too long lines in ChangeLog, wrap to 80 columns.

>       (expand_used_vars): Likewise.
>       (partition_stack_vars): Likewise.
>       * asan.c (asan_emit_stack_protection): Optionally disable after return 
> stack usage.

Ditto.

>       (instrument_derefs): Optionally disable memory access instrumentation.
>       (instrument_builtin_call): Likewise.
>       (instrument_strlen_call): Likewise.
>       (asan_protect_global): Optionally disable global variables protection.
>       * doc/invoke.texi: Added doc for new options.
>       * params.def: Added new options.
>       * params.h: Likewise.
> 
> 2013-12-19  Max Ostapenko  <m.ostape...@partner.samsung.com>
>       * c-c++-common/asan/global-overflow-2.c: New test.

Missing vertical space between date/name/mail and first entry.

> @@ -1003,7 +1004,7 @@ asan_emit_stack_protection (rtx base, rtx pbase, 
> unsigned int alignb,
>    str_cst = asan_pp_string (&asan_pp);
>  
>    /* Emit the prologue sequence.  */
> -  if (asan_frame_size > 32 && asan_frame_size <= 65536 && pbase)
> +  if (asan_frame_size > 32 && asan_frame_size <= 65536 && pbase && 
> ASAN_USE_AFTER_RETURN)
>      {
>        use_after_return_class = floor_log2 (asan_frame_size - 1) - 5;
>        /* __asan_stack_malloc_N guarantees alignment

Please wrap this.

> --- a/gcc/cfgexpand.c
> +++ b/gcc/cfgexpand.c
> @@ -798,7 +798,7 @@ partition_stack_vars (void)
>            sizes, as the shorter vars wouldn't be adequately protected.
>            Don't do that for "large" (unsupported) alignment objects,
>            those aren't protected anyway.  */
> -       if ((flag_sanitize & SANITIZE_ADDRESS) && isize != jsize
> +       if ((flag_sanitize & SANITIZE_ADDRESS) && ASAN_STACK  && isize != 
> jsize

Replace the two spaces with just one.

> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -10037,6 +10037,36 @@ The default choice depends on the target.
>  Set the maximum number of existing candidates that will be considered when
>  seeking a basis for a new straight-line strength reduction candidate.
>  
> +@item asan-globals
> +Enable buffer overflow detection for global objects. This kind of protection
> +is enabled by default if you are using @option{-fsanitize=address} option.
> +To disable global objects protection use @option{--param asan-globals=0} 
> option.

Too long lines (several times).
> +To disable memory reads instructions protection use @option{--param 
> asan-instrument-reads=0} option.
> +
> +@item asan-instrument-writes
> +Enable buffer overflow detection for memory writes instructions. This kind 
> of protection
> +is enabled by default if you are using @option{-fsanitize=address} option.
> +To disable memory writes instructions protection use @option{--param 
> asan-instrument-writes=0} option.
> +
> +@item asan-memintrin
> +Enable detection for builtin functions. This kind of protection

I think for docs it should be "built-in functions".

As for the tests, I'm afraid I don't like them at all.
If anything, it ought to be dg-do compile tests where you say
scan assembly or some dump, but having runtime testcases that
trigger undefined behavior that isn't detected by the instrumentation
library at all and expect them to "pass" is simply wrong.

        Jakub

Reply via email to