Skip to contentSkip to conversation

alpha: belated ERESTART_RESTARTBLOCK race fix

PATCH In review Al Viro 3 participants 3 messages Sep 18, 2010 – Sep 19, 2010

Subsystems (2)
lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/4 alpha: belated ERESTART_RESTARTBLOCK race fix

same thing as had been done on other targets back in 2003 - move setting ->restart_block.fn into {rt_,}sigreturn().

---
 arch/alpha/kernel/signal.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/alpha/kernel/signal.c +2 -1
index 0932dbb..e5b1b3c 100644
@@ -239,6 +239,8 @@ restore_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
 	unsigned long usp;
 	long i, err = __get_user(regs->pc, &sc->sc_pc);
 
+	current_thread_info()->restart_block.fn = do_no_restart_syscall;
+
 	sw->r26 = (unsigned long) ret_from_sys_call;
 
 	err |= __get_user(regs->r0, sc->sc_regs+0);
@@ -591,7 +593,6 @@ syscall_restart(unsigned long r0, unsigned long r19,
 		regs->pc -= 4;
 		break;
 	case ERESTART_RESTARTBLOCK:
-		current_thread_info()->restart_block.fn = do_no_restart_syscall;
 		regs->r0 = EINTR;
 		break;
 	}
Signature · 1 line
1.5.6.5
maintainer
#2 lore raw
Quoted 5 lines · Michael Cree
Quoted 4 lines · Al Viro

same thing as had been done on other targets back in 2003 - move setting ->restart_block.fn into {rt_,}sigreturn().

Quoted 9 lines
Quoted 1 line

For the patch series:

Cheers
Michael.

Thanks for the test.

Al, I've vacuumed your patches and sent them with others in a pull request to Linus.

Thanks a ton. Anyone who finds and fixes a 14 year-old bug, well, I owe you a beer.

Thanks!
Matt