aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-09-05 03:32:39 -0400
committerIngo Molnar <mingo@kernel.org>2015-09-08 04:03:58 -0400
commit530e5c827182a7a5322c55276b0617fd06874c24 (patch)
tree5f9e042204b3d78fd3276dca0ceef59ef4fc6205
parentf2c609bca0b6526810fa22330ce4d173cc023ef8 (diff)
x86/headers: Make sigcontext pointers bit independent
Before we can eliminate the duplication between 'struct sigcontext_32' and 'struct sigcontext_ia32', make the 'fpstate' pointer field in 'struct sigcontext_32' bit independent. Acked-by: Mikko Rapeli <mikko.rapeli@iki.fi> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Link: http://lkml.kernel.org/r/1441438363-9999-12-git-send-email-mingo@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/include/uapi/asm/sigcontext.h4
-rw-r--r--arch/x86/kernel/signal.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/include/uapi/asm/sigcontext.h b/arch/x86/include/uapi/asm/sigcontext.h
index 3591cef6d7d2..d0def259d545 100644
--- a/arch/x86/include/uapi/asm/sigcontext.h
+++ b/arch/x86/include/uapi/asm/sigcontext.h
@@ -218,7 +218,7 @@ struct sigcontext_32 {
218 * of extended memory layout. See comments at the definition of 218 * of extended memory layout. See comments at the definition of
219 * (struct _fpx_sw_bytes) 219 * (struct _fpx_sw_bytes)
220 */ 220 */
221 void __user *fpstate; /* Zero when no FPU/extended context */ 221 __u32 fpstate; /* Zero when no FPU/extended context */
222 __u32 oldmask; 222 __u32 oldmask;
223 __u32 cr2; 223 __u32 cr2;
224}; 224};
@@ -258,7 +258,7 @@ struct sigcontext_64 {
258 * of extended memory layout. See comments at the definition of 258 * of extended memory layout. See comments at the definition of
259 * (struct _fpx_sw_bytes) 259 * (struct _fpx_sw_bytes)
260 */ 260 */
261 void __user *fpstate; /* Zero when no FPU/extended context */ 261 __u64 fpstate; /* Zero when no FPU/extended context */
262 __u64 reserved1[8]; 262 __u64 reserved1[8];
263}; 263};
264 264
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index da52e6bb5c7f..3724ff38033e 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -63,6 +63,7 @@
63 63
64int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) 64int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
65{ 65{
66 unsigned long buf_val;
66 void __user *buf; 67 void __user *buf;
67 unsigned int tmpflags; 68 unsigned int tmpflags;
68 unsigned int err = 0; 69 unsigned int err = 0;
@@ -107,7 +108,8 @@ int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
107 regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS); 108 regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS);
108 regs->orig_ax = -1; /* disable syscall checks */ 109 regs->orig_ax = -1; /* disable syscall checks */
109 110
110 get_user_ex(buf, &sc->fpstate); 111 get_user_ex(buf_val, &sc->fpstate);
112 buf = (void __user *)buf_val;
111 } get_user_catch(err); 113 } get_user_catch(err);
112 114
113 err |= fpu__restore_sig(buf, config_enabled(CONFIG_X86_32)); 115 err |= fpu__restore_sig(buf, config_enabled(CONFIG_X86_32));