mbox series

[linux,dev-6.6,0/2] ARM: prctl: Reject PR_SET_MDWE where not supported

Message ID 20240326194959.10777-4-zev@bewilderbeest.net
Headers show
Series ARM: prctl: Reject PR_SET_MDWE where not supported | expand

Message

Zev Weiss March 26, 2024, 7:49 p.m. UTC
[Re-sending as I forgot to CC the list the first time, apologies for
the duplication.]

OpenBMC on AST2400 has been badly broken for some time now due to
systemd services segfaulting on execve() after calls to
prctl(PR_SET_MDWE) spuriously succeeded.  The MMU of the ARMv5 CPU in
the AST2400 cannot meaningfully support MDWE because it lacks distinct
read & execute page permissions (read implies execute), so these
patches ensure that the prctl to enable MDWE properly fails on
hardware where it isn't supported.

These patches have been posted and approved upstream [0], and while at
time of writing they haven't yet reached mainline or stable upstream,
they're on their way and should hopefully get merged soon [1, 2].

Thanks,
Zev

[0] https://lore.kernel.org/linux-arm-kernel/20240227013546.15769-4-zev@bewilderbeest.net/
[1] https://lore.kernel.org/mm-commits/20240326180820.88CF4C43390@smtp.kernel.org/
[2] https://lore.kernel.org/mm-commits/20240326180821.BF06BC433C7@smtp.kernel.org/

Zev Weiss (2):
  prctl: Generalize PR_SET_MDWE support check to be per-arch
  ARM: prctl: Reject PR_SET_MDWE on pre-ARMv6

 arch/arm/include/asm/mman.h    | 14 ++++++++++++++
 arch/parisc/include/asm/mman.h | 14 ++++++++++++++
 include/linux/mman.h           |  8 ++++++++
 kernel/sys.c                   |  7 +++++--
 4 files changed, 41 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/include/asm/mman.h
 create mode 100644 arch/parisc/include/asm/mman.h

Comments

Andrew Jeffery March 26, 2024, 11:20 p.m. UTC | #1
On Tue, 2024-03-26 at 12:49 -0700, Zev Weiss wrote:
> [Re-sending as I forgot to CC the list the first time, apologies for
> the duplication.]
> 
> OpenBMC on AST2400 has been badly broken for some time now due to
> systemd services segfaulting on execve() after calls to
> prctl(PR_SET_MDWE) spuriously succeeded.  The MMU of the ARMv5 CPU in
> the AST2400 cannot meaningfully support MDWE because it lacks distinct
> read & execute page permissions (read implies execute), so these
> patches ensure that the prctl to enable MDWE properly fails on
> hardware where it isn't supported.
> 
> These patches have been posted and approved upstream [0], and while at
> time of writing they haven't yet reached mainline or stable upstream,
> they're on their way and should hopefully get merged soon [1, 2].
> 

Nice, palmetto userspace behaves much better under qemu after applying
these.

Andrew