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 F1010C433F5 for ; Mon, 28 Feb 2022 07:39:03 +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=kapXRwaB80FaL+u1l9Mmabe/nNzHedAu/ez+ncLaFmg=; b=fWvduCCZgUXKaf BZ2LoVketiup+iMptOwKWaHRlvbYzYHl5Unu2p1LNf+z5/P7Y6dmcUIAlz5XTeKYl0B/QzhTGiGmZ kkKIzTsSrio+tmMNgv+d/kS9BNNMwfOGMvgorSVNFuUb+FLy3Hy8qRszzocLj9W9SCurt4s8O6dzE Ol1Qy/gp6YHD9EA4143jWksyXGNDJGzZLlfMXv+lnKo45kISqj9R12xfghhSDo/trWhn+NZp7QMkC BG47NTIGTzql44kdbgmbEZuiIT9ojakMjQcRGBwXl0j0VV/2c2CTTtBqArkU4kZKt4dk8DAjIVq0K Kzqsk6bXYFpZ/q95EOvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOabU-00Az6M-JW; Mon, 28 Feb 2022 07:37:56 +0000 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOabQ-00Az3Y-Ms for linux-arm-kernel@lists.infradead.org; Mon, 28 Feb 2022 07:37:54 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R181e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04400; MF=ashimida@linux.alibaba.com; NM=1; PH=DS; RN=21; SR=0; TI=SMTPD_---0V5h6dX7_1646033858; Received: from 192.168.193.153(mailfrom:ashimida@linux.alibaba.com fp:SMTPD_---0V5h6dX7_1646033858) by smtp.aliyun-inc.com(127.0.0.1); Mon, 28 Feb 2022 15:37:40 +0800 Message-ID: <26a0a816-bc3e-2ac0-d773-0819d9f225af@linux.alibaba.com> Date: Sun, 27 Feb 2022 23:37:38 -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: Miguel Ojeda Cc: Catalin Marinas , Will Deacon , Nathan Chancellor , Nick Desaulniers , 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> From: Dan Li In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220227_233752_952285_8D59E112 X-CRM114-Status: GOOD ( 13.78 ) 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/25/22 12:47, Miguel Ojeda wrote: > On Fri, Feb 25, 2022 at 4:24 AM Dan Li wrote: >> >> + - Clang (https://clang.llvm.org/docs/ShadowCallStack.html) >> + - GCC (https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#Instrumentation-Options) > > Maybe Clang: and GCC: instead of the parenthesis? > Got it. >> +#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`. And from the results of my local clang 12 compilation, this doesn't seem to be a problem. Link: https://clang.llvm.org/docs/ShadowCallStack.html#has-feature-shadow-call-stack _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel