public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	libc-alpha@sourceware.org
Subject: Maintaining libio (was: Re: [PATCH v2 1/2] libio: Multiple fixes for open_{w}memstram (BZ#18241 and BZ#20181))
Date: Wed, 19 Apr 2017 09:17:00 -0000	[thread overview]
Message-ID: <a94ed40e-3965-6880-9218-93adf1247c55@redhat.com> (raw)
In-Reply-To: <1470688986-8798-1-git-send-email-adhemerval.zanella@linaro.org>

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 <libio.h>.  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

  parent reply	other threads:[~2017-04-19  9:17 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-05 17:41 [PATCH 1/2] libio: Multiple fixes for open_{w}memstram (BZ#18241 and BZ#20181) Adhemerval Zanella
2016-08-05 17:41 ` [PATCH 2/2] libio: Fix seek-past-end returned size for open_{w}memstream (BZ#15298) Adhemerval Zanella
2016-08-26 10:15   ` Florian Weimer
2016-08-29 14:43     ` Adhemerval Zanella
2016-08-05 20:11 ` [PATCH 1/2] libio: Multiple fixes for open_{w}memstram (BZ#18241 and BZ#20181) Andreas Schwab
2016-08-05 21:00   ` Adhemerval Zanella
2016-08-08 20:43 ` [PATCH v2 " Adhemerval Zanella
2016-08-08 20:43   ` [PATCH v2 2/2] libio: Fix seek-past-end returned size for open_{w}memstream (BZ#15298) Adhemerval Zanella
2016-08-25 19:53     ` Adhemerval Zanella
2016-08-25 19:53   ` [PATCH v2 1/2] libio: Multiple fixes for open_{w}memstram (BZ#18241 and BZ#20181) Adhemerval Zanella
2016-09-30  0:06     ` Adhemerval Zanella
2016-09-30 10:12   ` Andreas Schwab
2016-10-01  9:17   ` Andreas Schwab
2016-10-02 13:29     ` Adhemerval Zanella
2017-04-19  9:17   ` Florian Weimer [this message]
2017-04-19 12:35     ` Maintaining libio (was: Re: [PATCH v2 1/2] libio: Multiple fixes for open_{w}memstram (BZ#18241 and BZ#20181)) Dmitry V. Levin
2017-04-19 12:52       ` Zack Weinberg
2017-04-19 13:03         ` Dmitry V. Levin
2017-04-19 13:01       ` Maintaining libio Florian Weimer
2017-04-19 13:17         ` Dmitry V. Levin
2017-04-19 13:23           ` Florian Weimer
2017-04-19 12:52     ` Maintaining libio (was: Re: [PATCH v2 1/2] libio: Multiple fixes for open_{w}memstram (BZ#18241 and BZ#20181)) Zack Weinberg
2017-04-19 14:48     ` Maintaining libio Adhemerval Zanella
2017-04-19 15:02       ` Florian Weimer
2017-04-19 15:17         ` Adhemerval Zanella
2017-04-20 15:44     ` Maintaining libio (was: Re: [PATCH v2 1/2] libio: Multiple fixes for open_{w}memstram (BZ#18241 and BZ#20181)) Zack Weinberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a94ed40e-3965-6880-9218-93adf1247c55@redhat.com \
    --to=fweimer@redhat.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).