From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74438 invoked by alias); 28 Nov 2019 14:13:37 -0000 Mailing-List: contact glibc-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: glibc-cvs-owner@sourceware.org List-Subscribe: Received: (qmail 74384 invoked by uid 9299); 28 Nov 2019 14:13:37 -0000 Date: Thu, 28 Nov 2019 14:13:00 -0000 Message-ID: <20191128141337.74382.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc/release/2.28/master] libio: Disable vtable validation for pre-2.1 interposed handles [BZ #25203] X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/release/2.28/master X-Git-Oldrev: 7966ce07e89fa4ccc8fdba00d4439fc652862462 X-Git-Newrev: f55e312bcd6582b5ff68fdcc1781c7017796dc91 X-SW-Source: 2019-q4/txt/msg00485.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f55e312bcd6582b5ff68fdcc1781c7017796dc91 commit f55e312bcd6582b5ff68fdcc1781c7017796dc91 Author: Florian Weimer Date: Thu Nov 28 14:42:11 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: --- NEWS | 1 + libio/oldstdfiles.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/NEWS b/NEWS index 2a97ce5..74efb0e 100644 --- a/NEWS +++ b/NEWS @@ -69,6 +69,7 @@ The following bugs are resolved with this release: [24228] old x86 applications that use legacy libio crash on exit [24476] dlfcn: Guard __dlerror_main_freeres with __libc_once_get (once) [24744] io: Remove the copy_file_range emulation. + [25203] libio: Disable vtable validation for pre-2.1 interposed handles [25204] Ignore LD_PREFER_MAP_32BIT_EXEC for SUID programs Security related changes: diff --git a/libio/oldstdfiles.c b/libio/oldstdfiles.c index f3dda89..9fe809b 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); } }