]> Git Repo - linux.git/commitdiff
prctl: Disable prctl(PR_SET_MDWE) on parisc
authorHelge Deller <[email protected]>
Sat, 18 Nov 2023 18:33:35 +0000 (19:33 +0100)
committerHelge Deller <[email protected]>
Sat, 18 Nov 2023 18:35:31 +0000 (19:35 +0100)
systemd-254 tries to use prctl(PR_SET_MDWE) for it's MemoryDenyWriteExecute
functionality, but fails on parisc which still needs executable stacks in
certain combinations of gcc/glibc/kernel.

Disable prctl(PR_SET_MDWE) by returning -EINVAL for now on parisc, until
userspace has catched up.

Signed-off-by: Helge Deller <[email protected]>
Co-developed-by: Linus Torvalds <[email protected]>
Reported-by: Sam James <[email protected]>
Closes: https://github.com/systemd/systemd/issues/29775
Tested-by: Sam James <[email protected]>
Link: https://lore.kernel.org/all/[email protected]/
Cc: <[email protected]> # v6.3+
kernel/sys.c

index 420d9cb9cc8e203f50014bb2ec564f6598d9869c..e219fcfa112d863eeef58381d04fd4bab16a1e32 100644 (file)
@@ -2394,6 +2394,10 @@ static inline int prctl_set_mdwe(unsigned long bits, unsigned long arg3,
        if (bits & PR_MDWE_NO_INHERIT && !(bits & PR_MDWE_REFUSE_EXEC_GAIN))
                return -EINVAL;
 
+       /* PARISC cannot allow mdwe as it needs writable stacks */
+       if (IS_ENABLED(CONFIG_PARISC))
+               return -EINVAL;
+
        current_bits = get_current_mdwe();
        if (current_bits && current_bits != bits)
                return -EPERM; /* Cannot unset the flags */
This page took 0.045996 seconds and 4 git commands to generate.