From patchwork Fri Oct 21 11:59:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miguel Ojeda X-Patchwork-Id: 6669 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp667934wrr; Fri, 21 Oct 2022 05:25:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM46eiTdZyYh3ZqUfB3o5WPk5Ur4lB8/qPIJXkBJyWzHxmCE6cVNfZc3l6yOCL/2BGNj53sO X-Received: by 2002:a17:907:720e:b0:78e:2b59:fdf1 with SMTP id dr14-20020a170907720e00b0078e2b59fdf1mr15725324ejc.659.1666355138636; Fri, 21 Oct 2022 05:25:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666355138; cv=none; d=google.com; s=arc-20160816; b=k3qbsEty0QQwI27/AUdnP1fssWxpQkYaLROFKcfPBBqYHnyCU3CWgeKEvjzG5VSdNZ EKURQQCgF/21EMIhWxRkL3B2yt/zcfp90IVilMPhQkxQ9NCCHaoSh9OIF0a0jDR07hlt l/lAAc9WxMEW5wIiSaoyazziKAjaD9EiYoLOIrwJi8dE+L8bm2WhSbJRycj28D2JT+qn LNjB3Ka0zReLdwhWi7pFeXdR7vcpsGkhvWk9MJqYQjnmNG4RJZore0YKrL5pYOWCd9cu jNZjdE8DBDaS2uKC5IlPOOAwfY4f2RuD2z2Sws5rFNNk3QzA6+/C4nOdglFvePFvw+xB lwcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=qEnY/tYRtqHG2Qfa00jTQhr8RMAKK4jMsdIiqcf11aw=; b=wBHjdZbJxd1MXImZ2WvwIEIZITXTkFwFx48pqsIkDcsDGUV0TeRJ2qy5OLxzrGMXI5 ODo/XLQhPhjEiqy6iLbXsRoCnkyYtqT+VC1hVB2BkEph1MZRtuhtO7Ysi2HUTa2sof3o KlLvlxXW/nbgHYWqLaeCn+S7FRuVU67my89ANU1AVLBHjj/NcsN1WLwp8VvwKDmcRuzh E9CFM0tCbcSG1OZl2EoUWA6ftSNp/xfIcxhvZb+wZXefysKyQDR37yoD6NbyusC/LckS xsW5GYLZ2Tdbi729A8Cnhx78MkWQ1pIaZqPcT9Z7+2PszEYWriYGoLSF8Dcpy0VJhyaB 7C8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dF4pLXzg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m7-20020a056402510700b0045935adb5b1si22148512edd.395.2022.10.21.05.25.12; Fri, 21 Oct 2022 05:25:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dF4pLXzg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229919AbiJUMA2 (ORCPT + 99 others); Fri, 21 Oct 2022 08:00:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbiJUMA0 (ORCPT ); Fri, 21 Oct 2022 08:00:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 831B824C10A for ; Fri, 21 Oct 2022 05:00:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 85E68B82B93 for ; Fri, 21 Oct 2022 12:00:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 264AEC433D6; Fri, 21 Oct 2022 12:00:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666353622; bh=k8JUHW9fchhpucbQdTqeS+XpjxIaOPmsYLjmQJ8UZt0=; h=From:To:Cc:Subject:Date:From; b=dF4pLXzg6J4TMw39jr2J4A25Xhwm4piQylhLCHimblU8Uw7VsAofbSTAYtnTdnOxV /lTYg3DbdATbgMBqCeoCBCIN0m35HnCl2SbOEPWe1JtjnGNG35FVLy0oeukNqlxkq6 OG8mzxkg0UjTQAMy2IfxuW0l6/bzB/CvRxZxWT+qH3/NXyk+YcwEUdg41zdbwbvXmw rBn5PZJ671ijJVSfoe7mqu2RyAfemnsRdfXvdnZxSSJJu3/ToXfDDemxRZyceG+miK phx+V6K0Wl9/IWHANeIqGlKcywz27XEqMJZdLPhWAnQVUCVhf4fFVSLrlHkhgO6urI IsDagljFJh/mg== From: Miguel Ojeda To: Andrey Konovalov , Marco Elver , Kees Cook , Arnd Bergmann Cc: Andrew Morton , Kumar Kartikeya Dwivedi , Nick Desaulniers , Nathan Chancellor , Uros Bizjak , Dan Li , Alexander Potapenko , Miguel Ojeda , linux-kernel@vger.kernel.org Subject: [PATCH 1/5] compiler-gcc: be consistent with underscores use for `no_sanitize` Date: Fri, 21 Oct 2022 13:59:52 +0200 Message-Id: <20221021115956.9947-1-ojeda@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747300006226828122?= X-GMAIL-MSGID: =?utf-8?q?1747300006226828122?= Other macros that define shorthands for attributes in e.g. `compiler_attributes.h` and elsewhere use underscores. Signed-off-by: Miguel Ojeda Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor --- include/linux/compiler-gcc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) base-commit: 9abf2313adc1ca1b6180c508c25f22f9395cc780 diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index f55a37efdb97..b9530d3515ac 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -83,25 +83,25 @@ #endif #if __has_attribute(__no_sanitize_address__) -#define __no_sanitize_address __attribute__((no_sanitize_address)) +#define __no_sanitize_address __attribute__((__no_sanitize_address__)) #else #define __no_sanitize_address #endif #if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__) -#define __no_sanitize_thread __attribute__((no_sanitize_thread)) +#define __no_sanitize_thread __attribute__((__no_sanitize_thread__)) #else #define __no_sanitize_thread #endif #if __has_attribute(__no_sanitize_undefined__) -#define __no_sanitize_undefined __attribute__((no_sanitize_undefined)) +#define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__)) #else #define __no_sanitize_undefined #endif #if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__) -#define __no_sanitize_coverage __attribute__((no_sanitize_coverage)) +#define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__)) #else #define __no_sanitize_coverage #endif From patchwork Fri Oct 21 11:59:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miguel Ojeda X-Patchwork-Id: 6670 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp667952wrr; Fri, 21 Oct 2022 05:25:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4u2KyFZanCJskn8tXVmDlnLMQjyPq2PnLIYKuWBp/9lQ9/KTPPCN4/Js0YCFpIV8anp/es X-Received: by 2002:aa7:d348:0:b0:45b:8ae3:ee3d with SMTP id m8-20020aa7d348000000b0045b8ae3ee3dmr17106392edr.428.1666355141015; Fri, 21 Oct 2022 05:25:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666355141; cv=none; d=google.com; s=arc-20160816; b=JWsSUHSFilGD/D6qKYwnnR6R79A69gBGXEQv7Y8hE9v4+2cR5D8QH5CXO9HeztY02i 1x76Uijyy+CRfLpnjGG9lOf7ql3AkYEGc4QP+f4Xc4HKyArR8eKdsPub0i9RX0IfDojw oid9RwdLrlRKRsK2ovkAU469AMkiKZSHNXHo0EYOs2hwrAuNqp0cEoPdxaeF2kSc65F6 xx4cEjLWDvJr0MhhLpOwe1tUY/vy2JsT5wxBzmVwBkFX5Fdcckohu0DiTBSBwpGrlAoR FB1w4yH/O/K7d7FSK6R/KX2q4bKZYWUSq5Ncs3NqxH13G8I47iI53rDDT/pB6u2aZdo5 svYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=a9XIqChclOmeQ7vZlCohsxnyI/Vmjxjw2nyGDEHlH9w=; b=Y3rUO486uywb8/tLtn/5uc8uniuwp6cpBtV1Xo1aLnnFXe9Jk6QQXqMU1uYY3cWsGp 34xesS9+0FxcTi9Dm6G03q7w5L3uj8K/CesaI2dwIFfpKfL7+vlOiMqsZ7kAROh5kk/T 3noV08PyIyEx2qUjRE+jCLz7+40cyXEA8MWqG5/cJn0B+i7UxZrm816VNW4FghizWMd4 +QoP94GvmpG3bVS1ebTwWheN6NRpXNiT5TLQnOiYivfaQYTmKG00jeTqmaAUHJPjPtxN dcXo+GtBdN5W35M3rEpLDURC6ze40AbbIyBhqw1h71AwJ0+mhaSTWqyT2PleJqPbuJsb XdhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oLdIZz3l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y19-20020a056402271300b0045d9a3adf19si14675066edd.564.2022.10.21.05.25.16; Fri, 21 Oct 2022 05:25:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oLdIZz3l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230201AbiJUMAd (ORCPT + 99 others); Fri, 21 Oct 2022 08:00:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbiJUMA3 (ORCPT ); Fri, 21 Oct 2022 08:00:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBE7E24E42B for ; Fri, 21 Oct 2022 05:00:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4812361E67 for ; Fri, 21 Oct 2022 12:00:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC641C43470; Fri, 21 Oct 2022 12:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666353625; bh=wLiSsLCBvUemVPUmA7PVLvUAvaGVpUx35Yr4C7U15XA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oLdIZz3lKKkdU27FrbVGeSE2xW3GDlfWRHpAsKzY9gP9Jnv7umrhBCq3LbH/H7kf9 uCSueC8OBTd5ZBZU0YrD11bBheye3DDGBljEnh7o8I9LsuEXY8JDAJhhaQE/0GNznI XeqOeVn8rLwPKHUFc7ht/KjgoaTInYvnVYRPTK7yl0FY+8nk4Czzw1axmOioSo8pUv S4bT2Osu8sQaWSk193hDIJlHo71Uit0mZQ1+A+Hoa1Os3yS/3U/9+YkaIdvyc1a39a rU75eLuRQK2T4umxzqtkevP8lKTbVAV4mR7OHfkeqDg3nMM6rwP0asUEk5orrUAqmn jjBlBWx7TpJCw== From: Miguel Ojeda To: Andrey Konovalov , Marco Elver , Kees Cook , Arnd Bergmann Cc: Andrew Morton , Kumar Kartikeya Dwivedi , Nick Desaulniers , Nathan Chancellor , Uros Bizjak , Dan Li , Alexander Potapenko , Miguel Ojeda , linux-kernel@vger.kernel.org Subject: [PATCH 2/5] compiler-gcc: remove attribute support check for `__no_sanitize_address__` Date: Fri, 21 Oct 2022 13:59:53 +0200 Message-Id: <20221021115956.9947-2-ojeda@kernel.org> In-Reply-To: <20221021115956.9947-1-ojeda@kernel.org> References: <20221021115956.9947-1-ojeda@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747300008453744041?= X-GMAIL-MSGID: =?utf-8?q?1747300008453744041?= The attribute was added in GCC 4.8, while the minimum GCC version supported by the kernel is GCC 5.1. Therefore, remove the check. Link: https://godbolt.org/z/84v56vcn8 Signed-off-by: Miguel Ojeda Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor --- include/linux/compiler-gcc.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index b9530d3515ac..bfce7f4d0978 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -82,11 +82,7 @@ #define __noscs __attribute__((__no_sanitize__("shadow-call-stack"))) #endif -#if __has_attribute(__no_sanitize_address__) #define __no_sanitize_address __attribute__((__no_sanitize_address__)) -#else -#define __no_sanitize_address -#endif #if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__) #define __no_sanitize_thread __attribute__((__no_sanitize_thread__)) From patchwork Fri Oct 21 11:59:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miguel Ojeda X-Patchwork-Id: 6671 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp667999wrr; Fri, 21 Oct 2022 05:25:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM74sOVj8RgOUuvu4X6ZJYs58yIXf1xsxJJOvJU/SP4ryPCIcHyCxw/pxRH6gKjuBcFR6MG6 X-Received: by 2002:a17:906:1b49:b0:78d:b7b5:71cc with SMTP id p9-20020a1709061b4900b0078db7b571ccmr15036877ejg.536.1666355149566; Fri, 21 Oct 2022 05:25:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666355149; cv=none; d=google.com; s=arc-20160816; b=vlx5xqywcVac3zQ6BrFIbXUN0j3ocMCl4zV0F0+ZMBPnicspNhGK8tmKN2x2G1loQi hi99QitmR51HO2lQemmISTZQ4MNKS+V/zep906NSixEbtbFJvXW3vWAjQPGwXjXU8NBY Ei9J4Rws3nCIv36k7AATxaNxXRYoB9NFZInTx5c/K181d0Rs0x329J6ZWg7U5sQTbSN9 27oNgWhP1pkIFYbLmekjIwWu7nEUpG1lsvsKk2ygCXRWsuXKYG3G+4fjZX3lACLabgLb Gy2bvSATkyCUYaO9ApRPAugqcgzvp0ZId/5qf9NrgE6PEqCw5YotZ2yi7fndh70J7Roz FlpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IyqJrIrMrfHDqYeh97vndOBGkwR12BZcauxDAA+bz8w=; b=VWRU2FoPZmX3bDAiRwHBYChCGC7dJ7oG501Xiw7Va9BnViIE6Lrs4BQtVMFiRp0HIr Z/1NGG/O8vN2j5ijAdKCqGbZN9YTnIzB59kgls0z6OGMU64xxLUcJ517lesJM5SZOb+0 +Eji97Jtr9jK/PwXU+Bwk1aHyMWnq9mLcy+OjO07+hgLJpSpx62N0ihfCChoziGfsXtp Xxum84Ep+VADJi4sLdrgYkrVu2WUZ5uNfH3L6rMMV/HaXUeqdtp4LilTH5uknPudeII9 F4mDo2rWaXeW+f4D4FHLbgcTtQTLIefIpey1kKsVIh6Z9D529mRTYdFUbzoyHm8nxy5A bVzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=baCMPAux; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d25-20020a170906175900b0078e0e866a4dsi14976483eje.682.2022.10.21.05.25.24; Fri, 21 Oct 2022 05:25:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=baCMPAux; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230218AbiJUMAi (ORCPT + 99 others); Fri, 21 Oct 2022 08:00:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230158AbiJUMAc (ORCPT ); Fri, 21 Oct 2022 08:00:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53811251F6C for ; Fri, 21 Oct 2022 05:00:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E3FE561E6D for ; Fri, 21 Oct 2022 12:00:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35885C433B5; Fri, 21 Oct 2022 12:00:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666353629; bh=LjLwcRsPZ65V3+uAZ7ZJ20ekU/4YVxIRhGPnMyc8hg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=baCMPAuxXA5okUTpltIb1PDHRcQSWtRzcienWV3n48jfF8Q1Om+t1BddLs/7d0inO InEt3zCd6r9NHUbXIMY9PFstO8lNWAmBtcEUbaF1vbyc8hG/3nA2ztdGA1RGb4Wl3K dNwqE3PLZX5+eB8k95zqUizFUUQQ956brbMSA1LKzslbPxctl171bS9q/c2ltkthu5 dy8p3R/F4O9pVyb0dPvn3w7+n1az8dSGvClcU7DppMM1YL2dfIuY4AvpeK3TnMfO3v UQCwtxdKwyeP+hKa2hfsoNROys+c5Zv1hCKnYkhNeUfO+i0nH1ALJRpxMpjAFD3yhR y3JUNWJ3ls7kg== From: Miguel Ojeda To: Andrey Konovalov , Marco Elver , Kees Cook , Arnd Bergmann Cc: Andrew Morton , Kumar Kartikeya Dwivedi , Nick Desaulniers , Nathan Chancellor , Uros Bizjak , Dan Li , Alexander Potapenko , Miguel Ojeda , linux-kernel@vger.kernel.org Subject: [PATCH 3/5] compiler-gcc: remove attribute support check for `__no_sanitize_thread__` Date: Fri, 21 Oct 2022 13:59:54 +0200 Message-Id: <20221021115956.9947-3-ojeda@kernel.org> In-Reply-To: <20221021115956.9947-1-ojeda@kernel.org> References: <20221021115956.9947-1-ojeda@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747300017241027014?= X-GMAIL-MSGID: =?utf-8?q?1747300017241027014?= The attribute was added in GCC 5.1, which matches the minimum GCC version supported by the kernel. Therefore, remove the check. Link: https://godbolt.org/z/vbxKejxbx Signed-off-by: Miguel Ojeda Acked-by: Marco Elver Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor --- include/linux/compiler-gcc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index bfce7f4d0978..ba207deb77ca 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -84,7 +84,7 @@ #define __no_sanitize_address __attribute__((__no_sanitize_address__)) -#if defined(__SANITIZE_THREAD__) && __has_attribute(__no_sanitize_thread__) +#if defined(__SANITIZE_THREAD__) #define __no_sanitize_thread __attribute__((__no_sanitize_thread__)) #else #define __no_sanitize_thread From patchwork Fri Oct 21 11:59:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miguel Ojeda X-Patchwork-Id: 6666 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp667198wrr; Fri, 21 Oct 2022 05:23:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM42edDgwmIgtQbp1mb1cC+JCPvO9c4B8Qb/NYaNPA5JZgssoyjp7NoDgROz0Z3oUL8ALg8n X-Received: by 2002:a17:906:fc6:b0:72f:d080:416 with SMTP id c6-20020a1709060fc600b0072fd0800416mr15490553ejk.1.1666355027243; Fri, 21 Oct 2022 05:23:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666355027; cv=none; d=google.com; s=arc-20160816; b=gc23qJnPRtmTaRbIiCwkRg11JAQFDvNurJRe3G2ilv/SBwwKFZ2l1PozstsJEQ3Npy B8p0TRvAPOq7UGceUtycifcRLGJfXt5bMozom7ER85wObnbF+VABC+0+qh8r4wtmjjg7 Nsm7yIH+DzOlzNUgGG3Mw5dynxWbx8onfUWxlLrbXIxtENigV7Q+68RtOk45QahvEfOa gTo8veFSdDNsrkt1yV8FUlvOghZKKzFjtC7UAP5Oz7dzhTLyfUN9+syB6TMcmEOgyUX0 a0tdGJpVrMijlqfwPgIIcYrHFIUgS8FKHMZcgMFOAn0bekxLnNXM2A5qp031gxDA/Q4v WQ5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=I4P2tE5oWucC8aGI3RZWMoRLHFoWTLfht54HVZDfiB8=; b=J4uaFsns+hdBseJtW/gBU2/vE45buPjZJy7HNEpo4A0QJl5VakWoQ6t+nwAmlt2bkJ asdL90cG2aWc+eDu0JivRSSP8K3R8KTHqyQ9WYh/GAl17t0xCNgMfDjSMCLxohUwLwuL 6bIR20cAQRzUsaiEJjPpOuTj+HtU3AD0BgdZgZTKg/dLgNdyW7/hvEYXgpYHAZrylmXA ehJLwMC/WmQagyYFgkQ3Itj8q6JdgZQJUhOrFJogx5wePzhJlzbpA1GeX2GeBM2p2WJB GcDocUtnhkpLEBvdq8MDhIF+A6JyLHSRRHgEqMc7sGQKxMMUqZzCvlwDFXY63iPxPMJn C4Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lRRUVqO3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd14-20020a1709069b8e00b00797e151e571si4835611ejc.36.2022.10.21.05.23.21; Fri, 21 Oct 2022 05:23:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lRRUVqO3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229862AbiJUMAq (ORCPT + 99 others); Fri, 21 Oct 2022 08:00:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230226AbiJUMAj (ORCPT ); Fri, 21 Oct 2022 08:00:39 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CECCC251F6C for ; Fri, 21 Oct 2022 05:00:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 10A68B82B92 for ; Fri, 21 Oct 2022 12:00:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7330C433C1; Fri, 21 Oct 2022 12:00:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666353632; bh=XzdFROMipXdmkMLqEBVG7r+Qq/ycFDav+ihm+nprFco=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lRRUVqO3E1qBngvZkiPsbDUe43N8i1GrfX46QurdSPQ8voWfgv5owS7cY8PQ85VB/ uAyj13Y3I3p5za42OA6G2hnIOtHOrD3xWSuiwZa0u60g3+pyWDgIYxSIyrVSPXBx/i 1Ew1lwcs6Z7f0zL0Wy5H5SyOWFnoP6VVXEpiePRCxbwB+nPaKhKilN4t0I0IsNh8y9 wIbdTTau6kSZ8p39Hh5vs+Q5FI03DRkAUZLfOP0knGELWSnJY9CDjbGQw7tW3EKD2n kQMmF/IywkBz24C7AADfw6a02EuB83ACvZBXHvryDeeSbrBp64AKTwXXsWt4eLvksJ KY/QwSJ5NttcQ== From: Miguel Ojeda To: Andrey Konovalov , Marco Elver , Kees Cook , Arnd Bergmann Cc: Andrew Morton , Kumar Kartikeya Dwivedi , Nick Desaulniers , Nathan Chancellor , Uros Bizjak , Dan Li , Alexander Potapenko , Miguel Ojeda , linux-kernel@vger.kernel.org Subject: [PATCH 4/5] compiler-gcc: remove attribute support check for `__no_sanitize_undefined__` Date: Fri, 21 Oct 2022 13:59:55 +0200 Message-Id: <20221021115956.9947-4-ojeda@kernel.org> In-Reply-To: <20221021115956.9947-1-ojeda@kernel.org> References: <20221021115956.9947-1-ojeda@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747299889247035943?= X-GMAIL-MSGID: =?utf-8?q?1747299889247035943?= The attribute was added in GCC 4.9, while the minimum GCC version supported by the kernel is GCC 5.1. Therefore, remove the check. Link: https://godbolt.org/z/GrMeo6fYr Signed-off-by: Miguel Ojeda Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor --- include/linux/compiler-gcc.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index ba207deb77ca..7f2c2bb73815 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -90,11 +90,7 @@ #define __no_sanitize_thread #endif -#if __has_attribute(__no_sanitize_undefined__) #define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__)) -#else -#define __no_sanitize_undefined -#endif #if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__) #define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__)) From patchwork Fri Oct 21 11:59:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miguel Ojeda X-Patchwork-Id: 6667 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp667406wrr; Fri, 21 Oct 2022 05:24:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5uMp7qfnGZFktVKZpb4TnblIqVSYmX9uBUPkrKQ1CIEjq4sli+FEE+zRuTXBpNSytdnpvc X-Received: by 2002:a17:906:4fcb:b0:791:9a26:376f with SMTP id i11-20020a1709064fcb00b007919a26376fmr15266155ejw.431.1666355057043; Fri, 21 Oct 2022 05:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666355057; cv=none; d=google.com; s=arc-20160816; b=h2t3oe46rpzx1xWqRygTvVJCv/YUW+VMzJgyRybIwayRif11uCgzsnvukEN6A0XIsx CPXnW3opTsOiUQRFxFlsFiHsYxonKF/+bwv4F3Kicf/6UrNTgAxBmfThAE//UHGQYVGh rKrJnZgD9vs9Xb6FiwtPj8NFw8Xp4yXj+3tNnbOPykgjpZLwU7EEJ5PBjCzVHmmj5SkW ehj2VFQ/JtrqtEm5n88MblpFe4P8S++feQQYhsyVwmKdDNX2hRT1hRi0h6eo2sbjguug Biyjig2chtajpDFq7o0v31whE7fIcxcElYfiBqVWWd0r/touYIMUk9BUDAZRmdJ2VG3j 4/CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=djiBZHr31cBi/n2utljM5o7PSmAYOP5bFpxnddnSBRo=; b=Qq0I1fuA/zMKI8X0EZv6He/o2p2dfxvLVCJV0IeP1IZgKRAtmybMpkUjJtbuCoVtiq LTA1xQYOA1r0BfW4Z4XIgWlRZnyjgDbtQhdHSkHmNtgM8VguDh1Z8N3CnMfDoqA3zV4R 44MtwdvuSFILhfYtmjlrne7V9vIqy0s8ko1YpgyleHIWV58zO5ytUCj9OMwxhiV9Hs1N Tnz0Jf9uTwrUjAzo74h+Bg6BUQYnQuiM+rgvO7Tpv+dxHAtbtoRysrR1irw8S1TZG9b3 dIi7scWeuzeCYZgx3O0b3bWrdwad9LEeHwqaBtzLFSfPJ911PN/kdsgOFOIXToZot6R8 734Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uY6civyb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cs14-20020a0564020c4e00b00447d567a77dsi20441374edb.207.2022.10.21.05.23.51; Fri, 21 Oct 2022 05:24:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uY6civyb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230369AbiJUMAx (ORCPT + 99 others); Fri, 21 Oct 2022 08:00:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230244AbiJUMAr (ORCPT ); Fri, 21 Oct 2022 08:00:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F0D725F8C0 for ; Fri, 21 Oct 2022 05:00:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8D3C1B82B1D for ; Fri, 21 Oct 2022 12:00:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61B2EC433D6; Fri, 21 Oct 2022 12:00:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666353636; bh=LMbm0RHnpHjF4XALs9PiF0EN08cXmWMXDuFm/StCLYo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uY6civyb7kDMMqoM8kDnJuXgTvt96br4iOPCoRINeo7pN3UFMG2jZU+pbngyk4L32 mAEA5B5nw1nn2mZ3ztnJipCUK25eHx0Vn5DcQMhwX0e3namZGj91GAHkRC38Fze3Sv MVO4Uny0Tp80q6nH1WfO8QZnjWHApp7P80ZG/D9JQyQiUdRBGj9eHkbVJfB2iGGK7X ZIQWFovF/ERwkF6hJTF9msGZXnw0qQKGvv6NgTMLXfQWeI6xi8QOe5SBrKqD/OwTUX t+SZfkGLXNRgJ838gDjofYl5p25Oc5nEv/Y0o37GjJvY2Z9EeIaujzLZTtVk1akrSF tL30aNK+edApA== From: Miguel Ojeda To: Andrey Konovalov , Marco Elver , Kees Cook , Arnd Bergmann Cc: Andrew Morton , Kumar Kartikeya Dwivedi , Nick Desaulniers , Nathan Chancellor , Uros Bizjak , Dan Li , Alexander Potapenko , Miguel Ojeda , linux-kernel@vger.kernel.org Subject: [PATCH 5/5] compiler-gcc: document minimum version for `__no_sanitize_coverage__` Date: Fri, 21 Oct 2022 13:59:56 +0200 Message-Id: <20221021115956.9947-5-ojeda@kernel.org> In-Reply-To: <20221021115956.9947-1-ojeda@kernel.org> References: <20221021115956.9947-1-ojeda@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747299919967615991?= X-GMAIL-MSGID: =?utf-8?q?1747299919967615991?= The attribute was added in GCC 12.1. This will simplify future cleanups, and is closer to what we do in `compiler_attributes.h`. Link: https://godbolt.org/z/MGbT76j6G Signed-off-by: Miguel Ojeda Acked-by: Marco Elver Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor --- include/linux/compiler-gcc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 7f2c2bb73815..7af9e34ec261 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -92,6 +92,9 @@ #define __no_sanitize_undefined __attribute__((__no_sanitize_undefined__)) +/* + * Only supported since gcc >= 12 + */ #if defined(CONFIG_KCOV) && __has_attribute(__no_sanitize_coverage__) #define __no_sanitize_coverage __attribute__((__no_sanitize_coverage__)) #else