This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch hjl/cet/master updated. glibc-2.26.9000-957-g2ef49c4

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, hjl/cet/master has been updated
       via  2ef49c4d72d96b5a1b589e0067c33b54df57a1eb (commit)
      from  6c9578d51a015b5e32b49d12b0c599836876d311 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------;a=commitdiff;h=2ef49c4d72d96b5a1b589e0067c33b54df57a1eb

commit 2ef49c4d72d96b5a1b589e0067c33b54df57a1eb
Author: H.J. Lu <>
Date:   Fri Dec 8 04:47:49 2017 -0800

    x86: Check GNU_PROPERTY_X86_FEATURE_1_SHSTK isn't set
    -fcf-protection -mcet is incompatible with makecontext family functions
    since they can't properly set up and destroy shadow stack pointer.  When
    they are used, GNU_PROPERTY_X86_FEATURE_1_SHSTK shouldn't be set on the
    program.  Add a test to check it, which is expected to fail until the
    GCC bug:
    is fixed.
    	* sysdeps/unix/sysv/linux/x86/Makefile (tests-special): Add
    	($(objpfx)tst-setcontext3-shstk.out): New target.
    	* sysdeps/unix/sysv/linux/x86/ New file.

diff --git a/sysdeps/unix/sysv/linux/x86/Makefile b/sysdeps/unix/sysv/linux/x86/Makefile
index a7c0a34..7db7fdb 100644
--- a/sysdeps/unix/sysv/linux/x86/Makefile
+++ b/sysdeps/unix/sysv/linux/x86/Makefile
@@ -25,6 +25,15 @@ gen-as-const-headers += jmp_buf-ssp.sym
 tests += tst-saved_mask-1
+ifeq ($(subdir),stdlib)
+# Check that GNU_PROPERTY_X86_FEATURE_1_SHSTK isn't set.
+tests-special += $(objpfx)tst-setcontext3-shstk.out
+$(objpfx)tst-setcontext3-shstk.out: $(..)sysdeps/unix/sysv/linux/x86/ $(objpfx)tst-setcontext3
+	$(SHELL) $< $(common-objpfx)stdlib/ $(READELF) > $@; \
+	$(evaluate-test)
 ifeq ($(enable-cet),yes)
 ifeq ($(subdir),elf)
 sysdep-dl-routines += dl-cet
diff --git a/sysdeps/unix/sysv/linux/x86/ b/sysdeps/unix/sysv/linux/x86/
new file mode 100644
index 0000000..9ce34eb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/
@@ -0,0 +1,35 @@
+# GCC bug:
+# Check that GNU_PROPERTY_X86_FEATURE_1_SHSTK isn't set when setcontext()
+# is used.
+# Copyright (C) 2017 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public
+# License along with the GNU C Library; if not, see
+# <>.
+set -e
+if $readelf -n $test | grep SHSTK; then
+  echo "FAIL: GNU_PROPERTY_X86_FEATURE_1_SHSTK is set on tst-setcontext3"
+  exit 1
+  echo "PASS: GNU_PROPERTY_X86_FEATURE_1_SHSTK isn't set on tst-setcontext3"
+  exit 0


Summary of changes:
 sysdeps/unix/sysv/linux/x86/Makefile               |    9 ++++++++
 .../unix/sysv/linux/x86/   |   22 +++++++++++++++----
 2 files changed, 26 insertions(+), 5 deletions(-)
 copy iconv/test-gconv-modules => sysdeps/unix/sysv/linux/x86/ (63%)

GNU C Library master sources

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]