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.26/master updated. glibc-2.26-166-g2781bd5
- From: fw at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 3 Jul 2018 16:26:30 -0000
- Subject: GNU C Library master sources branch release/2.26/master updated. glibc-2.26-166-g2781bd5
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.26/master has been updated
via 2781bd5a8690b5f1553b655f947a35f1d3dd23d0 (commit)
from 74d16a57a3615fcf05e5c60cb5a8f25e8acf38b9 (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=2781bd5a8690b5f1553b655f947a35f1d3dd23d0
commit 2781bd5a8690b5f1553b655f947a35f1d3dd23d0
Author: Florian Weimer <fweimer@redhat.com>
Date: Tue Jun 26 10:24:52 2018 +0200
libio: Disable vtable validation in case of interposition [BZ #23313]
(cherry picked from commit c402355dfa7807b8e0adb27c009135a7e2b9f1b0)
diff --git a/ChangeLog b/ChangeLog
index 7ecc33e..f1880eb 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.
+
2017-11-15 Steve Ellcey <sellcey@cavium.com>
[BZ #22442]
diff --git a/NEWS b/NEWS
index 48d28e1..5bcca53 100644
--- a/NEWS
+++ b/NEWS
@@ -144,6 +144,7 @@ The following bugs are resolved with this release:
[23171] Fix parameter type in C++ version of iseqsig
[23196] __mempcpy_avx512_no_vzeroupper mishandles large copies
[23236] Harden function pointers in _IO_str_fields
+ [23313] libio: Disable vtable validation in case of interposition
[23349] Various glibc headers no longer compatible with <linux/time.h>
Version 2.26
diff --git a/libio/vtables.c b/libio/vtables.c
index 41b48db..a11226a 100644
--- a/libio/vtables.c
+++ b/libio/vtables.c
@@ -70,3 +70,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