lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 8 Sep 2015 07:25:55 -0700
From:	tip-bot for Ingo Molnar <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	brgerst@...il.com, luto@...capital.net,
	torvalds@...ux-foundation.org, mingo@...nel.org,
	mikko.rapeli@....fi, hpa@...or.com, tglx@...utronix.de,
	bp@...en8.de, peterz@...radead.org, dvlasenk@...hat.com,
	linux-kernel@...r.kernel.org, oleg@...hat.com
Subject: [tip:x86/headers] x86/headers:
  Separate out legacy user-space structure definitions

Commit-ID:  128f8257a17a47b9a40f550cc2f36458cd8c07b0
Gitweb:     http://git.kernel.org/tip/128f8257a17a47b9a40f550cc2f36458cd8c07b0
Author:     Ingo Molnar <mingo@...nel.org>
AuthorDate: Sat, 5 Sep 2015 09:32:32 +0200
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 8 Sep 2015 10:03:56 +0200

x86/headers: Separate out legacy user-space structure definitions

Better separate the user-space struct sigcontext definitions
from the kernel definitions, so that we can unify the kernel
definitions with sigcontext32.h.

Acked-by: Mikko Rapeli <mikko.rapeli@....fi>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Oleg Nesterov <oleg@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-kernel@...r.kernel.org
Link: http://lkml.kernel.org/r/1441438363-9999-5-git-send-email-mingo@kernel.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 arch/x86/include/uapi/asm/sigcontext.h | 119 ++++++++++++++++-----------------
 1 file changed, 59 insertions(+), 60 deletions(-)

diff --git a/arch/x86/include/uapi/asm/sigcontext.h b/arch/x86/include/uapi/asm/sigcontext.h
index f89b2f1..40d6cba 100644
--- a/arch/x86/include/uapi/asm/sigcontext.h
+++ b/arch/x86/include/uapi/asm/sigcontext.h
@@ -124,36 +124,6 @@ struct _fpstate {
 	};
 };
 
-# ifndef __KERNEL__
-/*
- * User-space might still rely on the old definition:
- */
-struct sigcontext {
-	unsigned short			gs, __gsh;
-	unsigned short			fs, __fsh;
-	unsigned short			es, __esh;
-	unsigned short			ds, __dsh;
-	unsigned long			edi;
-	unsigned long			esi;
-	unsigned long			ebp;
-	unsigned long			esp;
-	unsigned long			ebx;
-	unsigned long			edx;
-	unsigned long			ecx;
-	unsigned long			eax;
-	unsigned long			trapno;
-	unsigned long			err;
-	unsigned long			eip;
-	unsigned short			cs, __csh;
-	unsigned long			eflags;
-	unsigned long			esp_at_signal;
-	unsigned short			ss, __ssh;
-	struct _fpstate __user		*fpstate;
-	unsigned long			oldmask;
-	unsigned long			cr2;
-};
-# endif /* !__KERNEL__ */
-
 #else /* __x86_64__: */
 
 /*
@@ -186,10 +156,65 @@ struct _fpstate {
 	};
 };
 
-# ifndef __KERNEL__
+#endif /* __x86_64__ */
+
+struct _header {
+	__u64				xfeatures;
+	__u64				reserved1[2];
+	__u64				reserved2[5];
+};
+
+struct _ymmh_state {
+	/* 16x YMM registers, 16 bytes each: */
+	__u32				ymmh_space[64];
+};
+
 /*
- * User-space might still rely on the old definition:
+ * Extended state pointed to by sigcontext::fpstate.
+ *
+ * In addition to the fpstate, information encoded in _xstate::xstate_hdr
+ * indicates the presence of other extended state information supported
+ * by the CPU and kernel:
  */
+struct _xstate {
+	struct _fpstate			fpstate;
+	struct _header			xstate_hdr;
+	struct _ymmh_state		ymmh;
+	/* New processor state extensions go here: */
+};
+
+/*
+ * The old user-space sigcontext definition, just in case user-space still
+ * relies on it. The kernel definition (in asm/sigcontext.h) has unified
+ * field names but otherwise the same layout.
+ */
+#ifndef __KERNEL__
+# ifdef __i386__
+struct sigcontext {
+	unsigned short			gs, __gsh;
+	unsigned short			fs, __fsh;
+	unsigned short			es, __esh;
+	unsigned short			ds, __dsh;
+	unsigned long			edi;
+	unsigned long			esi;
+	unsigned long			ebp;
+	unsigned long			esp;
+	unsigned long			ebx;
+	unsigned long			edx;
+	unsigned long			ecx;
+	unsigned long			eax;
+	unsigned long			trapno;
+	unsigned long			err;
+	unsigned long			eip;
+	unsigned short			cs, __csh;
+	unsigned long			eflags;
+	unsigned long			esp_at_signal;
+	unsigned short			ss, __ssh;
+	struct _fpstate __user		*fpstate;
+	unsigned long			oldmask;
+	unsigned long			cr2;
+};
+# else /* __x86_64__: */
 struct sigcontext {
 	__u64				r8;
 	__u64				r9;
@@ -223,33 +248,7 @@ struct sigcontext {
 #  endif
 	__u64				reserved1[8];
 };
-# endif /* !__KERNEL__ */
-
-#endif /* __x86_64__ */
-
-struct _header {
-	__u64				xfeatures;
-	__u64				reserved1[2];
-	__u64				reserved2[5];
-};
-
-struct _ymmh_state {
-	/* 16x YMM registers, 16 bytes each: */
-	__u32				ymmh_space[64];
-};
-
-/*
- * Extended state pointed to by sigcontext::fpstate.
- *
- * In addition to the fpstate, information encoded in _xstate::xstate_hdr
- * indicates the presence of other extended state information supported
- * by the CPU and kernel:
- */
-struct _xstate {
-	struct _fpstate			fpstate;
-	struct _header			xstate_hdr;
-	struct _ymmh_state		ymmh;
-	/* New processor state extensions go here: */
-};
+# endif /* __x86_64__ */
+#endif /* !__KERNEL__ */
 
 #endif /* _UAPI_ASM_X86_SIGCONTEXT_H */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ