]>
Commit | Line | Data |
---|---|---|
d8dd4c12 GKH |
1 | From 8d7f6690cedb83456edd41c9bd583783f0703bf0 Mon Sep 17 00:00:00 2001 |
2 | From: Martin Schwidefsky <schwidefsky@de.ibm.com> | |
3 | Date: Mon, 3 Feb 2014 17:37:15 +0100 | |
4 | Subject: s390: fix kernel crash due to linkage stack instructions | |
5 | ||
6 | From: Martin Schwidefsky <schwidefsky@de.ibm.com> | |
7 | ||
8 | commit 8d7f6690cedb83456edd41c9bd583783f0703bf0 upstream. | |
9 | ||
10 | The kernel currently crashes with a low-address-protection exception | |
11 | if a user space process executes an instruction that tries to use the | |
12 | linkage stack. Set the base-ASTE origin and the subspace-ASTE origin | |
13 | of the dispatchable-unit-control-table to point to a dummy ASTE. | |
14 | Set up control register 15 to point to an empty linkage stack with no | |
15 | room left. | |
16 | ||
17 | A user space process with a linkage stack instruction will still crash | |
18 | but with a different exception which is correctly translated to a | |
19 | segmentation fault instead of a kernel oops. | |
20 | ||
21 | Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> | |
22 | Signed-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 |