[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240227013546.15769-6-zev@bewilderbeest.net>
Date: Mon, 26 Feb 2024 17:35:42 -0800
From: Zev Weiss <zev@...ilderbeest.net>
To: Russell King <linux@...linux.org.uk>,
linux-parisc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Helge Deller <deller@....de>,
Florent Revest <revest@...omium.org>
Cc: Zev Weiss <zev@...ilderbeest.net>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
"Borislav Petkov (AMD)" <bp@...en8.de>,
Yin Fengwei <fengwei.yin@...el.com>,
"Mike Rapoport (IBM)" <rppt@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Kees Cook <keescook@...omium.org>,
Yang Shi <yang@...amperecomputing.com>,
Rick Edgecombe <rick.p.edgecombe@...el.com>,
Oleg Nesterov <oleg@...hat.com>,
David Hildenbrand <david@...hat.com>,
Stefan Roesch <shr@...kernel.io>,
Josh Triplett <josh@...htriplett.org>,
Ondrej Mosnacek <omosnace@...hat.com>,
Miguel Ojeda <ojeda@...nel.org>,
linux-kernel@...r.kernel.org,
openbmc@...ts.ozlabs.org,
Sam James <sam@...too.org>,
stable@...r.kernel.org
Subject: [PATCH RESEND 2/2] ARM: prctl: Reject PR_SET_MDWE on pre-ARMv6
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@...ilderbeest.net>
Cc: <stable@...r.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__ */
--
2.43.2
Powered by blists - more mailing lists