This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch hjl/cet/master updated. glibc-2.26.9000-957-g2ef49c4
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 8 Dec 2017 12:58:50 -0000
- Subject: 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 -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2ef49c4d72d96b5a1b589e0067c33b54df57a1eb
commit 2ef49c4d72d96b5a1b589e0067c33b54df57a1eb
Author: H.J. Lu <hjl.tools@gmail.com>
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:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81842
is fixed.
* sysdeps/unix/sysv/linux/x86/Makefile (tests-special): Add
$(objpfx)tst-setcontext3-shstk.out.
($(objpfx)tst-setcontext3-shstk.out): New target.
* sysdeps/unix/sysv/linux/x86/tst-setcontext3-shstk.sh: 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
endif
+ifeq ($(subdir),stdlib)
+# Check that GNU_PROPERTY_X86_FEATURE_1_SHSTK isn't set.
+tests-special += $(objpfx)tst-setcontext3-shstk.out
+endif
+
+$(objpfx)tst-setcontext3-shstk.out: $(..)sysdeps/unix/sysv/linux/x86/tst-setcontext3-shstk.sh $(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/tst-setcontext3-shstk.sh b/sysdeps/unix/sysv/linux/x86/tst-setcontext3-shstk.sh
new file mode 100644
index 0000000..9ce34eb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86/tst-setcontext3-shstk.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+# GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81842
+# 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
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# 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
+# <http://www.gnu.org/licenses/>.
+
+set -e
+
+objpfx=$1
+readelf=$2
+
+test="${objpfx}tst-setcontext3"
+
+if $readelf -n $test | grep SHSTK; then
+ echo "FAIL: GNU_PROPERTY_X86_FEATURE_1_SHSTK is set on tst-setcontext3"
+ exit 1
+else
+ echo "PASS: GNU_PROPERTY_X86_FEATURE_1_SHSTK isn't set on tst-setcontext3"
+ exit 0
+fi
-----------------------------------------------------------------------
Summary of changes:
sysdeps/unix/sysv/linux/x86/Makefile | 9 ++++++++
.../unix/sysv/linux/x86/tst-setcontext3-shstk.sh | 22 +++++++++++++++----
2 files changed, 26 insertions(+), 5 deletions(-)
copy iconv/test-gconv-modules => sysdeps/unix/sysv/linux/x86/tst-setcontext3-shstk.sh (63%)
hooks/post-receive
--
GNU C Library master sources