Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Thomas Meyer and committed by
Richard Weinberger
22e19c8d 1bcbfbfd

+8 -2
+8 -2
arch/um/os-Linux/skas/process.c
··· 323 323 * fail. In this case, there is nothing to do but 324 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 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 335 fatal_sigsegv(); 336 + } 331 337 332 338 /* Now we set local_using_sysemu to be used for one loop */ 333 339 local_using_sysemu = get_using_sysemu();