]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.10.32/s390-fix-kernel-crash-due-to-linkage-stack-instructions.patch
drop queue-4.14/mips-make-sure-dt-memory-regions-are-valid.patch
[thirdparty/kernel/stable-queue.git] / releases / 3.10.32 / s390-fix-kernel-crash-due-to-linkage-stack-instructions.patch
CommitLineData
d8dd4c12
GKH
1From 8d7f6690cedb83456edd41c9bd583783f0703bf0 Mon Sep 17 00:00:00 2001
2From: Martin Schwidefsky <schwidefsky@de.ibm.com>
3Date: Mon, 3 Feb 2014 17:37:15 +0100
4Subject: s390: fix kernel crash due to linkage stack instructions
5
6From: Martin Schwidefsky <schwidefsky@de.ibm.com>
7
8commit 8d7f6690cedb83456edd41c9bd583783f0703bf0 upstream.
9
10The kernel currently crashes with a low-address-protection exception
11if a user space process executes an instruction that tries to use the
12linkage stack. Set the base-ASTE origin and the subspace-ASTE origin
13of the dispatchable-unit-control-table to point to a dummy ASTE.
14Set up control register 15 to point to an empty linkage stack with no
15room left.
16
17A user space process with a linkage stack instruction will still crash
18but with a different exception which is correctly translated to a
19segmentation fault instead of a kernel oops.
20
21Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
22Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24---
25 arch/s390/kernel/head64.S | 7 +++++--
26 1 file changed, 5 insertions(+), 2 deletions(-)
27
28--- a/arch/s390/kernel/head64.S
29+++ b/arch/s390/kernel/head64.S
30@@ -59,7 +59,7 @@ ENTRY(startup_continue)
31 .quad 0 # cr12: tracing off
32 .quad 0 # cr13: home space segment table
33 .quad 0xc0000000 # cr14: machine check handling off
34- .quad 0 # cr15: linkage stack operations
35+ .quad .Llinkage_stack # cr15: linkage stack operations
36 .Lpcmsk:.quad 0x0000000180000000
37 .L4malign:.quad 0xffffffffffc00000
38 .Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
39@@ -67,12 +67,15 @@ ENTRY(startup_continue)
40 .Lparmaddr:
41 .quad PARMAREA
42 .align 64
43-.Lduct: .long 0,0,0,0,.Lduald,0,0,0
44+.Lduct: .long 0,.Laste,.Laste,0,.Lduald,0,0,0
45 .long 0,0,0,0,0,0,0,0
46+.Laste: .quad 0,0xffffffffffffffff,0,0,0,0,0,0
47 .align 128
48 .Lduald:.rept 8
49 .long 0x80000000,0,0,0 # invalid access-list entries
50 .endr
51+.Llinkage_stack:
52+ .long 0,0,0x89000000,0,0,0,0x8a000000,0
53
54 ENTRY(_ehead)
55