* [PATCH 5/5] frv: double syscall restarts, syscall restart in sigreturn()
@ 2010-09-18 19:42 Al Viro
0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2010-09-18 19:42 UTC (permalink / raw)
To: linux-arch; +Cc: dhowells, linux-kernel
we need to make sure that only the first do_signal() to be handled
on the way out syscall will bother with syscall restarts; additionally,
the check on the "signal has user handler" path had been wrong -
compare with restart prevention in sigreturn()...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
arch/frv/kernel/signal.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c
index ad74e2e..c2d331e 100644
--- a/arch/frv/kernel/signal.c
+++ b/arch/frv/kernel/signal.c
@@ -446,7 +446,7 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
int ret;
/* Are we from a system call? */
- if (in_syscall(__frame)) {
+ if (__frame->syscallno != -1) {
/* If so, check system call restarting.. */
switch (__frame->gr8) {
case -ERESTART_RESTARTBLOCK:
@@ -465,6 +465,7 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
__frame->gr8 = __frame->orig_gr8;
__frame->pc -= 4;
}
+ __frame->syscallno = -1;
}
/* Set up the stack frame */
@@ -551,6 +552,7 @@ no_signal:
__frame->pc -= 4;
break;
}
+ __frame->syscallno = -1;
}
/* if there's no signal to deliver, we just put the saved sigmask
--
1.5.6.5
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH 1/5] frv: restart_block.fn needs to be reset on sigreturn
@ 2010-09-20 14:13 David Howells
2010-09-20 14:13 ` [PATCH 5/5] frv: double syscall restarts, syscall restart in sigreturn() David Howells
0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2010-09-20 14:13 UTC (permalink / raw)
To: torvalds, akpm; +Cc: linux-kernel, Al Viro, David Howells
From: Al Viro <viro@ftp.linux.org.uk>
Reset restart_block.fn on executing a sigreturn such that any currently pending
system call restarts will be forced to return -EINTR.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
---
arch/frv/kernel/signal.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c
index 0974c0e..7fc2961 100644
--- a/arch/frv/kernel/signal.c
+++ b/arch/frv/kernel/signal.c
@@ -121,6 +121,9 @@ static int restore_sigcontext(struct sigcontext __user *sc, int *_gr8)
struct user_context *user = current->thread.user;
unsigned long tbr, psr;
+ /* Always make any pending restarted system calls return -EINTR */
+ current_thread_info()->restart_block.fn = do_no_restart_syscall;
+
tbr = user->i.tbr;
psr = user->i.psr;
if (copy_from_user(user, &sc->sc_context, sizeof(sc->sc_context)))
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 5/5] frv: double syscall restarts, syscall restart in sigreturn()
2010-09-20 14:13 [PATCH 1/5] frv: restart_block.fn needs to be reset on sigreturn David Howells
@ 2010-09-20 14:13 ` David Howells
0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2010-09-20 14:13 UTC (permalink / raw)
To: torvalds, akpm; +Cc: linux-kernel, Al Viro, David Howells
From: Al Viro <viro@ftp.linux.org.uk>
We need to make sure that only the first do_signal() to be handled
on the way out syscall will bother with syscall restarts; additionally,
the check on the "signal has user handler" path had been wrong -
compare with restart prevention in sigreturn()...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
---
arch/frv/kernel/signal.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c
index bd13b57..bab0129 100644
--- a/arch/frv/kernel/signal.c
+++ b/arch/frv/kernel/signal.c
@@ -446,7 +446,7 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
int ret;
/* Are we from a system call? */
- if (in_syscall(__frame)) {
+ if (__frame->syscallno != -1) {
/* If so, check system call restarting.. */
switch (__frame->gr8) {
case -ERESTART_RESTARTBLOCK:
@@ -465,6 +465,7 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
__frame->gr8 = __frame->orig_gr8;
__frame->pc -= 4;
}
+ __frame->syscallno = -1;
}
/* Set up the stack frame */
@@ -551,6 +552,7 @@ no_signal:
__frame->pc -= 4;
break;
}
+ __frame->syscallno = -1;
}
/* if there's no signal to deliver, we just put the saved sigmask
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-20 14:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-18 19:42 [PATCH 5/5] frv: double syscall restarts, syscall restart in sigreturn() Al Viro
2010-09-20 14:13 [PATCH 1/5] frv: restart_block.fn needs to be reset on sigreturn David Howells
2010-09-20 14:13 ` [PATCH 5/5] frv: double syscall restarts, syscall restart in sigreturn() David Howells
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®