From 3b7d15bde54be81e3edd773724d85d20ae42a4da Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 22 Apr 2012 03:27:28 -0400 Subject: um: ->restart_block.fn needs to be reset on sigreturn Signed-off-by: Al Viro --- arch/um/kernel/signal.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'arch/um') diff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c index fb12f4c5e649..0dfcef92ec91 100644 --- a/arch/um/kernel/signal.c +++ b/arch/um/kernel/signal.c @@ -29,9 +29,6 @@ static int handle_signal(struct pt_regs *regs, unsigned long signr, unsigned long sp; int err; - /* Always make any pending restarted system calls return -EINTR */ - current_thread_info()->restart_block.fn = do_no_restart_syscall; - /* Did we come from a system call? */ if (PT_REGS_SYSCALL_NR(regs) >= 0) { /* If so, check system call restarting.. */ -- cgit v1.2.3 From d50349b0c397407458ea8c57aee765d158e6f9ee Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 24 Apr 2012 02:37:07 -0400 Subject: um: add TIF_NOTIFY_RESUME Signed-off-by: Al Viro --- arch/um/include/asm/thread_info.h | 1 + arch/um/kernel/process.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'arch/um') diff --git a/arch/um/include/asm/thread_info.h b/arch/um/include/asm/thread_info.h index 200c4ab1240c..6d85ebb860fd 100644 --- a/arch/um/include/asm/thread_info.h +++ b/arch/um/include/asm/thread_info.h @@ -71,6 +71,7 @@ static inline struct thread_info *current_thread_info(void) #define TIF_MEMDIE 5 /* is terminating due to OOM killer */ #define TIF_SYSCALL_AUDIT 6 #define TIF_RESTORE_SIGMASK 7 +#define TIF_NOTIFY_RESUME 8 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index 2b73dedb44ca..4d9af3172d9f 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -114,8 +115,13 @@ void interrupt_end(void) { if (need_resched()) schedule(); - if (test_tsk_thread_flag(current, TIF_SIGPENDING)) + if (test_thread_flag(TIF_SIGPENDING)) do_signal(); + if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME)) { + tracehook_notify_resume(¤t->thread.regs); + if (current->replacement_session_keyring) + key_replace_session_keyring(); + } } void exit_thread(void) -- cgit v1.2.3 From 5a30a798fb501429522a30b6027a603244d659b2 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Thu, 26 Apr 2012 23:25:06 -0400 Subject: um: wrong sigmask saved in case of multiple sigframes we can't just find oldmask once; if there are multiple signals and we loop building sigframes for those, ->saved_mask will be definitely wrong for all but the first one. Signed-off-by: Al Viro --- arch/um/kernel/signal.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'arch/um') diff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c index 0dfcef92ec91..187118fbe1bc 100644 --- a/arch/um/kernel/signal.c +++ b/arch/um/kernel/signal.c @@ -74,15 +74,14 @@ static int kern_do_signal(struct pt_regs *regs) { struct k_sigaction ka_copy; siginfo_t info; - sigset_t *oldset; int sig, handled_sig = 0; - if (test_thread_flag(TIF_RESTORE_SIGMASK)) - oldset = ¤t->saved_sigmask; - else - oldset = ¤t->blocked; - while ((sig = get_signal_to_deliver(&info, &ka_copy, regs, NULL)) > 0) { + sigset_t *oldset; + if (test_thread_flag(TIF_RESTORE_SIGMASK)) + oldset = ¤t->saved_sigmask; + else + oldset = ¤t->blocked; handled_sig = 1; /* Whee! Actually deliver the signal. */ if (!handle_signal(regs, sig, &ka_copy, &info, oldset)) { -- cgit v1.2.3 From c6802f4370510fa8674674f11c5578ee057d1d63 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 21 May 2012 14:22:25 -0400 Subject: um: bury unused _TIF_RESTORE_SIGMASK Signed-off-by: Al Viro --- arch/um/include/asm/thread_info.h | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/um') diff --git a/arch/um/include/asm/thread_info.h b/arch/um/include/asm/thread_info.h index 6d85ebb860fd..c04e5ab68f56 100644 --- a/arch/um/include/asm/thread_info.h +++ b/arch/um/include/asm/thread_info.h @@ -79,6 +79,5 @@ static inline struct thread_info *current_thread_info(void) #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) #define _TIF_MEMDIE (1 << TIF_MEMDIE) #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) -#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) #endif -- cgit v1.2.3 From 243412be9cecfc7fddebb912a277b76119fd4ecd Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 20 May 2012 00:05:58 -0400 Subject: um/x86: merge (and trim) 32- and 64-bit variants of ptrace.h Signed-off-by: Al Viro --- arch/um/kernel/process.c | 2 +- arch/um/kernel/skas/syscall.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/um') diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index 4d9af3172d9f..3a2235e0abc3 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -196,7 +196,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, if (current->thread.forking) { memcpy(&p->thread.regs.regs, ®s->regs, sizeof(p->thread.regs.regs)); - REGS_SET_SYSCALL_RETURN(p->thread.regs.regs.gp, 0); + UPT_SET_SYSCALL_RETURN(&p->thread.regs.regs, 0); if (sp != 0) REGS_SP(p->thread.regs.regs.gp) = sp; diff --git a/arch/um/kernel/skas/syscall.c b/arch/um/kernel/skas/syscall.c index f5173e1ec3ac..05fbeb480e0b 100644 --- a/arch/um/kernel/skas/syscall.c +++ b/arch/um/kernel/skas/syscall.c @@ -34,7 +34,7 @@ void handle_syscall(struct uml_pt_regs *r) result = -ENOSYS; else result = EXECUTE_SYSCALL(syscall, regs); - REGS_SET_SYSCALL_RETURN(r->gp, result); + UPT_SET_SYSCALL_RETURN(r, result); syscall_trace(r, 1); } -- cgit v1.2.3