Skip to content

Commit b934069

Browse files
author
Martin Schwidefsky
committed
[S390] add missing .set function for NT_S390_LAST_BREAK regset
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: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: stable@kernel.org
1 parent 7c81878 commit b934069

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

arch/s390/kernel/ptrace.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,14 @@ static int s390_last_break_get(struct task_struct *target,
905905
return 0;
906906
}
907907

908+
static int s390_last_break_set(struct task_struct *target,
909+
const struct user_regset *regset,
910+
unsigned int pos, unsigned int count,
911+
const void *kbuf, const void __user *ubuf)
912+
{
913+
return 0;
914+
}
915+
908916
#endif
909917

910918
static int s390_system_call_get(struct task_struct *target,
@@ -951,6 +959,7 @@ static const struct user_regset s390_regsets[] = {
951959
.size = sizeof(long),
952960
.align = sizeof(long),
953961
.get = s390_last_break_get,
962+
.set = s390_last_break_set,
954963
},
955964
#endif
956965
[REGSET_SYSTEM_CALL] = {
@@ -1116,6 +1125,14 @@ static int s390_compat_last_break_get(struct task_struct *target,
11161125
return 0;
11171126
}
11181127

1128+
static int s390_compat_last_break_set(struct task_struct *target,
1129+
const struct user_regset *regset,
1130+
unsigned int pos, unsigned int count,
1131+
const void *kbuf, const void __user *ubuf)
1132+
{
1133+
return 0;
1134+
}
1135+
11191136
static const struct user_regset s390_compat_regsets[] = {
11201137
[REGSET_GENERAL] = {
11211138
.core_note_type = NT_PRSTATUS,
@@ -1139,6 +1156,7 @@ static const struct user_regset s390_compat_regsets[] = {
11391156
.size = sizeof(long),
11401157
.align = sizeof(long),
11411158
.get = s390_compat_last_break_get,
1159+
.set = s390_compat_last_break_set,
11421160
},
11431161
[REGSET_SYSTEM_CALL] = {
11441162
.core_note_type = NT_S390_SYSTEM_CALL,

0 commit comments

Comments
 (0)