From patchwork Wed Nov 27 19:20:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Adhemerval Zanella (Code Review)" X-Patchwork-Id: 1201756 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-107450-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gnutoolchain-gerrit.osci.io Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="P53J33XB"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47NVwN2Fh7z9sRh for ; Thu, 28 Nov 2019 06:20:20 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; q=dns; s=default; b=MBasddnRSrbq/1/hyAeDKvwwY3NnBUu CIaQx8g8lpW43czz7pqRqjpHxcwUVIaVHKxRyiMxAA2/Akn7KNIxU1GQTgGtOkTF iJwg+4I9GFdO7747QegEV8Off8XYNF9Syinvc961/EeO6nLdrU07i9LUlzpH+1mA kaPZWX8bTn4U= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; s=default; bh=wb6fpOrC3igQS11GxHzknn7FUTc=; b=P53J3 3XBo+XSVdltaaF5TGRUzAVi8HSDBqvr8RfSGau7rJtrncph4il3S1QnAJWG04yhQ tkhswc+zhdKJzdDSf219Ftr7/IdSxsRDtTcfblsZqm1N/9w+zmg+cuHLUW3r+bIE mslimUJkopON4MnGgwOKmM476Q53ggJYpibmxQ= Received: (qmail 108265 invoked by alias); 27 Nov 2019 19:20:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 108255 invoked by uid 89); 27 Nov 2019 19:20:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: mx1.osci.io X-Gerrit-PatchSet: 2 Date: Wed, 27 Nov 2019 14:20:10 -0500 From: "Sourceware to Gerrit sync (Code Review)" To: Florian Weimer , libc-alpha@sourceware.org Cc: Carlos O'Donell Auto-Submitted: auto-generated X-Gerrit-MessageType: merged Subject: [pushed] libio: Disable vtable validation for pre-2.1 interposed handles [BZ #... X-Gerrit-Change-Id: Ief6f9f17e91d1f7263421c56a7dc018f4f595c21 X-Gerrit-Change-Number: 699 X-Gerrit-ChangeURL: X-Gerrit-Commit: cb61630ed712d033f54295f776967532d3f4b46a In-Reply-To: References: Reply-To: noreply@gnutoolchain-gerrit.osci.io, fweimer@redhat.com, libc-alpha@sourceware.org, carlos@redhat.com MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Message-Id: <20191127192010.417C020AF6@gnutoolchain-gerrit.osci.io> Sourceware to Gerrit sync has submitted this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/699 ...................................................................... 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 --- M libio/oldstdfiles.c 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Carlos O'Donell: Looks good to me, approved diff --git a/libio/oldstdfiles.c b/libio/oldstdfiles.c index bb1705b..95c041a 100644 --- a/libio/oldstdfiles.c +++ b/libio/oldstdfiles.c @@ -83,6 +83,11 @@ = 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); } }