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=-2.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham 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 C627AC04AB6 for ; Fri, 31 May 2019 09:22:19 +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 9A881266AB for ; Fri, 31 May 2019 09:22:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rgmE5K80" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A881266AB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com 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:In-Reply-To:MIME-Version:References: 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=EG5gtJ2A6LgN3l3j4WmC+cxE+Vt5IsX7eQzBUlBEuNE=; b=rgmE5K80X1YlFS cTk2v0IArhCegNi08vg5+Cd6q/u5FLj9F+LbDN9YaLoj6Vd5+QLR8A2GVKE+PMBU01f1RFFRrezz4 Itcc+igcukWa8Vd/cn6/TxbWL88kI5soqMp7r7uH6+x4RSj7v0lt8kUvU47JqHFtTful63ATq/5Nm B2hERBCD7o2SRm07mO289d5IFsSwzGRg3pK51UArlpNqQT7tjT5wl+SOZJs2KnkBpCwP28wkRgF8m GW12Ydr4kjtknRsSIP3gZfWhaHPyaNwIlihSNdXMp7pl/1mVe+u581l+3A7tZijeN6kdMBbjar9fT 3bgzCcpj3yohlASCkNYw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hWdjo-0004gL-LN; Fri, 31 May 2019 09:22:12 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hWdjl-0004fr-N3 for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2019 09:22:11 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 691B0341; Fri, 31 May 2019 02:22:09 -0700 (PDT) Received: from fuggles.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DD0E03F59C; Fri, 31 May 2019 02:22:06 -0700 (PDT) Date: Fri, 31 May 2019 10:22:02 +0100 From: Will Deacon To: Kees Cook Subject: Re: [RFC v2 0/7] arm64: return address signing Message-ID: <20190531092202.GA19208@fuggles.cambridge.arm.com> References: <20190529190332.29753-1-kristina.martsenko@arm.com> <201905292004.3809FBAA66@keescook> <201905300851.4A68705B0@keescook> <201905301058.CA55245A0@keescook> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201905301058.CA55245A0@keescook> User-Agent: Mutt/1.11.1+86 (6f28e57d73f2) () X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190531_022209_759371_547D68BF X-CRM114-Status: GOOD ( 20.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Luke Cheeseman , Diogo Sampaio , Luke Cheeseman , Catalin Marinas , Ard Biesheuvel , Kristina Martsenko , Ramana Radhakrishnan , Amit Kachhap , Kristof Beyls , Christof Douma , Suzuki Poulose , Dave P 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 On Thu, May 30, 2019 at 11:05:15AM -0700, Kees Cook wrote: > On Thu, May 30, 2019 at 04:55:08PM +0000, Luke Cheeseman wrote: > > The semantics of this attribute are straightforward enough but it > > raises some questions. One question being why would I want to turn off > > BTI (also controlled by this option) for one function in a file? Which > > gets a bit odd. > > It's about leaving very early CPU startup functions in the kernel from > getting marked up (since they are running before or during the PAC setup). > > > I don't know if the alternatives have been suggested but it's > > possible to achieve the result you seem to be after (a function without > > return address signing) in a couple of ways. First and foremost, > > separating the function out into it's own file and compiling with > > -mbranch-protection=none. Alternatively, writing the function in assembly > > or perhaps even a naked function with inline assembly. > > Fair enough. :) Thanks for the clarification. Yeah, split on compilation > unit could work. (In the future, though, having the attribute flexibility > would be nice.) > > Kristina, would it be feasible to split these functions into a separate > source file? (There doesn't seem to be a need to inline them, given > they're not performance sensitive and only used once, etc?) Right, and we could call it kernel.c Sarcasm aside, please fix this in the toolchain. Moving logically unrelated functions into one file just because the toolchain doesn't yet support this feature just messes up the codebase and removes the incentive to get this implemented properly. After all, you need something to do now that asm goto is out of the way, right? ;) Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel