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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E15E0C433EF for ; Tue, 1 Mar 2022 00:33:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bW3xJvu7QCRBO3+nbe1OcchR3Mm5BPL+fSMeyGLf4DA=; b=NKmNbE86bnUcGo Unq9aw9ESrfEeEqmljriJmNXY1pu7b0YPVSdcPq1y83yshNIcTWz7MkpoH7TUxPY/NSsqNPHXD1P/ 0NhGQnXHAxMGi/Ph1rQnzTdHuflHENX12m3tPaTaAerQZpw48pz69gwwABDfuE0YSgsjBNmeG9kvE qunQSKGqIsyvDxguoss5Lkr/4UEjp6JZ22qa17QKEaAPTfdz+y7ag0QIpLeadK5OA0UbD8i5kof4q AEAYpvmoOp9LUqXRo09z64ljNb9WR4rsDHiAjtndFWtbY6rVy5yJZu5IQwoy4uRUfXlTdFNTKqnA0 D4JcE6gqepaMqh12Eltg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOqQz-00EUKT-Gm; Tue, 01 Mar 2022 00:32:09 +0000 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOqQw-00EUIa-0V for linux-arm-kernel@lists.infradead.org; Tue, 01 Mar 2022 00:32:07 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R141e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04423; MF=ashimida@linux.alibaba.com; NM=1; PH=DS; RN=21; SR=0; TI=SMTPD_---0V5pNUKO_1646094718; Received: from 192.168.193.153(mailfrom:ashimida@linux.alibaba.com fp:SMTPD_---0V5pNUKO_1646094718) by smtp.aliyun-inc.com(127.0.0.1); Tue, 01 Mar 2022 08:31:59 +0800 Message-ID: Date: Mon, 28 Feb 2022 16:31:58 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH] [PATCH v2] AARCH64: Add gcc Shadow Call Stack support Content-Language: en-US To: Nick Desaulniers Cc: Miguel Ojeda , Catalin Marinas , Will Deacon , Nathan Chancellor , Kees Cook , Masahiro Yamada , Thomas Gleixner , Andrew Morton , Mark Rutland , Sami Tolvanen , Nicholas Piggin , Guenter Roeck , Masami Hiramatsu , Miguel Ojeda , Luc Van Oostenryck , Marco Elver , linux-kernel , Linux ARM , llvm@lists.linux.dev, linux-hardening@vger.kernel.org References: <20220225032410.25622-1-ashimida@linux.alibaba.com> <26a0a816-bc3e-2ac0-d773-0819d9f225af@linux.alibaba.com> From: Dan Li In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_163206_251051_459B049A X-CRM114-Status: GOOD ( 13.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2/28/22 14:35, Nick Desaulniers wrote: > On Sun, Feb 27, 2022 at 11:37 PM Dan Li wrote: >>>> +#ifdef CONFIG_SHADOW_CALL_STACK >>>> +#define __noscs __attribute__((__no_sanitize__("shadow-call-stack"))) >>>> +#endif >>> >>> Since both compilers have it, and I guess the `#ifdef` condition would >>> work for both, could this be moved into `compiler_types.h` where the >>> empty `__noscs` definition is, and remove the one from >>> `compiler-clang.h`? >>> >> In the clang documentation I see __has_feature(shadow_call_stack) is >> used to check if -fsanitize=shadow-call-stack is enabled, so I think >> maybe it's fine to use "#ifdef CONFIG_SHADOW_CALL_STACK" >> instead of "#if __has_attribute(__no_sanitize_address__)" here, then >> move it to `compiler_types.h`. > > Or simply add a #define for __noscs to include/linux/compiler-gcc.h > with appropriate guard and leave the existing #ifndef in > include/linux/compiler_types.h as is. I'd prefer that when the > compilers differ in terms of feature detection since it's as explicit > as possible. > To make sure I understand correctly, that means I should keep the current patch unchanged right? Thanks, Dan. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel