From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id 5507C3858292 for ; Mon, 11 Jul 2022 07:15:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5507C3858292 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de Received: from sslproxy01.your-server.de ([78.46.139.224]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oAne2-000BKC-OG for newlib@sourceware.org; Mon, 11 Jul 2022 09:15:51 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy01.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oAne2-000VlX-V2 for newlib@sourceware.org; Mon, 11 Jul 2022 09:15:50 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 8F452480151 for ; Mon, 11 Jul 2022 09:15:50 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id dAnfVGOd7w7E for ; Mon, 11 Jul 2022 09:15:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 47B384801DA for ; Mon, 11 Jul 2022 09:15:50 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 7RqQoN474leA for ; Mon, 11 Jul 2022 09:15:50 +0200 (CEST) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 20AFA4801D3 for ; Mon, 11 Jul 2022 09:15:50 +0200 (CEST) From: Sebastian Huber To: newlib@sourceware.org Subject: [PATCH 4/6] cdefs: Make __nosanitizeaddress work for KASAN as well Date: Mon, 11 Jul 2022 09:15:45 +0200 Message-Id: <20220711071547.106142-5-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220711071547.106142-1-sebastian.huber@embedded-brains.de> References: <20220711071547.106142-1-sebastian.huber@embedded-brains.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.103.6/26597/Sun Jul 10 09:56:43 2022) X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2022 07:15:54 -0000 From: Mark Johnston Add __nosanitizememory while I'm here. Reviewed by: andrew, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30126 --- newlib/libc/include/sys/cdefs.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/newlib/libc/include/sys/cdefs.h b/newlib/libc/include/sys/cd= efs.h index 6d179c2b4..7eb6c0430 100644 --- a/newlib/libc/include/sys/cdefs.h +++ b/newlib/libc/include/sys/cdefs.h @@ -699,12 +699,18 @@ #define __no_lock_analysis __lock_annotate(no_thread_safety_analysis) =20 /* - * Function or variable should not be sanitized, i.e. by AddressSanitize= r. + * Function or variable should not be sanitized, e.g., by AddressSanitiz= er. * GCC has the nosanitize attribute, but as a function attribute only, a= nd * warns on use as a variable attribute. */ #if __has_attribute(no_sanitize) && defined(__clang__) +#ifdef _KERNEL +#define __nosanitizeaddress __attribute__((no_sanitize("kernel-address")= )) +#define __nosanitizememory __attribute__((no_sanitize("kernel-memory"))) +#else #define __nosanitizeaddress __attribute__((no_sanitize("address"))) +#define __nosanitizememory __attribute__((no_sanitize("memory"))) +#endif #define __nosanitizethread __attribute__((no_sanitize("thread"))) #else #define __nosanitizeaddress --=20 2.35.3