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 A6849C433F5 for ; Mon, 11 Oct 2021 19:09:42 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6315B60F23 for ; Mon, 11 Oct 2021 19:09:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6315B60F23 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=oFuEbu26g28f7kojsjh7quSsamcF+ifDtXEhnbIyAMQ=; b=uaRJNY8uDPxg0MN5JRbDbkd74A Ip5CjG/WIIZcQ3gpou41z8IGUx8W9tja2FNfsc497QX1k+kgA/RwTGS8SvFFDSRcfQACZ3aRNGuxp J6dUwkYGnK6hh0bZ5PjmALjNZV6naM6Bpa440zH1ghbYV/8ggLUuH0ibuzsDrhmyzvnxLe9pSKfYY HYQmxiejUR5reqjaQC1NfMOTEBX4g6/unp5sXsA39WhZPu/J8a/6B8SSASbIyGHlkapilZiMG7p0h AhacA5shI2X6ptMO2kSPQnbEv2NNaIT8vXIpVsLBWVU6dx8AcmQSjBXAQqLUBNWjxUsNRlBJ0Vn34 VzO7cyag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ma0eG-00AS3W-Sh; Mon, 11 Oct 2021 19:07:45 +0000 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ma0eD-00AS2B-16 for linux-arm-kernel@lists.infradead.org; Mon, 11 Oct 2021 19:07:42 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R171e4; 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=29; SR=0; TI=SMTPD_---0UrVMcls_1633979251; Received: from ashimida.local(mailfrom:ashimida@linux.alibaba.com fp:SMTPD_---0UrVMcls_1633979251) by smtp.aliyun-inc.com(127.0.0.1); Tue, 12 Oct 2021 03:07:35 +0800 Subject: Re: [PATCH] [PATCH V2]ARM64: SCS: Add gcc plugin to support Shadow Call Stack To: Nick Desaulniers Cc: Miguel Ojeda , Masahiro Yamada , Michal Marek , Catalin Marinas , Will Deacon , Kees Cook , Nathan Chancellor , Thomas Gleixner , Andrew Morton , Sami Tolvanen , frederic@kernel.org, Mike Rapoport , Mark Rutland , yifeifz2@illinois.edu, Steven Rostedt , Viresh Kumar , andreyknvl@gmail.com, Colin King , Miguel Ojeda , Luc Van Oostenryck , Marco Elver , Arvind Sankar , Ard Biesheuvel , Linux Kbuild mailing list , linux-kernel , Linux ARM , linux-hardening@vger.kernel.org, clang-built-linux References: <1633878992-32884-1-git-send-email-ashimida@linux.alibaba.com> From: Dan Li Message-ID: Date: Tue, 12 Oct 2021 03:07:31 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211011_120741_270546_088BEBAF X-CRM114-Status: GOOD ( 23.68 ) 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 10/12/21 1:23 AM, Nick Desaulniers wrote: > On Mon, Oct 11, 2021 at 8:42 AM Dan Li wrote: >> >> >> >> On 10/10/21 11:43 PM, Miguel Ojeda wrote: >>> On Sun, Oct 10, 2021 at 5:16 PM Dan Li wrote: >>>> >>>> - This option enables Clang's Shadow Call Stack, which uses a >>>> - shadow stack to protect function return addresses from being >>>> - overwritten by an attacker. More information can be found in >>>> - Clang's documentation: >>>> + This option enables Clang/GCC plugin's Shadow Call Stack, which >>>> + uses a shadow stack to protect function return addresses from >>>> + being overwritten by an attacker. More information can be found >>>> + in Clang's documentation: >>> >>> Perhaps it could be worded in a better way? It sounds like it is a >>> custom plugin for Clang as well, e.g.: >>> >>> This option enables Shadow Call Stack (in the case of GCC, as a plugin), >>> >>> Cheers, >>> Miguel >>> >> >> Thanks Miguel. >> >> How about writing like this: >> This option enables Shadow Call Stack (supported as a compiler option in >> the case of clang, supported as a plugin in the case of gcc), which uses >> a shadow stack to ... > > That sounds reasonable. > > One question I have Dan, what is your sense for getting this feature > landed upstream in GCC proper? It's neat to be able to use plugins to > support older versions of a compiler than when the feature initially > lands; I was curious if you're working to submit this into GCC as > well? I didn't see anything in GCC's bug tracker for "shadow call > stack," but maybe there's a different feature bug tracking this? > Thanks Nick. The original intention of this plugin is to provide the customer's (bsp) kernel with the ability to enable SCS protection under gcc. It's not always feasible to recompile gcc or convince customers to switch to a higher version, so I implemented this feature through a plugin. For bsp, this method could reduce its use cost. Because my main area of concern is kernel security, I first submitted this plugin to the community. I think [PATCH V2] can also be submitted to the gcc mainline. This is my next plan, and I still need some time to reorganize it into the gcc source code. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel