Messages in this thread Patch in this message | | | Date | Fri, 14 Nov 2003 21:14:03 -0800 (PST) | From | Linus Torvalds <> | Subject | Re: [PATCH] PPC32: cancel syscall restart on signal delivery |
| |
On Sat, 15 Nov 2003, Paul Mackerras wrote: > > Now, when we resume that context we will call sys_restart_syscall > which will call restart_block.fn. Which won't necessarily still point > to do_no_restart_syscall. So I still think we have a problem.
Excellent point. We're actually much better off resetting it at signal return.
Which should make all other resets unnecessary.
Yes, you can get out of a signal by using longjmp, but that doesn't matter: you can't longjump to a restart call (well, you can, but only if the user literally tries to do the restart by hand, ie he _intended_ to do it).
So the _proper_ fix (for x86) should be as appended. Agreed?
Linus
---- ===== arch/i386/kernel/signal.c 1.33 vs edited ===== --- 1.33/arch/i386/kernel/signal.c Tue Nov 11 21:18:46 2003 +++ edited/arch/i386/kernel/signal.c Fri Nov 14 21:13:09 2003 @@ -132,6 +132,9 @@ { unsigned int err = 0; + /* Always make any pending restarted system calls return -EINTR */ + current_thread_info()->restart_block.fn = do_no_restart_syscall; + #define COPY(x) err |= __get_user(regs->x, &sc->x) #define COPY_SEG(seg) \ @@ -503,9 +506,6 @@ struct pt_regs * regs) { struct k_sigaction *ka = ¤t->sighand->action[sig-1]; - - /* Always make any pending restarted system calls return -EINTR */ - current_thread_info()->restart_block.fn = do_no_restart_syscall; /* Are we from a system call? */ if (regs->orig_eax >= 0) { - 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/
| |