0b0d35
commit cb61630ed712d033f54295f776967532d3f4b46a
0b0d35
Author: Florian Weimer <fweimer@redhat.com>
0b0d35
Date:   Fri Nov 22 22:10:42 2019 +0100
0b0d35
0b0d35
    libio: Disable vtable validation for pre-2.1 interposed handles [BZ #25203]
0b0d35
    
0b0d35
    Commit c402355dfa7807b8e0adb27c009135a7e2b9f1b0 ("libio: Disable
0b0d35
    vtable validation in case of interposition [BZ #23313]") only covered
0b0d35
    the interposable glibc 2.1 handles, in libio/stdfiles.c.  The
0b0d35
    parallel code in libio/oldstdfiles.c needs similar detection logic.
0b0d35
    
0b0d35
    Fixes (again) commit db3476aff19b75c4fdefbe65fcd5f0a90588ba51
0b0d35
    ("libio: Implement vtable verification [BZ #20191]").
0b0d35
    
0b0d35
    Change-Id: Ief6f9f17e91d1f7263421c56a7dc018f4f595c21
0b0d35
0b0d35
diff --git a/libio/oldstdfiles.c b/libio/oldstdfiles.c
0b0d35
index 870cb0536c52024f..54d3e354fcbf257e 100644
0b0d35
--- a/libio/oldstdfiles.c
0b0d35
+++ b/libio/oldstdfiles.c
0b0d35
@@ -87,6 +87,11 @@ _IO_check_libio (void)
0b0d35
 	stdout->_vtable_offset = stderr->_vtable_offset =
0b0d35
 	((int) sizeof (struct _IO_FILE)
0b0d35
 	 - (int) sizeof (struct _IO_FILE_complete));
0b0d35
+
0b0d35
+      if (_IO_stdin_.vtable != &_IO_old_file_jumps
0b0d35
+	  || _IO_stdout_.vtable != &_IO_old_file_jumps
0b0d35
+	  || _IO_stderr_.vtable != &_IO_old_file_jumps)
0b0d35
+	IO_set_accept_foreign_vtables (&_IO_vtable_check);
0b0d35
     }
0b0d35
 }
0b0d35