From owner-svn-src-all@freebsd.org Tue Nov 19 14:46:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A9E11B4D71; Tue, 19 Nov 2019 14:46:29 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47HTD52f14z4ZHC; Tue, 19 Nov 2019 14:46:29 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DF92C060; Tue, 19 Nov 2019 14:46:29 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAJEkTLl067852; Tue, 19 Nov 2019 14:46:29 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAJEkSri067850; Tue, 19 Nov 2019 14:46:28 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201911191446.xAJEkSri067850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Tue, 19 Nov 2019 14:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354854 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 354854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Nov 2019 14:46:29 -0000 Author: dab Date: Tue Nov 19 14:46:28 2019 New Revision: 354854 URL: https://svnweb.freebsd.org/changeset/base/354854 Log: Don't sanitize linker_set The assumptions of linker_set don't play nicely with AddressSanitizer. AddressSanitizer adds a 'redzone' of zeros around globals (including those in named sections), whereas linker_set assumes they are all packed consecutively like a pointer array. So: let's annotate linker_set so that AddressSanitizer ignores it. Submitted by: Matthew Bryan Reviewed by: kib, rang_acm.org Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22239 Modified: head/sys/sys/cdefs.h head/sys/sys/linker_set.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Tue Nov 19 13:28:59 2019 (r354853) +++ head/sys/sys/cdefs.h Tue Nov 19 14:46:28 2019 (r354854) @@ -872,6 +872,13 @@ /* Function should not be analyzed. */ #define __no_lock_analysis __lock_annotate(no_thread_safety_analysis) +/* Function or variable should not be sanitized, ie. by AddressSanitizer */ +#if __has_attribute(no_sanitize) +#define __nosanitizeaddress __attribute__((no_sanitize("address"))) +#else +#define __nosanitizeaddress +#endif + /* Guard variables and structure members by lock. */ #define __guarded_by(x) __lock_annotate(guarded_by(x)) #define __pt_guarded_by(x) __lock_annotate(pt_guarded_by(x)) Modified: head/sys/sys/linker_set.h ============================================================================== --- head/sys/sys/linker_set.h Tue Nov 19 13:28:59 2019 (r354853) +++ head/sys/sys/linker_set.h Tue Nov 19 14:46:28 2019 (r354854) @@ -61,6 +61,7 @@ __GLOBL(__CONCAT(__stop_set_,set)); \ static void const * qv \ __set_##set##_sym_##sym __section("set_" #set) \ + __nosanitizeaddress \ __used = &(sym) #define __MAKE_SET(set, sym) __MAKE_SET_QV(set, sym, __MAKE_SET_CONST) #else /* !__GNUCLIKE___SECTION */