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:   Thu, 21 Jun 2018 14:17:52 -0700
From:   "H. Peter Anvin, Intel" <h.peter.anvin@...el.com>
To:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Cc:     "H. Peter Anvin" <hpa@...ux.intel.com>,
        "H . Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Andy Lutomirski <luto@...nel.org>,
        "Chang S . Bae" <chang.seok.bae@...el.com>,
        "Markus T . Metzger" <markus.t.metzger@...el.com>
Subject: [PATCH v3 5/7] x86/segment: add #define for the last user-visible GDT slot

From: "H. Peter Anvin" <hpa@...ux.intel.com>

We don't want to advertise to user space how many slots the kernel
GDT has, but user space can trivially find out what the last
user-accessible GDT slot is.  Add a #define for that so we can use
that in sizing a regset.

Signed-off-by: H. Peter Anvin (Intel) <hpa@...or.com>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Chang S. Bae <chang.seok.bae@...el.com>
Cc: Markus T. Metzger <markus.t.metzger@...el.com>
---
 arch/x86/include/asm/segment.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h
index e293c122d0d5..5eb809eec048 100644
--- a/arch/x86/include/asm/segment.h
+++ b/arch/x86/include/asm/segment.h
@@ -115,6 +115,11 @@
  */
 #define GDT_ENTRIES			32
 
+/*
+ * Last user-visible GDT slot
+ */
+#define GDT_LAST_USER			GDT_ENTRY_DEFAULT_USER_DS
+
 /*
  * Segment selector values corresponding to the above entries:
  */
@@ -194,6 +199,11 @@
  */
 #define GDT_ENTRIES			16
 
+/*
+ * Last user-visible GDT slot
+ */
+#define GDT_LAST_USER			GDT_ENTRY_PER_CPU
+
 /*
  * Segment selector values corresponding to the above entries:
  *
-- 
2.14.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ