From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 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 dcvr.yhbt.net (Postfix) with ESMTPS id 992E91F461 for ; Mon, 20 May 2019 13:47:55 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:from:to:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding:subject; q= dns; s=default; b=e7aBk0hfQEzHivAGr2VFouwHSMoMNVaFP/Y8lDDApW3cks A0sVNhHQ5Hrs3gne/inBGPqjZbrren4le70j/DuCweidYQoQbx9x2p+otADilC2k M49TEz1Sr9egwqJA1ifVlwhhKo6ab5dhXqwl7T8rwFdSyAWylj6WtK5WyMtBY= 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:message-id:from:to:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding:subject; s= default; bh=7tUwoKO0MDF61w8tpdbDrFdwNL4=; b=jfJUTzHtF4czatlq4msy NeX9+IzqkDcyVceLwWsXWKpuXP09msqlOHqzpnxpUFcylW/Ei5mWrYZpZ5Ir6H7P 4sI8iIA5SDd6h1/SLueQJOJgu8IIWAz8ZtJ+Fx5YFJKRulBNejClgHwUwmIIs10n jlmdya5JslYvflAsLm/y10c= Received: (qmail 125777 invoked by alias); 20 May 2019 13:47:52 -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 Received: (qmail 125768 invoked by uid 89); 20 May 2019 13:47:52 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: ou.quest-ce.net Message-ID: <889fe2c843d382d422cac8c68382fe92a3311123.camel@opteya.com> From: Yann Droneaud To: Florian Weimer , libc-alpha@sourceware.org Date: Mon, 20 May 2019 15:47:48 +0200 In-Reply-To: <87d0kdjliz.fsf@oldenburg2.str.redhat.com> References: <87d0kdjliz.fsf@oldenburg2.str.redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.2 (3.32.2-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a01:e35:39f2:1220:9dd7:c176:119b:4c9d X-SA-Exim-Mail-From: ydroneaud@opteya.com Subject: Re: [PATCH] libio: Remove codecvt vtable [BZ #24588] X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ou.quest-ce.net) Hi, Le lundi 20 mai 2019 à 15:36 +0200, Florian Weimer a écrit : > The codecvt vtable is not a real vtable because it also contains the > conversion state data. Furthermore, wide stream support was added to > GCC 3.0, after a C++ ABI bump, so there is no compatibility > requirement > with libstdc++. > > This change removes several unmangled function pointers which could > be used with a corrupted FILE object to redirect execution. (libio > vtable verification did not cover the codecvt vtable.) > > 2019-05-20 Florian Weimer > > [BZ #24588] > libio: Remove codecvt vtable. > * libio/fileops.c ( _IO_new_file_fopen): Do not copy > __libio_codecvt. > * libio/iofgetpos.c (_IO_new_fgetpos): Call > __libio_codecvt_encoding. > * libio/iofgetpos64.c (_IO_new_fgetpos): Likewise. > * libio/iofsetpos.c (_IO_new_fsetpos): Likewise. > * libio/iofsetpos64.c (_IO_new_fsetpos): Likewise. > * libio/iofwide.c (__libio_codecvt): Remove variable. > (_IO_fwide): Do not copy __libio_codecvt. > (__libio_codecvt_out): Rename from do_out and export. > (do_unshift): Remove function. > (__libio_codecvt_in): Rename from do_in and export. > (__libio_codecvt_encoding): Rename from do_encoding and export. > (do_always_noconv): Remove function. > (__libio_codecvt_length): Rename from do_length and export. > (do_max_length): Remove function. > * libio/libio.h (enum __codecvt_result): Remove definition; > moved > to libioP.h. > (struct _IO_codecvt): Remove fields __codecvt_destr, > __codecvt_do_out, __codecvt_do_unshift, __codecvt_do_in, > __codecvt_do_encoding, __codecvt_do_always_noconv, > __codecvt_do_length, __codecvt_do_max_length. > * libio/libioP.h (enum __codecvt_result): Define; moved from > libio.h. > (__libio_codecvt_out, __libio_codecvt_in) > (__libio_codecvt_encoding, __libio_codecvt_length): Declare > functions. > * libio/wfileops.c (_IO_wdo_write): Call __libio_codecvt_out. > (_IO_wfile_underflow): Call __libio_codecvt_in. > (_IO_wfile_underflow): Likewise. > (_IO_wfile_underflow_mmap): Likewise. > (_IO_wfile_sync): Call __libio_codecvt_encoding, > __libio_codecvt_length. > (adjust_wide_data): Call __libio_codecvt_encoding, > __libio_codecvt_in. > (do_ftell_wide): Call __libio_codecvt_length, > __libio_codecvt_out. > (_IO_wfile_seekoff): Call __libio_codecvt_encoding, > __libio_codecvt_length. > Reviewed-by: Yann Droneaud Regards -- Yann Droneaud OPTEYA