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 7D0ECC433EF for ; Fri, 25 Feb 2022 21:00:58 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NqR29r8cJGXJbY+gn/WvIqz1kwmOBEuaH8yGa+etxr0=; b=BB2f0YrK4W9rRz 5leQ9GgSke8FpvTkwR5czsCUk6gWqNjU5Jk2pqZw9/wEls8KVr2vx2zPeFk9+o3fdN0QkBVd4OhhN LOoCPemc4kEuQbf27yAbW1HJMPsKM+8IAQKf+aaZdM2EB7D559vCv6zu3v+XkRlGPZYu+Zaf4y+Rj YDDjCHDEBq4oEPBU0tmygybfExHJF5pgflta2iJOyMJ/IG30es76r0xGaEsBSOIUGOYnHhUs0NhKN VGUA3g+1CPXDARU3t+etGTPMK0bCFKzKVqsfGTHCKj47wsdwW/BM6xqZjN7mFx6Vav9yLuMANjfax 1AJOMF1uqupBGCirmopA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNhgt-006yOJ-N2; Fri, 25 Feb 2022 20:59:51 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nNhgp-006yNL-Dt for linux-arm-kernel@lists.infradead.org; Fri, 25 Feb 2022 20:59:48 +0000 Received: by mail-pl1-x62b.google.com with SMTP id s1so5766291plg.12 for ; Fri, 25 Feb 2022 12:59:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Fql4x3ovzVJy60LLROu61UmkOqqfZk4efC7nY269RYY=; b=iyJ8cdcMw6QQVVazrzlSy9h1aEZAY3Rkb/ll+q4jeCBq5asrG/dWw5lYoQplhVEs15 MysenF/BH44K7JCXXm92wlr+S1CojKxCv5xJrJ1n7llFJx0clDXnMue9km97Z7OoPy/9 /2hxBDfkkN706m/0pUrholl6F7mKJWK923HhM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Fql4x3ovzVJy60LLROu61UmkOqqfZk4efC7nY269RYY=; b=WKMVzeA43TaUjE/YEnsUdkbEWymhpR1X3DnOGbPCjjzU3km6a/Qj/glByXjW0kKume GjFs6uXZaeRUqUjV511obkNuHuXNqfLZh+ycILAyyz7SDc8/Hd+o7dxdg4y45Ss8fqEV BWda0aI9SYsuzyE440TcYX3icKKzfs/ue0YheOI/kQEpXDLtnt2eAnw0UtsODJCJFf0h 62nESL2NkBqHy04+yPG5GGeWjD2IJplci8dWAxTV6r/oYFg77/bEEWGe0J7w/jdDCKPV zstZv61/tEG5eEtUGs/c2LHKrXLgdk/JK41BKu8CGMN1m3d9db9FKyUym5R5F95VIQsq F+/A== X-Gm-Message-State: AOAM5313Ofhp7ZLaJPW629sNp1E/4/sMq/qWELy+pS2lULg73HPCix4b W1twUufqKzTrZaDJrejLOYz8Nw== X-Google-Smtp-Source: ABdhPJy6gzigvV5ZMzn93/w/UhgMAifdcjjoAEXZz8/X7hRTMcFiMGHkU7gBwUXxlrKbQuWbwgIGCg== X-Received: by 2002:a17:902:b488:b0:14e:e9f3:24a2 with SMTP id y8-20020a170902b48800b0014ee9f324a2mr9103669plr.72.1645822786686; Fri, 25 Feb 2022 12:59:46 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id lt8-20020a17090b354800b001bc509e0085sm9573094pjb.21.2022.02.25.12.59.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 12:59:46 -0800 (PST) Date: Fri, 25 Feb 2022 12:59:45 -0800 From: Kees Cook To: Miguel Ojeda Cc: Dan Li , Catalin Marinas , Will Deacon , Nathan Chancellor , Nick Desaulniers , 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 Subject: Re: [PATCH] [PATCH v2] AARCH64: Add gcc Shadow Call Stack support Message-ID: <202202251258.DB0F403B@keescook> References: <20220225032410.25622-1-ashimida@linux.alibaba.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220225_125947_497878_B0B40AE9 X-CRM114-Status: GOOD ( 14.96 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Feb 25, 2022 at 09:47:19PM +0100, 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? > > > +#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`? I thought about that too, but I think it's less simple due to the __has_feature vs CONFIG differences, etc: https://lore.kernel.org/lkml/202202251243.1E38256F9@keescook/ But maybe __has_feature doesn't really matter here? -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel