]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
libio: Disable vtable validation for pre-2.1 interposed handles [BZ #25203]
authorFlorian Weimer <fweimer@redhat.com>
Thu, 28 Nov 2019 13:18:12 +0000 (14:18 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 28 Nov 2019 13:18:12 +0000 (14:18 +0100)
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)

NEWS
libio/oldstdfiles.c

diff --git a/NEWS b/NEWS
index b0d2167a601bfc29537253dea19aeebeccbf79bd..1f60f3eb197699e0ede2535aa77ab69c815b2a7f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,7 @@ The following bugs are resolved with this release:
   [24986] alpha: new getegid, geteuid and getppid syscalls used
     unconditionally
   [25189] Don't use a custom wrapper macro around __has_include
+  [25203] libio: Disable vtable validation for pre-2.1 interposed handles
   [25204] Ignore LD_PREFER_MAP_32BIT_EXEC for SUID programs
 
 \f
index 2b861cd754986831e2d49a7ccb98a35e6501e729..7503cdd62dfd502c1de6704dc675fcf62673fe9c 100644 (file)
@@ -83,6 +83,11 @@ _IO_check_libio (void)
        = 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);
     }
 }