This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch release/2.27/master updated. glibc-2.27-67-g3bb7482
- From: fw at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 3 Jul 2018 16:12:06 -0000
- Subject: GNU C Library master sources branch release/2.27/master updated. glibc-2.27-67-g3bb7482
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, release/2.27/master has been updated
via 3bb748257405e94e13de76573a4e9da1cfd961d0 (commit)
from 4476d16b033341be5b0a884425cff19b0358ea25 (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=3bb748257405e94e13de76573a4e9da1cfd961d0
commit 3bb748257405e94e13de76573a4e9da1cfd961d0
Author: Florian Weimer <fweimer@redhat.com>
Date: Tue Jul 3 15:54:49 2018 +0200
libio: Disable vtable validation in case of interposition [BZ #23313]
(cherry picked from commit c402355dfa7807b8e0adb27c009135a7e2b9f1b0)
diff --git a/ChangeLog b/ChangeLog
index 40383d9..c096ba3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-26 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #23313]
+ * libio/vtables.c (check_stdfiles_vtables): New ELF constructor.
+
2018-06-29 Daniel Alvarez <dalvarez@redhat.com>
Jakub Sitnicki <jkbs@redhat.com>
diff --git a/NEWS b/NEWS
index 501d97b..7b38967 100644
--- a/NEWS
+++ b/NEWS
@@ -81,6 +81,7 @@ The following bugs are resolved with this release:
[23236] Harden function pointers in _IO_str_fields
[23259] Unsubstituted ${ORIGIN} remains in DT_NEEDED for AT_SECURE
[23264] libc: posix_spawnp wrongly executes ENOEXEC in non compat mode
+ [23313] libio: Disable vtable validation in case of interposition
[23349] Various glibc headers no longer compatible with <linux/time.h>
diff --git a/libio/vtables.c b/libio/vtables.c
index 9fd4ccf..9df7566 100644
--- a/libio/vtables.c
+++ b/libio/vtables.c
@@ -71,3 +71,19 @@ _IO_vtable_check (void)
__libc_fatal ("Fatal error: glibc detected an invalid stdio handle\n");
}
+
+/* Some variants of libstdc++ interpose _IO_2_1_stdin_ etc. and
+ install their own vtables directly, without calling _IO_init or
+ other functions. Detect this by looking at the vtables values
+ during startup, and disable vtable validation in this case. */
+#ifdef SHARED
+__attribute__ ((constructor))
+static void
+check_stdfiles_vtables (void)
+{
+ if (_IO_2_1_stdin_.vtable != &_IO_file_jumps
+ || _IO_2_1_stdout_.vtable != &_IO_file_jumps
+ || _IO_2_1_stderr_.vtable != &_IO_file_jumps)
+ IO_set_accept_foreign_vtables (&_IO_vtable_check);
+}
+#endif
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 5 +++++
NEWS | 1 +
libio/vtables.c | 16 ++++++++++++++++
3 files changed, 22 insertions(+), 0 deletions(-)
hooks/post-receive
--
GNU C Library master sources