From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25947 invoked by alias); 19 Apr 2017 09:17:26 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 25896 invoked by uid 89); 19 Apr 2017 09:17:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=20181, Hx-languages-length:1643 X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 53B52C04BD39 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 53B52C04BD39 Subject: Maintaining libio (was: Re: [PATCH v2 1/2] libio: Multiple fixes for open_{w}memstram (BZ#18241 and BZ#20181)) To: Adhemerval Zanella , libc-alpha@sourceware.org References: <1470418850-22175-1-git-send-email-adhemerval.zanella@linaro.org> <1470688986-8798-1-git-send-email-adhemerval.zanella@linaro.org> From: Florian Weimer Message-ID: Date: Wed, 19 Apr 2017 09:17:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <1470688986-8798-1-git-send-email-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-04/txt/msg00356.txt.bz2 On 08/08/2016 10:43 PM, Adhemerval Zanella wrote: > @@ -239,14 +254,14 @@ _IO_str_seekoff (_IO_FILE *fp, _IO_off64_t offset, int dir, int mode) > if (mode == 0 && (fp->_flags & _IO_TIED_PUT_GET)) > mode = (fp->_flags & _IO_CURRENTLY_PUTTING ? _IOS_OUTPUT : _IOS_INPUT); > > + bool was_writing = (fp->_IO_write_ptr > fp->_IO_write_base > + || _IO_in_put_mode (fp)); > + if (was_writing) > + _IO_str_switch_to_get_mode (fp); This patch breaks backwards compatibility with applications which call _IO_str_seekoff directly. This is an exported function and it was originally intended as a building block for building custom streams, so we cannot change what it does just to fit glibc's internal needs, based on how the function is called from within glibc. But if we apply this standard of backwards compatibility, we cannot make *any* changes to libio (including important security hardening) without copying most of the code first. We have no tests which check the extended API behavior, and the interface is very much under-documented, too. What should we do here? I'm leaning towards a clean break: Stop installing . Remove all symbols related to external vtable support (i.e., an ABI break, so that affected programs fail in a clean manner). Do this now, and revisit it for glibc 2.27 if someone actually has an application that breaks due to this. For the old inlined putc_unlocked implementation which directly poked at struct _IO_FILE, I suggest we write tests and keep compatibility. Comments? Thanks, Florian