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=-15.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 CFF67C433FE for ; Tue, 8 Dec 2020 16:38:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 75580233FA for ; Tue, 8 Dec 2020 16:38:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75580233FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.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=GIzwUDpbVmYkHjpnRobIVkjsc7+D0AJs56sN293s4XU=; b=VjpAOSaYAlKyTYOCiHFXZv07H ByJ0+80xz7YXHT7yZylIWbzFXkm1Mo0FTKR8n8pknA7J+n7aU7cyVoaabQ74oXEhEp5/MqhZ17NRx IgcE46YXsGWEwPJ80IvMCWshH0u/+xi55QomEkKJA3t0x9ipNkI/cnegJ2jel4aAZqEXKCMGI/E2e Ew1l2H9v21b9NmEQyFhAlLePaJzx5ohfDyfJwbmqBETStbxyV+3Brz3cfoix9B2MxKesqWx/z4XH3 DFhM1X5utAhu4vkPp/+Ew+19nhJVFXkxa7Q595xOCXX20gQH/Xjx80UBBB4eN4a5GTNr3tupi6wIf 5cQoYHx5Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmfzC-000239-4H; Tue, 08 Dec 2020 16:37:10 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmfyT-0001hF-2N for linux-arm-kernel@lists.infradead.org; Tue, 08 Dec 2020 16:36:37 +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 D70491FB; Tue, 8 Dec 2020 08:36:20 -0800 (PST) Received: from arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 321EC3F66B; Tue, 8 Dec 2020 08:36:20 -0800 (PST) Date: Tue, 8 Dec 2020 16:36:16 +0000 From: Dave Martin To: Vladimir Murzin Subject: Re: [PATCH 2/2] arm64: Introduce HWCAPS2_EXECONLY Message-ID: <20201208163614.GS6882@arm.com> References: <20201119133953.15585-1-vladimir.murzin@arm.com> <20201119133953.15585-3-vladimir.murzin@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201119133953.15585-3-vladimir.murzin@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201208_113625_276786_86C78D67 X-CRM114-Status: GOOD ( 20.83 ) 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: catalin.marinas@arm.com, keescook@chromium.org, 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+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 19, 2020 at 01:39:53PM +0000, Vladimir Murzin wrote: > With EPAN supported it might be handy to user know that PROT_EXEC > gives execute-only permission, so advertise it via HWCAPS2_EXECONLY > > Cc: Kees Cook > Cc: Catalin Marinas > Signed-off-by: Vladimir Murzin > --- > arch/arm64/include/asm/hwcap.h | 1 + > arch/arm64/include/asm/sysreg.h | 1 + > arch/arm64/include/uapi/asm/hwcap.h | 1 + > arch/arm64/kernel/cpufeature.c | 3 +++ > arch/arm64/kernel/cpuinfo.c | 1 + > 5 files changed, 7 insertions(+) > > diff --git a/arch/arm64/include/asm/hwcap.h b/arch/arm64/include/asm/hwcap.h > index 9a5498c..5ee5bce 100644 > --- a/arch/arm64/include/asm/hwcap.h > +++ b/arch/arm64/include/asm/hwcap.h > @@ -105,6 +105,7 @@ > #define KERNEL_HWCAP_RNG __khwcap2_feature(RNG) > #define KERNEL_HWCAP_BTI __khwcap2_feature(BTI) > #define KERNEL_HWCAP_MTE __khwcap2_feature(MTE) > +#define KERNEL_HWCAP_EXECONLY __khwcap2_feature(EXECONLY) Should this definitely be an hwcap? [Apologies if I already made this comment, but if I did I can't find a record of it, so here it is again (or not)]: This seems to have the wrong semantics for hwcaps: it's not a (purely) a property of the hardware, not an arch-specific concept, and old code that doesn't know about this flag may not work properly when the flag is set. Software that requires that any memory mapped without PROT_READ is readable would be nonportable according to POSIX, but nonportable doesn't mean not correct; it just means that POSIX doesn't gurarantee that it works everywhere. So: 1) Is true execute-only memory an ABI break that we care about, and do we need an explicit opt-in? 2) Otherwise, is there another more suitable and less arch-specific mechanism that could be used? (Maybe AT_FLAGS or similar?) This issue may have come up on other arches. I've not gone digging. Cheers ---Dave [...] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel