From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0861D385840B; Tue, 21 May 2024 09:01:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0861D385840B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1716282074; bh=x+3YHUevrUnxarvYkvrBh1hN/NEJLgA4VkxCJeImepQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DtE1XdcObI/yFIY4eajV9obXhuYPYd/M7VELcFOpLEvRPXVhsQYnACgX68Y5buLoj bwstZmneKfGj0zT8T/mZleoGIMsXipO2cYe2WQZXiNakkWRJKw58b/Eg6QWYKRn/AG D+NFKx6Rm0aoXqV/ozyIR5QTSFj83C/hPzuAo7KI= From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/111736] Address sanitizer is not compatible with named address spaces Date: Tue, 21 May 2024 09:01:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: addr-space, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111736 --- Comment #46 from Uro=C5=A1 Bizjak --- Created attachment 58259 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D58259&action=3Dedit Preprocessed file gcc -O2 -fsanitize=3Dkernel-address -fasan-shadow-offset=3D0xdffffc00000000= 00 --param asan-instrumentation-with-call-threshold=3D10000 -fsanitize=3Dbool = -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.=