[PATCH] Linux: Add fortify wrapper for getdents64
Florian Weimer
fweimer@redhat.com
Tue Jun 18 14:38:00 GMT 2019
* Adhemerval Zanella:
>> +ssize_t
>> +__getdents64_chk (int fd, void *dst, size_t len, size_t dstlen)
>> +{
>> + if (__glibc_unlikely (dstlen < len))
>> + __chk_fail ();
>> + return __getdents64 (fd, dst, len);
>> +}
>
> __chk_fail is exported in libc ABI, wouldn't be better to just inline it
> and avoid a new symbol?
None of the existing wrappers do this. The advantage of not inling is
that you can look at a coredump and see __getdents64_chk in libc.so.6 in
the stack trace, even with (application) debugging symbols available.
Thanks,
Florian
More information about the Libc-alpha
mailing list