* [PATCH 1/3] x86_64: signal: clean up signal_fault()
@ 2008-09-10 0:18 Hiroshi Shimamoto
2008-09-10 0:21 ` [PATCH 2/3] x86_64: signal: arg for restore_i387_xstate() is void __user * Hiroshi Shimamoto
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Hiroshi Shimamoto @ 2008-09-10 0:18 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: linux-kernel
From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
clean up and make signal_fault() same as 32bit.
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
arch/x86/kernel/signal_64.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index 8fbdd23..552a331 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -473,12 +473,14 @@ void do_notify_resume(struct pt_regs *regs, void *unused,
void signal_fault(struct pt_regs *regs, void __user *frame, char *where)
{
struct task_struct *me = current;
+
if (show_unhandled_signals && printk_ratelimit()) {
- printk("%s[%d] bad frame in %s frame:%p ip:%lx sp:%lx orax:%lx",
- me->comm, me->pid, where, frame, regs->ip,
- regs->sp, regs->orig_ax);
+ printk(KERN_INFO
+ "%s[%d] bad frame in %s frame:%p ip:%lx sp:%lx orax:%lx",
+ me->comm, me->pid, where, frame,
+ regs->ip, regs->sp, regs->orig_ax);
print_vma_addr(" in ", regs->ip);
- printk("\n");
+ printk(KERN_CONT "\n");
}
force_sig(SIGSEGV, me);
--
1.5.6
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/3] x86_64: signal: arg for restore_i387_xstate() is void __user *
2008-09-10 0:18 [PATCH 1/3] x86_64: signal: clean up signal_fault() Hiroshi Shimamoto
@ 2008-09-10 0:21 ` Hiroshi Shimamoto
2008-09-10 0:22 ` [PATCH 3/3] x86_64: signal: make handle_signal() similar Hiroshi Shimamoto
2008-09-10 6:28 ` [PATCH 1/3] x86_64: signal: clean up signal_fault() Ingo Molnar
2 siblings, 0 replies; 4+ messages in thread
From: Hiroshi Shimamoto @ 2008-09-10 0:21 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: linux-kernel
From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
restore_i387_xstate() is declared;
int restore_i387_xstate(void __user *buf);
so, make the variable buf void __user *.
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
arch/x86/kernel/signal_64.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index 552a331..321da93 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -94,7 +94,8 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
}
{
- struct _fpstate __user *buf;
+ void __user *buf;
+
err |= __get_user(buf, &sc->fpstate);
err |= restore_i387_xstate(buf);
}
--
1.5.6
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 3/3] x86_64: signal: make handle_signal() similar
2008-09-10 0:18 [PATCH 1/3] x86_64: signal: clean up signal_fault() Hiroshi Shimamoto
2008-09-10 0:21 ` [PATCH 2/3] x86_64: signal: arg for restore_i387_xstate() is void __user * Hiroshi Shimamoto
@ 2008-09-10 0:22 ` Hiroshi Shimamoto
2008-09-10 6:28 ` [PATCH 1/3] x86_64: signal: clean up signal_fault() Ingo Molnar
2 siblings, 0 replies; 4+ messages in thread
From: Hiroshi Shimamoto @ 2008-09-10 0:22 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin; +Cc: linux-kernel
From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Make handle_signal() same as 32bit.
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
---
arch/x86/kernel/signal_64.c | 61 ++++++++++++++++++++++---------------------
1 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
index 321da93..43e6862 100644
--- a/arch/x86/kernel/signal_64.c
+++ b/arch/x86/kernel/signal_64.c
@@ -338,39 +338,40 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
ret = setup_rt_frame(sig, ka, info, oldset, regs);
- if (ret == 0) {
- /*
- * This has nothing to do with segment registers,
- * despite the name. This magic affects uaccess.h
- * macros' behavior. Reset it to the normal setting.
- */
- set_fs(USER_DS);
+ if (ret)
+ return ret;
- /*
- * Clear the direction flag as per the ABI for function entry.
- */
- regs->flags &= ~X86_EFLAGS_DF;
+ /*
+ * This has nothing to do with segment registers,
+ * despite the name. This magic affects uaccess.h
+ * macros' behavior. Reset it to the normal setting.
+ */
+ set_fs(USER_DS);
- /*
- * Clear TF when entering the signal handler, but
- * notify any tracer that was single-stepping it.
- * The tracer may want to single-step inside the
- * handler too.
- */
- regs->flags &= ~X86_EFLAGS_TF;
+ /*
+ * Clear the direction flag as per the ABI for function entry.
+ */
+ regs->flags &= ~X86_EFLAGS_DF;
- spin_lock_irq(¤t->sighand->siglock);
- sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask);
- if (!(ka->sa.sa_flags & SA_NODEFER))
- sigaddset(¤t->blocked, sig);
- recalc_sigpending();
- spin_unlock_irq(¤t->sighand->siglock);
+ /*
+ * Clear TF when entering the signal handler, but
+ * notify any tracer that was single-stepping it.
+ * The tracer may want to single-step inside the
+ * handler too.
+ */
+ regs->flags &= ~X86_EFLAGS_TF;
- tracehook_signal_handler(sig, info, ka, regs,
- test_thread_flag(TIF_SINGLESTEP));
- }
+ spin_lock_irq(¤t->sighand->siglock);
+ sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask);
+ if (!(ka->sa.sa_flags & SA_NODEFER))
+ sigaddset(¤t->blocked, sig);
+ recalc_sigpending();
+ spin_unlock_irq(¤t->sighand->siglock);
- return ret;
+ tracehook_signal_handler(sig, info, ka, regs,
+ test_thread_flag(TIF_SINGLESTEP));
+
+ return 0;
}
#define NR_restart_syscall \
--
1.5.6
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 1/3] x86_64: signal: clean up signal_fault()
2008-09-10 0:18 [PATCH 1/3] x86_64: signal: clean up signal_fault() Hiroshi Shimamoto
2008-09-10 0:21 ` [PATCH 2/3] x86_64: signal: arg for restore_i387_xstate() is void __user * Hiroshi Shimamoto
2008-09-10 0:22 ` [PATCH 3/3] x86_64: signal: make handle_signal() similar Hiroshi Shimamoto
@ 2008-09-10 6:28 ` Ingo Molnar
2 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2008-09-10 6:28 UTC (permalink / raw)
To: Hiroshi Shimamoto; +Cc: Thomas Gleixner, H. Peter Anvin, linux-kernel
applied these patches to x86/signal:
764e8d1: x86: signal_64.c: make handle_signal() similar
0c40ed7: x86: signal_64.c: arg for restore_i387_xstate() is void __user *
b2994ef: x86: signal_64.c: clean up signal_fault()
thanks!
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-09-10 6:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-10 0:18 [PATCH 1/3] x86_64: signal: clean up signal_fault() Hiroshi Shimamoto
2008-09-10 0:21 ` [PATCH 2/3] x86_64: signal: arg for restore_i387_xstate() is void __user * Hiroshi Shimamoto
2008-09-10 0:22 ` [PATCH 3/3] x86_64: signal: make handle_signal() similar Hiroshi Shimamoto
2008-09-10 6:28 ` [PATCH 1/3] x86_64: signal: clean up signal_fault() Ingo Molnar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.