public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@redhat.com>
To: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>,
	libc-alpha@sourceware.org, Florian Weimer <fweimer@redhat.com>
Subject: Re: [PATCH v3 2/4] libio: Remove the usage of __libc_IO_vtables
Date: Mon, 27 Mar 2023 08:53:48 -0400	[thread overview]
Message-ID: <f6a5777b-9640-6876-77b2-d5700d5b3ed2@redhat.com> (raw)
In-Reply-To: <558d7aa8-85cb-72a1-1d84-184ecb8d5328@linaro.org>

On 3/6/23 08:43, Adhemerval Zanella Netto wrote:
> 
> 
> On 04/03/23 14:37, Carlos O'Donell wrote:
>> On 12/27/22 16:11, Adhemerval Zanella via Libc-alpha wrote:
>>> Instead of using a special ELF section along with a linker script
>>> directive to put the IO vtables within the RELRO section, the libio
>>> vtables are iall moved to an array marked as data.relro (so linker
>>
>> s/iall/all/g
>>
>>> will place in the RELRO segment without the need of extra directives).
>>>
>>> To avoid static linking namespace issues and to pulling all vtables
>>
>> s/to pulling/including/g
>> s/vtables/vtable/g
>>
>>> referenced objects, all required function pointers are set to weak alias.
>>>
>>
>> Have you tested this against legacy applications that interpose the vtables?
>>
>> In the original design Florian wrote:
>> ~~~
>>     To enable backwards compatibility, a special flag variable
>>     (_IO_accept_foreign_vtables), protected by the pointer guard, avoids
>>     process termination if libio stream object constructor functions have
>>     been called earlier.  Such constructor functions are called by the GCC
>>     2.95 libstdc++ library, and this mechanism ensures compatibility with
>>     old binaries.  Existing callers inside glibc of these functions are
>>     adjusted to call the original functions, not the wrappers which enable
>>     vtable compatiblity.
>>     
>>     The compatibility mechanism is used to enable passing FILE * objects
>>     across a static dlopen boundary, too.
>> ~~~
> 
> I have not, but we do have tests for these (which was added after the
> vtable hardening with 29055464a03c72762969a2e8734d0d05d4d70e58).  My
> understanding is it should cover the required interface for old binaries.

Agreed, that should cover the testing requirements, thanks for reviewing the existing
tests and seeing which apply to my request. That's something I should have done in more
detail as reviewer. Thank you for that.

It also meant I re-read the whole thread on "adding compat symbols requires testing old
behaviour" which was an interesting consensus discussion. I think we have achieved that
with Florian's new tests that were part of the bug 23313 fixes.

-- 
Cheers,
Carlos.


  reply	other threads:[~2023-03-27 12:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-27 21:11 [PATCH v3 0/4] Remove --with-default-link option Adhemerval Zanella
2022-12-27 21:11 ` [PATCH v3 1/4] Move libc_freeres_ptrs and libc_subfreeres to hidden/weak functions Adhemerval Zanella
2023-03-04 17:37   ` Carlos O'Donell
2022-12-27 21:11 ` [PATCH v3 2/4] libio: Remove the usage of __libc_IO_vtables Adhemerval Zanella
2023-03-04 17:37   ` Carlos O'Donell
2023-03-06 13:43     ` Adhemerval Zanella Netto
2023-03-27 12:53       ` Carlos O'Donell [this message]
2023-03-06 14:58   ` Arsen Arsenović
2023-03-06 16:01     ` Adhemerval Zanella Netto
2023-03-06 16:31       ` Andreas Schwab
2023-03-06 16:39         ` Adhemerval Zanella Netto
2023-03-06 16:53           ` Andreas Schwab
2023-03-06 17:24             ` Adhemerval Zanella Netto
2023-03-06 18:17               ` Adhemerval Zanella Netto
2023-03-06 18:47                 ` Arsen Arsenović
2023-03-06 18:53                   ` Adhemerval Zanella Netto
2023-03-06 19:10                     ` Arsen Arsenović
2023-03-06 19:20                       ` Adhemerval Zanella Netto
2023-03-06 19:26                         ` Arsen Arsenović
2023-03-06 16:23     ` Andreas Schwab
2022-12-27 21:11 ` [PATCH v3 3/4] Remove --with-default-link configure option Adhemerval Zanella
2023-03-04 17:39   ` Carlos O'Donell
2022-12-27 21:11 ` [PATCH v3 4/4] Remove set-hooks.h from generic includes Adhemerval Zanella
2023-03-04 17:42   ` Carlos O'Donell
2023-03-04 17:37 ` [PATCH v3 0/4] Remove --with-default-link option Carlos O'Donell
2023-03-06 13:43   ` Adhemerval Zanella Netto

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=f6a5777b-9640-6876-77b2-d5700d5b3ed2@redhat.com \
    --to=carlos@redhat.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --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).