Commit 05602145 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Greg Kroah-Hartman

add missing .set function for NT_S390_LAST_BREAK regset

commit b934069c upstream.

The last breaking event address is a read-only value, the regset misses the
.set function. If a PTRACE_SETREGSET is done for NT_S390_LAST_BREAK we
get an oops due to a branch to zero:

Kernel BUG at 0000000000000002 verbose debug info unavailable
illegal operation: 0001 #1 SMP
...
Call Trace:
(<0000000000158294> ptrace_regset+0x184/0x188)
 <00000000001595b6> ptrace_request+0x37a/0x4fc
 <0000000000109a78> arch_ptrace+0x108/0x1fc
 <00000000001590d6> SyS_ptrace+0xaa/0x12c
 <00000000005c7a42> sysc_noemu+0x16/0x1c
 <000003fffd5ec10c> 0x3fffd5ec10c
Last Breaking-Event-Address:
 <0000000000158242> ptrace_regset+0x132/0x188

Add a nop .set function to prevent the branch to zero.
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a6ff8af2
...@@ -897,6 +897,14 @@ static int s390_last_break_get(struct task_struct *target, ...@@ -897,6 +897,14 @@ static int s390_last_break_get(struct task_struct *target,
return 0; return 0;
} }
static int s390_last_break_set(struct task_struct *target,
const struct user_regset *regset,
unsigned int pos, unsigned int count,
const void *kbuf, const void __user *ubuf)
{
return 0;
}
#endif #endif
static const struct user_regset s390_regsets[] = { static const struct user_regset s390_regsets[] = {
...@@ -923,6 +931,7 @@ static const struct user_regset s390_regsets[] = { ...@@ -923,6 +931,7 @@ static const struct user_regset s390_regsets[] = {
.size = sizeof(long), .size = sizeof(long),
.align = sizeof(long), .align = sizeof(long),
.get = s390_last_break_get, .get = s390_last_break_get,
.set = s390_last_break_set,
}, },
#endif #endif
}; };
...@@ -1080,6 +1089,14 @@ static int s390_compat_last_break_get(struct task_struct *target, ...@@ -1080,6 +1089,14 @@ static int s390_compat_last_break_get(struct task_struct *target,
return 0; return 0;
} }
static int s390_compat_last_break_set(struct task_struct *target,
const struct user_regset *regset,
unsigned int pos, unsigned int count,
const void *kbuf, const void __user *ubuf)
{
return 0;
}
static const struct user_regset s390_compat_regsets[] = { static const struct user_regset s390_compat_regsets[] = {
[REGSET_GENERAL] = { [REGSET_GENERAL] = {
.core_note_type = NT_PRSTATUS, .core_note_type = NT_PRSTATUS,
...@@ -1103,6 +1120,7 @@ static const struct user_regset s390_compat_regsets[] = { ...@@ -1103,6 +1120,7 @@ static const struct user_regset s390_compat_regsets[] = {
.size = sizeof(long), .size = sizeof(long),
.align = sizeof(long), .align = sizeof(long),
.get = s390_compat_last_break_get, .get = s390_compat_last_break_get,
.set = s390_compat_last_break_set,
}, },
[REGSET_GENERAL_EXTENDED] = { [REGSET_GENERAL_EXTENDED] = {
.core_note_type = NT_S390_HIGH_GPRS, .core_note_type = NT_S390_HIGH_GPRS,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment