https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111736
Uroš Bizjak <ubizjak at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|FIXED |---
Status|RESOLVED |REOPENED
--- Comment #10 from Uroš Bizjak <ubizjak at gmail dot com> ---
Huh, is this really fixed?
--cut here--
extern int __seg_gs m;
int foo (void)
{
return m;
}
extern __thread int n;
int bar (void)
{
return n;
}
extern int o;
int baz (void)
{
return o;
}
--cut here--
gcc -O2 -fsanitize=address:
foo:
.LASANPC0:
.LFB0:
.cfi_startproc
movl $m, %eax
movq %rax, %rdx
andl $7, %eax
shrq $3, %rdx
addl $3, %eax
movzbl 2147450880(%rdx), %edx
cmpb %dl, %al
jl .L2
testb %dl, %dl
jne .L13
.L2:
movl %gs:m(%rip), %eax
ret
.L13:
pushq %rax
.cfi_def_cfa_offset 16
movl $m, %edi
call __asan_report_load4
.cfi_endproc
.LFE0:
.size foo, .-foo
.p2align 4
.globl bar
.type bar, @function
The memory access is still annotated with asan code.
I did test patched gcc by building a kernel with named address spaces, but I'm
not sure I did it correctly anymore - I was not able to boot recent -tip with
KASAN and enabled named address spaces.