[Bug sanitizer/69863] New: no_sanitize_address doesn't disable stack instrumentation

ryabinin.a.a at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Feb 18 08:39:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69863

            Bug ID: 69863
           Summary: no_sanitize_address doesn't disable stack
                    instrumentation
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ryabinin.a.a at gmail dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---

Attribute no_sanitize_address doesn't disable instrumentation completely.

Apparently no_sanitize_address only disables memory access checks, but it 
doesn't have influence on stack redzones. 
Regardless of this attribute gcc creates and poisons/unpoisons stack redzones.

$ cat no_sanitize_stack_test.c 

void g(int *a);

__attribute__((no_sanitize_address))
void func(void)
{
        int a;
        g(&a);
}

$ gcc -fsanitize=address -c no_sanitize_stack_test.c && objdump -d
no_sanitize_stack_test.o

0000000000000000 <func>:

....
  4d:   49 c1 ec 03             shr    $0x3,%r12
  51:   41 c7 84 24 00 80 ff    movl   $0xf1f1f1f1,0x7fff8000(%r12)
  58:   7f f1 f1 f1 f1 
  5d:   41 c7 84 24 04 80 ff    movl   $0xf4f4f404,0x7fff8004(%r12)
  64:   7f 04 f4 f4 f4 
  69:   41 c7 84 24 08 80 ff    movl   $0xf3f3f3f3,0x7fff8008(%r12)
  70:   7f f3 f3 f3 f3 
  75:   64 48 8b 14 25 28 00    mov    %fs:0x28,%rdx


More information about the Gcc-bugs mailing list