public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/115172] New: Invalid -fsanitize=bool sanitization of variable from named address space
@ 2024-05-21  9:33 ubizjak at gmail dot com
  2024-05-21 10:05 ` [Bug sanitizer/115172] " jakub at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: ubizjak at gmail dot com @ 2024-05-21  9:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115172
           Summary: Invalid -fsanitize=bool sanitization of variable from
                    named address space
           Product: gcc
           Version: 14.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ubizjak 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: ---

Created attachment 58260
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58260&action=edit
Preprocessed file

Originally reported in PR 111736, comment 42.

Compiling the attached preprocessed file with:

gcc -O2 -fsanitize=kernel-address -fasan-shadow-offset=0xdffffc0000000000
--param asan-instrumentation-with-call-threshold=10000 -fsanitize=bool -S
alternative.i

results in:

        movabsq $-2305847407260205056, %rdx
        movl    $cpu_tlbstate_shared, %eax
        shrq    $3, %rax
        movzbl  (%rax,%rdx), %eax
        testb   %al, %al
        je      .L399
        jle     .L473
.L399:
        movzbl  %gs:cpu_tlbstate_shared(%rip), %r14d
        cmpb    $1, %r14b

which is wrong. %gs: prefixed addresses should not be sanitized.

Omitting -fsanitize=bool from the above compiles the preprocessed file to:

        movzbl  %gs:cpu_tlbstate_shared(%rip), %eax
        testb   %al, %al

where no sanitization is present with the above variable.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-05-28 17:11 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-21  9:33 [Bug sanitizer/115172] New: Invalid -fsanitize=bool sanitization of variable from named address space ubizjak at gmail dot com
2024-05-21 10:05 ` [Bug sanitizer/115172] " jakub at gcc dot gnu.org
2024-05-21 10:16 ` jakub at gcc dot gnu.org
2024-05-21 10:20 ` ubizjak at gmail dot com
2024-05-21 10:35 ` jakub at gcc dot gnu.org
2024-05-21 14:21 ` ubizjak at gmail dot com
2024-05-21 17:19 ` pchelkin at ispras dot ru
2024-05-21 21:08 ` jakub at gcc dot gnu.org
2024-05-22  7:13 ` cvs-commit at gcc dot gnu.org
2024-05-22  7:19 ` cvs-commit at gcc dot gnu.org
2024-05-22  7:35 ` cvs-commit at gcc dot gnu.org
2024-05-22 11:11 ` jakub at gcc dot gnu.org
2024-05-28 17:09 ` cvs-commit at gcc dot gnu.org
2024-05-28 17:09 ` cvs-commit at gcc dot gnu.org
2024-05-28 17:11 ` ubizjak at gmail dot com

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).