From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EAEDA3858412; Thu, 21 Mar 2024 08:35:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EAEDA3858412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711010107; bh=vDS0aADJ5EyRVYjQCW2gQEmvCLIli7Vyq8Vyk7aEi1M=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mf4yg/fR8LHo6RpA4LU497QDRsSusmlTCEKQ5Gk+Ru9BU/54cHCWgz4L1t0YwKmWk 7rJ4jhTPOaHlTrQvrXLjPwRVBHyt+HfkAqOWECR/XQssgvVnGRIoXDUAou5U7UIC4v NyZHV093YHi8SFeNRbhTsyHzW0cXk1GdtbwqHh/M= From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/111736] Address sanitizer is not compatible with named address spaces Date: Thu, 21 Mar 2024 08:35:03 +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: rguenther at suse dot de X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111736 --- Comment #17 from rguenther at suse dot de --- On Thu, 21 Mar 2024, ubizjak at gmail dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111736 >=20 > --- Comment #16 from Uro? Bizjak --- > (In reply to Richard Biener from comment #13) > > The original testcase is fixed, appearantly slapping 'extern' on the int > > makes it not effective. > >=20 > > Possibly better amend the > >=20 > > if (VAR_P (inner) && DECL_HARD_REGISTER (inner)) > > return; > >=20 > > check though. As indicated my fix fixed only VAR_DECL cases, there's > > still pointer-based accesses (MEM_REF) to consider. So possibly even > > the following is necessary >=20 > I must admit that to create the patch from Comment #11 I just mindlessly > searched for DECL_THREAD_LOCAL_P in asan.cc and amended the location with > ADDR_SPACE_GENERIC_P check. It might be that the DECL_THREAD_LOCAL_P handling is similarly broken in that int foo (int *p) { return *p; } is instrumented even when p is a pointer to thread local storage? But maybe that works fine and it handled in the runtime. But of course the runtime can't handle non-generic address-spaces at all unless we can convert all those addresses to ones in the generic address-space (given suitable overlap of course). > However, ASAN should back off from annotating *any* gs: prefixed address.= =20 >=20 > I'll test your patch from Comment #13 ASAP.=