public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/release/2.25/master] libio: Disable vtable validation for pre-2.1 interposed handles [BZ #25203]
@ 2019-11-28 16:49 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2019-11-28 16:49 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a0408ec51ea862dda102482036c401d2e707e20b

commit a0408ec51ea862dda102482036c401d2e707e20b
Author: Florian Weimer <fweimer@redhat.com>
Date:   Fri Nov 22 22:10:42 2019 +0100

    libio: Disable vtable validation for pre-2.1 interposed handles [BZ #25203]
    
    Commit c402355dfa7807b8e0adb27c009135a7e2b9f1b0 ("libio: Disable
    vtable validation in case of interposition [BZ #23313]") only covered
    the interposable glibc 2.1 handles, in libio/stdfiles.c.  The
    parallel code in libio/oldstdfiles.c needs similar detection logic.
    
    Fixes (again) commit db3476aff19b75c4fdefbe65fcd5f0a90588ba51
    ("libio: Implement vtable verification [BZ #20191]").
    
    Change-Id: Ief6f9f17e91d1f7263421c56a7dc018f4f595c21
    (cherry picked from commit cb61630ed712d033f54295f776967532d3f4b46a)

Diff:
---
 libio/oldstdfiles.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libio/oldstdfiles.c b/libio/oldstdfiles.c
index bed7bce..82ba986 100644
--- a/libio/oldstdfiles.c
+++ b/libio/oldstdfiles.c
@@ -87,6 +87,11 @@ _IO_check_libio (void)
 	stdout->_vtable_offset = stderr->_vtable_offset =
 	((int) sizeof (struct _IO_FILE)
 	 - (int) sizeof (struct _IO_FILE_complete));
+
+      if (_IO_stdin_.vtable != &_IO_old_file_jumps
+	  || _IO_stdout_.vtable != &_IO_old_file_jumps
+	  || _IO_stderr_.vtable != &_IO_old_file_jumps)
+	IO_set_accept_foreign_vtables (&_IO_vtable_check);
     }
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-28 16:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-28 16:49 [glibc/release/2.25/master] libio: Disable vtable validation for pre-2.1 interposed handles [BZ #25203] Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).