This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] libio: Disable vtable validation in case of interposition [BZ #23313]


* Florian Weimer:

> * Szabolcs Nagy:
>
>> the check looks ok to me
>> i think hidden symbol alias would work too
>>
>> return &_IO_2_1_stdin == &_IO_2_1_stdin_internal_alias || ...;
>>
>> and it may be a bit nicer than checking the section.. i'm not sure
>
> I had hoped that GCC would combine the comparisons in some way, but it
> doesn't do that either way.
>
> The hidden alias approach also has the advantage that it does not
> touch the _IO_MTSAFE_IO code.
>
>
> 2018-06-19  Florian Weimer  <fweimer@redhat.com>
>
> 	[BZ #23313]
> 	* libio/libioP.h [SHARED] (_IO_2_1_stdin_hidden)
> 	(_IO_2_1_stdout_hidden, _IO_2_1_stderr_hidden): Declare.
> 	* libio/stdfiles.c [SHARED] (_IO_2_1_stdin_hidden)
> 	(_IO_2_1_stdout_hidden, _IO_2_1_stderr_hidden): Define aliases.
> 	* libio/vtables.c (stdfiles_interposed): New function.
> 	(_IO_vtable_check): Call it.

This seems to be overly conservative.  I think we do not actually have
to care about interposition.  We should read the vtables in the
libc.so startup code and check if they match the values in stdfiles.c.
This way, vtable validation is not disabled if there is merely a copy
relocation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]