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

[S390] ptrace inferior call interactions with TIF_SYSCALL

The TIF_SYSCALL bit needs to be cleared if the debugger changes the state
of the ptraced process in regard to the presence of a system call.
Otherwise the system call will be restarted although the debugger set up
an inferior call.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

+3 -5
+3 -5
arch/s390/kernel/signal.c
··· 460 460 regs->svc_code >> 16); 461 461 break; 462 462 } 463 - /* No longer in a system call */ 464 - clear_thread_flag(TIF_SYSCALL); 465 463 } 464 + /* No longer in a system call */ 465 + clear_thread_flag(TIF_SYSCALL); 466 466 467 467 if ((is_compat_task() ? 468 468 handle_signal32(signr, &ka, &info, oldset, regs) : ··· 486 486 } 487 487 488 488 /* No handlers present - check for system call restart */ 489 + clear_thread_flag(TIF_SYSCALL); 489 490 if (current_thread_info()->system_call) { 490 491 regs->svc_code = current_thread_info()->system_call; 491 492 switch (regs->gprs[2]) { ··· 500 499 /* Restart system call with magic TIF bit. */ 501 500 regs->gprs[2] = regs->orig_gpr2; 502 501 set_thread_flag(TIF_SYSCALL); 503 - break; 504 - default: 505 - clear_thread_flag(TIF_SYSCALL); 506 502 break; 507 503 } 508 504 }