From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3D9013851C1B; Tue, 16 Mar 2021 10:37:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D9013851C1B From: "kito at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/96307] [10 Regression] ICE in sanopt on riscv64 since r11-2283-g2ca1b6d009b194286c3ec91f9c51cc6b0a475458 Date: Tue, 16 Mar 2021 10:37:37 +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: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: kito at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: kito at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Mar 2021 10:37:37 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96307 --- Comment #12 from Kito Cheng --- > This disables the CC_HAS_KASAN_GENERIC config of the kernel, making KASAN= unavailable. Hmmmm, I checked with kernel source code, it only feed -fsanitize=3Dkernel-address during checking, but in fact it must work with -fasan-shadow-offset=3D, and it does actually, what do you think about fix = that on kernel side? diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan index fba9909e31b7..9a2484132b2d 100644 --- a/lib/Kconfig.kasan +++ b/lib/Kconfig.kasan @@ -13,7 +13,7 @@ config HAVE_ARCH_KASAN_VMALLOC bool config CC_HAS_KASAN_GENERIC - def_bool $(cc-option, -fsanitize=3Dkernel-address) + def_bool $(cc-option, -fsanitize=3Dkernel-address -fasan-shadow-offset=3D0x1) config CC_HAS_KASAN_SW_TAGS def_bool $(cc-option, -fsanitize=3Dkernel-hwaddress) > Also, the warning text doesn't make sense: > > $ gcc -fsanitize=3Dkernel-address -S -xc /dev/null -o /dev/null > cc1: warning: =E2=80=98-fsanitize=3Dkernel-address=E2=80=99 with stack pr= otection is not supported without =E2=80=98-fasan-shadow-offset=3D=E2=80=99= for this target That's my fault I didn't update the error message there, that error message= was introduced when fixing PR96260, but during fix this PR. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96260=