[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[glibc] 01/01: patches/hurd-i386/git-stack-protect-static.diff: New patch



This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch glibc-2.25
in repository glibc.

commit 1f0c574ebdec2a92bc80dd037ea6b6d5fd888316
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun Aug 27 20:33:15 2017 +0000

    patches/hurd-i386/git-stack-protect-static.diff: New patch
---
 debian/changelog                                   |  1 +
 .../hurd-i386/git-stack-protect-static.diff        | 53 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 55 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 3989351..0605ff4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ glibc (2.25-0experimental4) UNRELEASED; urgency=medium
   [ Samuel Thibault ]
   * patches/hurd-i386/git-bits-sysmacros.h.diff: New patch.
   * patches/hurd-i386/git-stack_chk_fail_local.diff: New patch.
+  * patches/hurd-i386/git-stack-protect-static.diff: New patch.
 
  -- Aurelien Jarno <aurel32@debian.org>  Sun, 27 Aug 2017 01:51:15 +0200
 
diff --git a/debian/patches/hurd-i386/git-stack-protect-static.diff b/debian/patches/hurd-i386/git-stack-protect-static.diff
new file mode 100644
index 0000000..ecdf1cd
--- /dev/null
+++ b/debian/patches/hurd-i386/git-stack-protect-static.diff
@@ -0,0 +1,53 @@
+commit 99ee4d26dc07c3eadfbf6793db26ef9dfb1551e5
+Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Date:   Sun Aug 27 22:26:49 2017 +0200
+
+    hurd: Fix static initialization with -fstack-protector-strong
+    
+    When linked statically, TLS initialization is not achieved before
+    mach_init and alike, so ssp accesses to tcbhead's stack_guard would
+    crash.  We can just avoid using ssp in the few functions needed before
+    TLS is set up.
+    
+            * mach/Makefile (CFLAGS-mach_init.o, CFLAGS-RPC_vm_statistics.o,
+            CFLAGS-RPC_vm_map.o, CFLAGS-RPC_vm_protect.o,
+            CFLAGS-RPC_i386_set_gdt.o, CFLAGS-RPC_i386_set_ldt.o,
+            CFLAGS-RPC_task_get_special_port.o): Add $(no-stack-protector).
+            * hurd/Makefile (CFLAGS-hurdstartup.o,
+            CFLAGS-RPC_exec_startup_get_info.o): Add $(no-stack-protector).
+
+diff --git a/hurd/Makefile b/hurd/Makefile
+index 9205822b24..b44b9b80c6 100644
+--- a/hurd/Makefile
++++ b/hurd/Makefile
+@@ -81,6 +81,10 @@ $(inlines:%=$(objpfx)%.c): $(objpfx)%-inlines.c: %.h
+ 	 echo '#include "$<"') > $@-new
+ 	mv -f $@-new $@
+ generated += $(inlines:=.c)
++
++# Avoid ssp before TLS is initialized.
++CFLAGS-hurdstartup.o = $(no-stack-protector)
++CFLAGS-RPC_exec_startup_get_info.o = $(no-stack-protector)
+ 
+ include ../mach/Machrules
+ include ../Rules
+diff --git a/mach/Makefile b/mach/Makefile
+index 127cad00ca..b4f18b1525 100644
+--- a/mach/Makefile
++++ b/mach/Makefile
+@@ -53,6 +53,15 @@ server-interfaces := mach/exc
+ 
+ # Clear any environment	value.
+ generated =
++
++# Avoid ssp before TLS is initialized.
++CFLAGS-mach_init.o = $(no-stack-protector)
++CFLAGS-RPC_vm_statistics.o = $(no-stack-protector)
++CFLAGS-RPC_vm_map.o = $(no-stack-protector)
++CFLAGS-RPC_vm_protect.o = $(no-stack-protector)
++CFLAGS-RPC_i386_set_gdt.o = $(no-stack-protector)
++CFLAGS-RPC_i386_set_ldt.o = $(no-stack-protector)
++CFLAGS-RPC_task_get_special_port.o = $(no-stack-protector)
+ 
+ # Translate GNU names for CPUs into the names used in Mach header files.
+ mach-machine = $(patsubst powerpc,ppc,$(base-machine))
diff --git a/debian/patches/series b/debian/patches/series
index 75026ec..56a19b8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -134,6 +134,7 @@ hurd-i386/git-__inet6_scopeid_pton.diff
 hurd-i386/local-nocheck-installed-headers.diff
 hurd-i386/git-bits-sysmacros.h.diff
 hurd-i386/git-stack_chk_fail_local.diff
+hurd-i386/git-stack-protect-static.diff
 
 i386/local-biarch.diff
 i386/local-cmov.diff

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-glibc/glibc.git


Reply to: