This is a note to let you know that I've just added the patch titled ARM: prctl: reject PR_SET_MDWE on pre-ARMv6 to the 6.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arm-prctl-reject-pr_set_mdwe-on-pre-armv6.patch and it can be found in the queue-6.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 166ce846dc5974a266f6c2a2896dbef5425a6f21 Mon Sep 17 00:00:00 2001 From: Zev Weiss <zev@xxxxxxxxxxxxxxxxx> Date: Mon, 26 Feb 2024 17:35:42 -0800 Subject: ARM: prctl: reject PR_SET_MDWE on pre-ARMv6 From: Zev Weiss <zev@xxxxxxxxxxxxxxxxx> commit 166ce846dc5974a266f6c2a2896dbef5425a6f21 upstream. 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). Link: https://lkml.kernel.org/r/20240227013546.15769-6-zev@xxxxxxxxxxxxxxxxx Signed-off-by: Zev Weiss <zev@xxxxxxxxxxxxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> [6.3+] Cc: Borislav Petkov <bp@xxxxxxxxx> Cc: David Hildenbrand <david@xxxxxxxxxx> Cc: Florent Revest <revest@xxxxxxxxxxxx> Cc: Helge Deller <deller@xxxxxx> Cc: "James E.J. Bottomley" <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx> Cc: Josh Triplett <josh@xxxxxxxxxxxxxxxx> Cc: Kees Cook <keescook@xxxxxxxxxxxx> Cc: Miguel Ojeda <ojeda@xxxxxxxxxx> Cc: Mike Rapoport (IBM) <rppt@xxxxxxxxxx> Cc: Oleg Nesterov <oleg@xxxxxxxxxx> Cc: Ondrej Mosnacek <omosnace@xxxxxxxxxx> Cc: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx> Cc: Russell King (Oracle) <linux@xxxxxxxxxxxxxxx> Cc: Sam James <sam@xxxxxxxxxx> Cc: Stefan Roesch <shr@xxxxxxxxxxxx> Cc: Yang Shi <yang@xxxxxxxxxxxxxxxxxxxxxx> Cc: Yin Fengwei <fengwei.yin@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/arm/include/asm/mman.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 arch/arm/include/asm/mman.h --- /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__ */ Patches currently in stable-queue which might be from zev@xxxxxxxxxxxxxxxxx are queue-6.8/prctl-generalize-pr_set_mdwe-support-check-to-be-per-arch.patch queue-6.8/arm-prctl-reject-pr_set_mdwe-on-pre-armv6.patch