public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/111736] Address sanitizer is not compatible with named address spaces
Date: Wed, 20 Mar 2024 20:04:05 +0000	[thread overview]
Message-ID: <bug-111736-4-IzrngE9O98@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111736-4@http.gcc.gnu.org/bugzilla/>

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.

  parent reply	other threads:[~2024-03-20 20:04 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-09 11:53 [Bug sanitizer/111736] New: " ubizjak at gmail dot com
2023-10-09 12:31 ` [Bug sanitizer/111736] " rguenth at gcc dot gnu.org
2023-10-09 13:27 ` amonakov at gcc dot gnu.org
2023-10-09 16:27 ` amonakov at gcc dot gnu.org
2023-12-05 13:05 ` rguenth at gcc dot gnu.org
2023-12-05 14:11 ` cvs-commit at gcc dot gnu.org
2023-12-05 14:12 ` rguenth at gcc dot gnu.org
2023-12-19  9:29 ` ubizjak at gmail dot com
2023-12-19 10:06 ` rguenth at gcc dot gnu.org
2023-12-19 11:04 ` cvs-commit at gcc dot gnu.org
2023-12-29  9:42 ` ubizjak at gmail dot com
2024-03-20 20:04 ` ubizjak at gmail dot com [this message]
2024-03-20 21:45 ` ubizjak at gmail dot com
2024-03-21  6:44 ` ubizjak at gmail dot com
2024-03-21  7:24 ` rguenth at gcc dot gnu.org
2024-03-21  7:26 ` rguenth at gcc dot gnu.org
2024-03-21  7:45 ` rguenth at gcc dot gnu.org
2024-03-21  8:04 ` ubizjak at gmail dot com
2024-03-21  8:35 ` rguenther at suse dot de
2024-03-21  8:46 ` jakub at gcc dot gnu.org
2024-03-21  9:18 ` ubizjak at gmail dot com
2024-03-21  9:26 ` jakub at gcc dot gnu.org
2024-03-21  9:41 ` jakub at gcc dot gnu.org
2024-03-21  9:49 ` cvs-commit at gcc dot gnu.org
2024-03-21 11:49 ` cvs-commit at gcc dot gnu.org
2024-03-21 12:56 ` jakub at gcc dot gnu.org
2024-03-22  8:25 ` cvs-commit at gcc dot gnu.org
2024-03-25  9:13 ` ubizjak at gmail dot com
2024-03-25  9:31 ` jakub at gcc dot gnu.org
2024-03-25  9:45 ` jakub at gcc dot gnu.org
2024-03-25 10:20 ` ubizjak at gmail dot com
2024-03-26 10:13 ` cvs-commit at gcc dot gnu.org
2024-03-30  3:55 ` cvs-commit at gcc dot gnu.org
2024-03-30  3:55 ` cvs-commit at gcc dot gnu.org
2024-04-23 17:09 ` cvs-commit at gcc dot gnu.org
2024-04-23 17:09 ` cvs-commit at gcc dot gnu.org
2024-04-23 17:09 ` cvs-commit at gcc dot gnu.org
2024-04-23 17:09 ` cvs-commit at gcc dot gnu.org
2024-04-24 14:39 ` cvs-commit at gcc dot gnu.org
2024-04-24 14:39 ` cvs-commit at gcc dot gnu.org
2024-04-24 14:39 ` cvs-commit at gcc dot gnu.org
2024-04-24 14:40 ` cvs-commit at gcc dot gnu.org
2024-04-24 14:41 ` ubizjak at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-111736-4-IzrngE9O98@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).