From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C3D6C433EF for ; Tue, 2 Nov 2021 09:52:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 750F060C4B for ; Tue, 2 Nov 2021 09:52:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230109AbhKBJys (ORCPT ); Tue, 2 Nov 2021 05:54:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230519AbhKBJyn (ORCPT ); Tue, 2 Nov 2021 05:54:43 -0400 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1F75C061714 for ; Tue, 2 Nov 2021 02:52:06 -0700 (PDT) Received: by mail-il1-x12a.google.com with SMTP id k1so5974827ilo.7 for ; Tue, 02 Nov 2021 02:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O2nGFtzDaXHyeOZl97W40HgCMEByRYpy5y6YeQ7i06E=; b=U7cr5ih4yEnzRsMP9dz4FZ+o2tbuJF1cO1WaSNg8J/rnIZIFp+gs7+mYsvlz9bcPxt gWdgCSLK9JuqJU3g6i4X4FqR77+sAP8Rqt5EdZulsRLZCHKxt9ExM/m8uRK+nRsB8fDK Z9xVbYpTwYjdLJLNaDlqtTkoOnffkZzUmEI7T/HaNxpQfTPxroweaYyQYMiHH66x1h5d aMwSNjdS4/MU/67XsGBJqVb/5aqTWT7APSwNW3uC4BB8i16/hMDUC4UD9Dpty0vnWndN V3awWhGJkoFEx1iq2AtXoT5wdAA8/EQpIPiDHR40MY17Veui2UKVZito8Bw0chDc8xSI wXgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O2nGFtzDaXHyeOZl97W40HgCMEByRYpy5y6YeQ7i06E=; b=14Av/cRJBN1TkZqy7QBPpIucAsLXlueLPpTYgx6/3Wara+XbxKATdm9F/FsueR4Avy EbXNXsqgK72FLwyxF3/B58orYXiDyAfU4LLcDXGJ/dLtFvJsYvvX5U9wlPJirAp/uMBH TgdrcbYK8K8R6F4Ty+Y8qbV5chhcNH02P+R5EhKRA89h5rp6Fz3iqWkrWKyv248jleLs H/yA6jU4j2Df9+QPlK9lTpn6AsNWeqzecJ7IAix+fQnYesYPvMJQHrDKvP1pHxKxLt4x tRk97V/r5hHDSyYgg/t2voMnQGvWJiGXy+aCB4w61h7bet0QmdPAA+xCuf1gn0dumIuf jA8w== X-Gm-Message-State: AOAM530zPbEkBrDOGep7YiPKma7cW0nbXh5S5fnJ0l6TM9jphxNbOwWP oA29LuGNvc4R/4ZjaJCCl6k5eCVAo+AzUDLSL1o= X-Google-Smtp-Source: ABdhPJx3Ovni2QkIuB18vdAxewaOt4cyMM0hg55RN2KyVoE5eVIfOOm1mPxYJeYeBQC3gdZKEwi0Q9EGFOPVghkW0IU= X-Received: by 2002:a05:6e02:1b8a:: with SMTP id h10mr24491131ili.237.1635846726316; Tue, 02 Nov 2021 02:52:06 -0700 (PDT) MIME-Version: 1.0 References: <20211102075812.122715-1-ashimida@linux.alibaba.com> In-Reply-To: <20211102075812.122715-1-ashimida@linux.alibaba.com> From: Miguel Ojeda Date: Tue, 2 Nov 2021 10:51:55 +0100 Message-ID: Subject: Re: [PATCH] [RFC/RFT] AARCH64: Add gcc Shadow Call Stack support To: Dan Li Cc: Catalin Marinas , Will Deacon , Nathan Chancellor , Nick Desaulniers , Kees Cook , Thomas Gleixner , Andrew Morton , Peter Zijlstra , Sami Tolvanen , Masahiro Yamada , Mike Rapoport , Mark Rutland , frederic@kernel.org, yifeifz2@illinois.edu, Steven Rostedt , Viresh Kumar , andreyknvl@gmail.com, Colin King , Miguel Ojeda , Arnd Bergmann , Luc Van Oostenryck , Arvind Sankar , Marco Elver , linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org On Tue, Nov 2, 2021 at 8:58 AM Dan Li wrote: > > I tried to submit a patch[1] to add compiler's SCS support on gcc-11.1.0. This would go into GCC 12, right? > [1] https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583062.html Nit: you can use the `Link: ` tag for this. > # Supported by clang >= 7.0 We should add a comment here saying the minimum version too, e.g. GCC >= 12 (assuming it will be merged) > config CC_HAVE_SHADOW_CALL_STACK > - def_bool $(cc-option, -fsanitize=shadow-call-stack -ffixed-x18) > + def_bool CC_IS_CLANG || $(cc-option, -fsanitize=shadow-call-stack -ffixed-x18) This is changing the default for Clang (which looks fine due to our minimum Clang version), but if the test for GCC works the same way, why not just keep the line as it was since it covers both? > +#if __has_attribute(__no_sanitize_shadow_call_stack__) > +#define __noscs __attribute__((no_sanitize_shadow_call_stack)) > +#else > +#define __noscs > +#endif No need for the `else` branch here, it is done in `compiler_types.h` (to be consistent with Clang). Also, I hope one day GCC and Clang doing the same for these sanitize-related bits... Cheers, Miguel