commit:     43bb3290045425ac89ef055e23ca1ba63f267465
Author:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 19 15:18:02 2023 +0000
Commit:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
CommitDate: Sun Nov 19 15:18:02 2023 +0000
URL:        https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=43bb3290

prctl: Temporarily disable prctl(PR_SET_MDWE) on parisc

Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>

 0000_README                     |  4 ++++
 1730_parisc-Disable-prctl.patch | 51 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+)

diff --git a/0000_README b/0000_README
index b98c4b39..2e6346ff 100644
--- a/0000_README
+++ b/0000_README
@@ -59,6 +59,10 @@ Patch:  
1720_parisc-gen-mmap-top-down-layout-and-brk-randomization.patch
 From:          
https://lore.kernel.org/linux-parisc/ZVH2qeS1bG7%2F1J%2Fl@p100/T/#u
 Desc:          Fix the mmap_base() calculation to include the 
stack-grows-upwards case
 
+Patch:  1730_parisc-Disable-prctl.patch
+From:    
https://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git
+Desc:    prctl: Temporarily disable prctl(PR_SET_MDWE) on parisc
+
 Patch:  1805_mm-disable-CONFIG-PER-VMA-LOCK-by-def.patch
 From:   https://lore.kernel.org/all/[email protected]/
 Desc:   mm: disable CONFIG_PER_VMA_LOCK by default until its fixed

diff --git a/1730_parisc-Disable-prctl.patch b/1730_parisc-Disable-prctl.patch
new file mode 100644
index 00000000..f892d6a1
--- /dev/null
+++ b/1730_parisc-Disable-prctl.patch
@@ -0,0 +1,51 @@
+From 339b41ec357c24c02ed4aed6267dbfd443ee1e8e Mon Sep 17 00:00:00 2001
+From: Helge Deller <[email protected]>
+Date: Mon, 13 Nov 2023 16:06:18 +0100
+Subject: prctl: Temporarily disable prctl(PR_SET_MDWE) on parisc
+
+systemd-254 tries to use prctl(PR_SET_MDWE) for systemd's
+MemoryDenyWriteExecute functionality, but fails on PA-RISC/HPPA which
+still needs executable stacks.
+
+Temporarily disable prctl(PR_SET_MDWE) by returning -ENODEV on parisc
+for now. Note that we can't return -EINVAL since systemd will then try
+to use seccomp instead.
+
+Reported-by: Sam James <[email protected]>
+Signed-off-by: Helge Deller <[email protected]>
+Link: https://lore.kernel.org/all/[email protected]/
+Link: https://github.com/systemd/systemd/issues/29775.
+Cc: <[email protected]> # v6.3+
+---
+ kernel/sys.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/kernel/sys.c b/kernel/sys.c
+index 420d9cb9cc8e2..8e3eaf650d07d 100644
+--- a/kernel/sys.c
++++ b/kernel/sys.c
+@@ -2700,10 +2700,16 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, 
arg2, unsigned long, arg3,
+               break;
+ #endif
+       case PR_SET_MDWE:
+-              error = prctl_set_mdwe(arg2, arg3, arg4, arg5);
++              if (IS_ENABLED(CONFIG_PARISC))
++                      error = -EINVAL;
++              else
++                      error = prctl_set_mdwe(arg2, arg3, arg4, arg5);
+               break;
+       case PR_GET_MDWE:
+-              error = prctl_get_mdwe(arg2, arg3, arg4, arg5);
++              if (IS_ENABLED(CONFIG_PARISC))
++                      error = -EINVAL;
++              else
++                      error = prctl_get_mdwe(arg2, arg3, arg4, arg5);
+               break;
+       case PR_SET_VMA:
+               error = prctl_set_vma(arg2, arg3, arg4, arg5);
+-- 
+cgit
+Filename: fallback-exec-stack.patch. Size: 2kb. View raw, copy, hex, or 
download this file.
+View source code, the removal or expiry stories, or read the about page.
+
+This website does not claim ownership of, copyright on, and assumes no 
liability for provided content. Toggle color scheme.

Reply via email to