diff options
author | Thomas Meyer <thomas@m3y3r.de> | 2017-07-05 18:31:14 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2017-07-07 04:37:42 -0400 |
commit | 22e19c8d062cc19832cde13225cbc6e5283cd969 (patch) | |
tree | fc86594a99176eef08e1532691cc1fa9560b7ce9 | |
parent | 1bcbfbfdeb0091036db7a32e1cd31b49cce5983a (diff) |
um: userspace - be more verbose in ptrace set regs error
When ptrace fails to set GP/FP regs for the target process,
log the error before crashing the UML kernel.
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r-- | arch/um/os-Linux/skas/process.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c index 03b3c4cc7735..31c9be2c2bdd 100644 --- a/arch/um/os-Linux/skas/process.c +++ b/arch/um/os-Linux/skas/process.c | |||
@@ -323,11 +323,17 @@ void userspace(struct uml_pt_regs *regs) | |||
323 | * fail. In this case, there is nothing to do but | 323 | * fail. In this case, there is nothing to do but |
324 | * just kill the process. | 324 | * just kill the process. |
325 | */ | 325 | */ |
326 | if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) | 326 | if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) { |
327 | printk(UM_KERN_ERR "userspace - ptrace set regs " | ||
328 | "failed, errno = %d\n", errno); | ||
327 | fatal_sigsegv(); | 329 | fatal_sigsegv(); |
330 | } | ||
328 | 331 | ||
329 | if (put_fp_registers(pid, regs->fp)) | 332 | if (put_fp_registers(pid, regs->fp)) { |
333 | printk(UM_KERN_ERR "userspace - ptrace set fp regs " | ||
334 | "failed, errno = %d\n", errno); | ||
330 | fatal_sigsegv(); | 335 | fatal_sigsegv(); |
336 | } | ||
331 | 337 | ||
332 | /* Now we set local_using_sysemu to be used for one loop */ | 338 | /* Now we set local_using_sysemu to be used for one loop */ |
333 | local_using_sysemu = get_using_sysemu(); | 339 | local_using_sysemu = get_using_sysemu(); |