guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 6ce797d03f395311b559697af381d590942cc52a
Author: Yelninei <[email protected]>
AuthorDate: Tue Nov 17 14:28:33 2026 +0000

    gnu: gnumach: Dont accept ACC_CALL_GATE [security-fixes].
    
    * gnu/packages/patches/gnumach-dont-accept-ACC_CALL_GATE.patch.
    * gnu/packages/hurd.scm (gnumach): Add patch
    
    Signed-off-by: Janneke Nieuwenhuizen <[email protected]>
    Merges: #12610
---
 gnu/packages/hurd.scm                              |  7 ++++++
 .../gnumach-dont-accept-ACC_CALL_GATE.patch        | 28 ++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 2c767aeca38..09063632801 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -276,6 +276,13 @@ Hurd-minimal package which are needed for both glibc and 
GCC.")
   (package
     (inherit gnumach-headers)
     (name "gnumach")
+    (source (origin
+              (inherit (package-source gnumach-headers))
+              (patches (append (origin-patches
+                                (package-source gnumach-headers))
+                               (search-patches
+                                "gnumach-dont-accept-ACC_CALL_GATE.patch")))))
+
     (arguments
      (substitute-keyword-arguments arguments
        ((#:configure-flags flags ''())
diff --git a/gnu/packages/patches/gnumach-dont-accept-ACC_CALL_GATE.patch 
b/gnu/packages/patches/gnumach-dont-accept-ACC_CALL_GATE.patch
new file mode 100644
index 00000000000..4a1953553df
--- /dev/null
+++ b/gnu/packages/patches/gnumach-dont-accept-ACC_CALL_GATE.patch
@@ -0,0 +1,28 @@
+From 4859d6ef2d5c36dc3de69b00395c6b031f2fe90d Mon Sep 17 00:00:00 2001
+From: Nathan Sapwell <[email protected]>
+Date: Sat, 14 Nov 2026 12:55:08 +0100
+Subject: [PATCH] i386_set_ldt: do not accept ACC_CALL_GATE
+
+This is not actually used, and the code was not checking the gate's target
+selector or offset, allowing userspace to plant a gate in its own LDT that
+selects KERNEL_CS (0x08) at an arbitrary offset, then lcall into it.
+---
+ i386/i386/user_ldt.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/i386/i386/user_ldt.c b/i386/i386/user_ldt.c
+index 4c89bd44..87bbeb4d 100644
+--- a/i386/i386/user_ldt.c
++++ b/i386/i386/user_ldt.c
+@@ -124,8 +124,6 @@ i386_set_ldt(
+               case ACC_P | ACC_PL_U | ACC_CODE_R:
+               case ACC_P | ACC_PL_U | ACC_CODE_C:
+               case ACC_P | ACC_PL_U | ACC_CODE_CR:
+-              case ACC_P | ACC_PL_U | ACC_CALL_GATE_16:
+-              case ACC_P | ACC_PL_U | ACC_CALL_GATE:
+                   break;
+               default:
+                   return KERN_INVALID_ARGUMENT;
+-- 
+2.55.0
+

Reply via email to