mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] PPC32: cancel syscall restart on signal delivery
@ 2003-11-15  0:04 Paul Mackerras
  2003-11-15  0:21 ` Linus Torvalds
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Mackerras @ 2003-11-15  0:04 UTC (permalink / raw)
  To: torvalds; +Cc: trini, benh, linux-kernel

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;

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2003-11-15  6:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-15  0:04 [PATCH] PPC32: cancel syscall restart on signal delivery Paul Mackerras
2003-11-15  0:21 ` Linus Torvalds
2003-11-15  0:31   ` Linus Torvalds
2003-11-15  2:59   ` Paul Mackerras
2003-11-15  3:11     ` Linus Torvalds
2003-11-15  3:25       ` Linus Torvalds
2003-11-15  5:03       ` Paul Mackerras
2003-11-15  5:14         ` Linus Torvalds
2003-11-15  5:47           ` Linus Torvalds
2003-11-15  6:26           ` Paul Mackerras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®