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=-5.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 01314C33C9E for ; Tue, 14 Jan 2020 16:39:14 +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 BE7F92053B for ; Tue, 14 Jan 2020 16:39:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PkGv48kK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE7F92053B 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=ehDiSeFpK2hATHhgWNMEp5xBNEM+b8MeOv1a8A6bFC8=; b=PkGv48kKkHpcc9 qJO7PrkP9sK5g0WZbRqnhHr0HHLoxAsPM5EEb8DcRvTrqWcUUy+eyqW6fsflkUeUmrhaXeSQOdqsw aX2a/5BE4FxdadvNnj9MP/fbjukuP8zUz2vUge0tU65lJ4pX0lKuhXsgWMNS4xbGQckr0l+18nq+I oR4VP1AOLctKzq73iUkzxmt783phmKaWBj+3wTKPumGJC789aTOUewTgHJ9vZFsW4pgwXrpT6IphG Hz3cDkVepFuHBWouIpqS3b+a3jSblc6WSNiIouanuSOLyEXYCNNbR3WewI78l8I1yZqAFjZLw1Sd1 ktg2rpcPbBIlC/8sJLIQ==; 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 1irPDi-0003Gg-5f; Tue, 14 Jan 2020 16:39:10 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1irPDd-0003Ff-DC for linux-arm-kernel@lists.infradead.org; Tue, 14 Jan 2020 16:39:09 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BF7CC1396; Tue, 14 Jan 2020 08:39:04 -0800 (PST) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.197.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BBDE23F68E; Tue, 14 Jan 2020 08:39:01 -0800 (PST) Date: Tue, 14 Jan 2020 16:38:59 +0000 From: Catalin Marinas To: Mark Brown Subject: Re: [PATCH v4 05/12] elf: Allow arch to tweak initial mmap prot flags Message-ID: <20200114163859.GI30444@arrakis.emea.arm.com> References: <20191211154206.46260-1-broonie@kernel.org> <20191211154206.46260-6-broonie@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191211154206.46260-6-broonie@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200114_083905_487176_C981E76A X-CRM114-Status: GOOD ( 10.50 ) 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: Paul Elliott , Peter Zijlstra , Andrew Jones , Amit Kachhap , Vincenzo Frascino , Will Deacon , linux-arch@vger.kernel.org, Marc Zyngier , Eugene Syromiatnikov , Szabolcs Nagy , Dave Martin , "H.J. Lu" , Yu-cheng Yu , Kees Cook , Arnd Bergmann , Jann Horn , Richard Henderson , Kristina =?utf-8?Q?Mart=C5=A1enko?= , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Florian Weimer , linux-kernel@vger.kernel.org, Sudakshina Das 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 Wed, Dec 11, 2019 at 03:41:59PM +0000, Mark Brown wrote: > From: Dave Martin > > An arch may want to tweak the mmap prot flags for an > ELFexecutable's initial mappings. For example, arm64 is going to > need to add PROT_BTI for executable pages in an ELF process whose > executable is marked as using Branch Target Identification (an > ARMv8.5-A control flow integrity feature). > > So that this can be done in a generic way, add a hook > arch_elf_adjust_prot() to modify the prot flags as desired: arches > can select CONFIG_HAVE_ELF_PROT and implement their own backend > where necessary. > > By default, leave the prot flags unchanged. > > Signed-off-by: Dave Martin > Reviewed-by: Kees Cook > Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel