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 v4 0/3] Fix {recv,send}{m}msg standard compliance (BZ#16919)



On 08/06/2016 16:45, Florian Weimer wrote:
> On 06/08/2016 05:57 PM, Mike Frysinger wrote:
>> On 08 Jun 2016 12:37, Joseph Myers wrote:
>>> On Wed, 8 Jun 2016, Florian Weimer wrote:
>>>> This patchset breaks various network emulation libraries because applications
>>>> use the new struct msghdr definition, yet dlsym (RTLD_NEXT, "recvmsg") picks
>>>> the compat implementation.
>>>
>>> That seems like bug 14932.  I think dlsym should return the current
>>> version.  See previous discussions Apr-Jun 2013.
>>
>> agreed
> 
> Yes, it seems all of you are right.
> 
> So what's the short-term way forward here?
> 
> Remove the compat symbol and perform the additional zeroing unconditionally?
> 
> Even in the long temr, I'm not sure if we can fix RTLD_NEXT if there is just one unversioned symbol interposing multiple versioned symbols.  I simply don't see a way it can be done.  The interposing library would need more information about what's going on (data which should already be available to audit modules).
> 
> Thanks,
> Florian
> 
> 

This is the same issue in GCC BZ#71445 [1] comments and currently we can either
remove the compat symbol or make the interposition using symbol versions.

If we decide to to remove the compat symbol I believe the only change in 
libsanitizer or any interpose library would to be just assume recvmsg to 
follow POSIX struct definition (in libsanitizer case to check the internal
structure accesses using socklen_t instead of size_t).

If we decide to still continue to provide the compat symbol, a way to interpose
the calls would to add interpose versions. This has the drawback that the 
interposed library would need to know the provided version for each symbols 
and they might differ for each architecture. This is the path I am implementing 
to fix libsanitizer.

I do not have a strong opinion if we should or not provide compat symbols for
these symbols. I see that to trigger the compat usage, the program would need
to send a lot of data (>2GB) on a single syscall, which I think is really
unlikely and I presume there is no real case usage.  Not providing the
compat symbol also is the easier way to fix interpose libraries.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71445


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