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 X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CD94CA9EB5 for ; Mon, 21 Oct 2019 09:29:04 +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 D070720873 for ; Mon, 21 Oct 2019 09:29:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Xme/GgSw"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="zWZzDrii" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D070720873 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To: Message-Id:Subject: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=eHk5c8j+3Fige3U+HFuTrlRJkaksewLfinWQXCV4QvM=; b=Xme/GgSwy1m7Nf RqTHbqZ/jHzg+CMaTKMiGTiPYKFSdx/vHDmy04Yp2aRnWomWV/kjAT/TaHpXRtJ2s9ON0rbojOWm/ rCkEcgA0msxyoxwRlAe1sUb58+1rqaYCHh3SQu+HdW+xaygDBAqR9Iy5sQY7W2rCosS6is2ZGkibA lj1RFLXstLw6DSeiQtQlNExF1FdskbS1glJqWsZUZiRZQ916LCgB6NEPcui4HUxoV4+RhLdGvImN/ z88xr4sTEfFbeNThCRThShFB5SYtvnzfeREnZlhG/OOM/Pnz4HDrFYSZD6kqtUOocq9DBMPMp37UZ RUqrO5xOxQQ5E2wlHpDw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iMTzl-0002Se-VC; Mon, 21 Oct 2019 09:28:57 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iMTzj-0002SA-2r for linux-arm-kernel@lists.infradead.org; Mon, 21 Oct 2019 09:28:56 +0000 Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6C8F620684; Mon, 21 Oct 2019 09:28:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571650134; bh=Ij6S89oTE2ChGvN/UW+DXJfdLK0DsQIGRLCpuPOoRWA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=zWZzDriip6tNCgfYO0M88aJAV5J/LSHelLDvXsN0JxFO1eO3wP1xf9jH9VOPlWeRr l8gfqL/30jne+EhJJPVaCBHdwfmo0Jc+al53Fz46Fn92tge0OM9hWMU0I3I9+Es3ta pEfX+JuiTXYfFUauJoNlctRr1EGfMdnBG4PgNxEc= Date: Mon, 21 Oct 2019 18:28:49 +0900 From: Masami Hiramatsu To: Sami Tolvanen Subject: Re: [PATCH 00/18] add support for Clang's Shadow Call Stack Message-Id: <20191021182849.d51a67b0c0fe74d8d524147f@kernel.org> In-Reply-To: <20191018161033.261971-1-samitolvanen@google.com> References: <20191018161033.261971-1-samitolvanen@google.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191021_022855_145122_7355237F X-CRM114-Status: GOOD ( 16.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Kees Cook , Ard Biesheuvel , Catalin Marinas , kernel-hardening@lists.openwall.com, Nick Desaulniers , linux-kernel@vger.kernel.org, Steven Rostedt , clang-built-linux@googlegroups.com, Laura Abbott , Will Deacon , Dave Martin , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On Fri, 18 Oct 2019 09:10:15 -0700 Sami Tolvanen wrote: > This patch series adds support for Clang's Shadow Call Stack (SCS) > mitigation, which uses a separately allocated shadow stack to protect > against return address overwrites. More information can be found here: > > https://clang.llvm.org/docs/ShadowCallStack.html Looks interesting, and like what function-graph tracing does... > > SCS is currently supported only on arm64, where the compiler requires > the x18 register to be reserved for holding the current task's shadow > stack pointer. Because of this, the series includes four patches from > Ard to remove x18 usage from assembly code and to reserve the register > from general allocation. > > With -fsanitize=shadow-call-stack, the compiler injects instructions > to all non-leaf C functions to store the return address to the shadow > stack and unconditionally load it again before returning. As a result, > SCS is incompatible with features that rely on modifying function > return addresses to alter control flow, such as function graph tracing > and kretprobes. A copy of the return address is still kept in the > kernel stack for compatibility with stack unwinding, for example. Is it possible that kretprobes and function graph tracing modify the SCS directly instead of changing real stack in that case? Thank you, -- Masami Hiramatsu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel