Message ID | 20240208012620.32604-6-zev@bewilderbeest.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-57363-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp2617839dyb; Wed, 7 Feb 2024 17:27:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXCnsWYsot7WAOFfNx4kaouYMLtZRITFEEFfu2hURDfYeCie0dIgMqHs9ol3jYfzoCq0KIT3DEaHmUWrHrGmH17hdRj6g== X-Google-Smtp-Source: AGHT+IEV5OjUvkAqzQ8HrNrNMvm/Vii/mH5+GhjaxezU6X86D1WDukOowySOxxSOhmjuqOIqn8tX X-Received: by 2002:a17:90b:f85:b0:295:c87f:6f51 with SMTP id ft5-20020a17090b0f8500b00295c87f6f51mr4758504pjb.26.1707355643046; Wed, 07 Feb 2024 17:27:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707355643; cv=pass; d=google.com; s=arc-20160816; b=Dqj/u+DMFt7+QJzJLrsro0IkWE7MjMdmGdE46aGJW7q8Y6dnEHZN0F0wWoe2cnCKG+ /Zeh13h8H+fiycZZ9fsd78hoANx88VTwl0+D55Id23mhEjJ97G2oJcEqxHawLA+t0b0Q og5/4gZVXypLzjnt07CgZFaea2g135sJcwbjlHPj566grdjMV7wvpFQSsvXx7yD37UIG 64T3q5wHz404jUtrc8E/ybhoESByVwqWFfBfAE6LLzx3ovab16TuTCGjORb2IH+qQn2w fPz8TxHZQJRGJJ9bfV2tpSurCMblwQUwHBKH3iAnMYgcrnCSIo9HzcvkGAVj7aBcYm/7 vBMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=jCfZxrSPfJRHCvrnkx78xqXBFO8QXL5lwiLPbS+xTAw=; fh=xK5TYF3JVvYvQfxRe3gHHc1IJd1wHMZwOdU1loT8fsg=; b=P8LS84mm9xHFz7vHChsp0nieE0ep5fggD2iBdizTHAb7XDGq3aXZ97bX4+/I3/BtT1 7nW/EJnLSFYpCd2H2FSQRFgAzx4BVYld1gG3mRhlQ89KYrlyta1FWmZU/gHeh72ljv4n vZK+PgXJQmIEMYMcgeK1ClkjsSEB6ykf7yAhr2jWAAB5ZpHpOxNGAUJ7cK5y6zZ5e4tk UCJD8eRd8OOc0Lq/SZHR1lD5KASoUbSyyzZCo8o42neu/HbzGfVB9msWy5D2435ieVU+ SCUMktU5ksvjC9AQlsJzm2pTv6Y0iYDhzGhlyOdt9g1UoNPY12pmujAqkD9DBIXZU2GS iqqw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bewilderbeest.net header.s=thorn header.b="WE/8Lz4f"; arc=pass (i=1 spf=pass spfdomain=bewilderbeest.net dkim=pass dkdomain=bewilderbeest.net dmarc=pass fromdomain=bewilderbeest.net); spf=pass (google.com: domain of linux-kernel+bounces-57363-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57363-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=bewilderbeest.net X-Forwarded-Encrypted: i=2; AJvYcCVcasqHak8v5bej8dMXlKaE26YaZ1rbROY8Av4z6RV51ka3wekP6AUR7+0OZnBFTkEex7jJq/LNSTGFnxADqj+Uo6zOKw== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id ju14-20020a170903428e00b001d9c1d8e042si2714136plb.413.2024.02.07.17.27.22 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 17:27:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57363-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bewilderbeest.net header.s=thorn header.b="WE/8Lz4f"; arc=pass (i=1 spf=pass spfdomain=bewilderbeest.net dkim=pass dkdomain=bewilderbeest.net dmarc=pass fromdomain=bewilderbeest.net); spf=pass (google.com: domain of linux-kernel+bounces-57363-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57363-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=bewilderbeest.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 17B3BB220E2 for <ouuuleilei@gmail.com>; Thu, 8 Feb 2024 01:27:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D0A8208C6; Thu, 8 Feb 2024 01:26:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=bewilderbeest.net header.i=@bewilderbeest.net header.b="WE/8Lz4f" Received: from thorn.bewilderbeest.net (thorn.bewilderbeest.net [71.19.156.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 982781DFC9; Thu, 8 Feb 2024 01:26:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=71.19.156.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707355597; cv=none; b=td1B8pyCURM0Bs9/QwDOuvLIEmpImmlLO57zsx4T6QYfIN9psv0sdW5vVs1PjeVSpXUiEAndZir8gqgTrH2IQMYVzut1b9AMEd7bEEuYG5IdVvGPWiaDA1wbA1oI2im+ljmBVu4dI7QagZJJ+vBzQkmiGeCTUkADeuK3wyP+Tmk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707355597; c=relaxed/simple; bh=OLe7cAlE7GWmn6Aw0nOYxdFDKvQ+HmBGQMrUtAdT8nM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pbYAdsZJd353StdQ1d4jrmMrmbILiRlVyOfRBYvrgl2tk/aHp3PBMEjQnwOCvfOp2eJvzw8m0VsLtmM/Oy4IHgnTpynlq7Xc/glLkCCyM6fJOm9IUUWat9XZYqSenohIru6SY/hjUfcK7xYw7GEDEYLMPRdv1KRHZxWI4+w5eq4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bewilderbeest.net; spf=pass smtp.mailfrom=bewilderbeest.net; dkim=pass (1024-bit key) header.d=bewilderbeest.net header.i=@bewilderbeest.net header.b=WE/8Lz4f; arc=none smtp.client-ip=71.19.156.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bewilderbeest.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bewilderbeest.net Received: from hatter.bewilderbeest.net (unknown [IPv6:2602:61:712b:6300::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id 90C25DD9; Wed, 7 Feb 2024 17:26:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1707355589; bh=jCfZxrSPfJRHCvrnkx78xqXBFO8QXL5lwiLPbS+xTAw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WE/8Lz4fbNW5hsXgLypZFn60E7qq3727+grkoIAgUAZO+kPRV+GimPEAfRtWnfs8N BHEObsnhOydmXdgmSyMAojdnhwMYrIFvSnPrwMl8MGW8gyVf330s4rIozE0T5/dEE9 47SLwGlLubpXFlRqB6hCTSQk3VHSnmIl2CW0Z4oQ= From: Zev Weiss <zev@bewilderbeest.net> To: Russell King <linux@armlinux.org.uk>, linux-arm-kernel@lists.infradead.org Cc: Zev Weiss <zev@bewilderbeest.net>, openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 2/2] ARM: prctl: Reject PR_SET_MDWE on pre-ARMv6 Date: Wed, 7 Feb 2024 17:26:20 -0800 Message-ID: <20240208012620.32604-6-zev@bewilderbeest.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240208012620.32604-4-zev@bewilderbeest.net> References: <20240208012620.32604-4-zev@bewilderbeest.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790292150614262225 X-GMAIL-MSGID: 1790292150614262225 |
Series |
ARM: prctl: Reject PR_SET_MDWE where not supported
|
|
Commit Message
Zev Weiss
Feb. 8, 2024, 1:26 a.m. UTC
On v5 and lower CPUs we can't provide MDWE protection, so ensure we
fail any attempt to enable it via prctl(PR_SET_MDWE).
Previously such an attempt would misleadingly succeed, leading to any
subsequent mmap(PROT_READ|PROT_WRITE) or execve() failing
unconditionally (the latter somewhat violently via
force_fatal_sig(SIGSEGV) due to READ_IMPLIES_EXEC).
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Cc: <stable@vger.kernel.org> # v6.3+
---
arch/arm/include/asm/mman.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
create mode 100644 arch/arm/include/asm/mman.h
diff --git a/arch/arm/include/asm/mman.h b/arch/arm/include/asm/mman.h new file mode 100644 index 000000000000..2189e507c8e0 --- /dev/null +++ b/arch/arm/include/asm/mman.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_MMAN_H__ +#define __ASM_MMAN_H__ + +#include <asm/system_info.h> +#include <uapi/asm/mman.h> + +static inline bool arch_memory_deny_write_exec_supported(void) +{ + return cpu_architecture() >= CPU_ARCH_ARMv6; +} +#define arch_memory_deny_write_exec_supported arch_memory_deny_write_exec_supported + +#endif /* __ASM_MMAN_H__ */