Messages in this thread Patch in this message | | | Date | Sat, 15 Nov 2003 11:04:21 +1100 | From | Paul Mackerras <> | Subject | [PATCH] PPC32: cancel syscall restart on signal delivery |
| |
Linus, please apply.
This patch ensures that the PPC kernel cancels any pending restarted system call when it delivers a signal. This is the PPC counterpart of the change that has recently gone into i386 and other architectures.
BTW, do we have a test program that triggers the bug that this fixes?
Thanks, Paul.
diff -urN linux-2.5/arch/ppc/kernel/signal.c pmac-2.5/arch/ppc/kernel/signal.c --- linux-2.5/arch/ppc/kernel/signal.c 2003-09-27 19:46:43.000000000 +1000 +++ pmac-2.5/arch/ppc/kernel/signal.c 2003-11-14 23:08:22.000000000 +1100 @@ -569,10 +569,6 @@ regs->result = -EINTR; regs->gpr[3] = EINTR; /* note that the cr0.SO bit is already set */ - /* clear any restart function that was set */ - if (ret == ERESTART_RESTARTBLOCK) - current_thread_info()->restart_block.fn - = do_no_restart_syscall; } else { regs->nip -= 4; /* Back up & retry system call */ regs->result = 0; @@ -587,6 +583,9 @@ if (signr == 0) return 0; /* no signals delivered */ + /* Always make any pending restarted system calls return -EINTR */ + current_thread_info()->restart_block.fn = do_no_restart_syscall; + if ((ka->sa.sa_flags & SA_ONSTACK) && current->sas_ss_size && !on_sig_stack(regs->gpr[1])) newsp = current->sas_ss_sp + current->sas_ss_size; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |