[PATCH v2] addmntent: Remove unbounded alloca usage from getmntent [BZ#27083]
Florian Weimer
fweimer@redhat.com
Tue Dec 22 21:43:23 GMT 2020
* Szabolcs Nagy:
> The 12/22/2020 15:38, Siddhesh Poyarekar via Libc-alpha wrote:
>> The addmntent function replicates elements of struct mnt on stack
>> using alloca, which is unsafe. Put characters directly into the
>> stream, escaping them as they're being written out.
>>
>> Also add a test to check all escaped characters with addmntent and
>> getmntent.
>
> aarch64 buildbot fails because
>
> $ cat elf/check-localplt.out
> Extra PLT reference: libc.so: ferror
Looking at include/stdio.h, __ferror_unlocked should work instead and
avoid the PLT reference (it's either inlined, or results in a hidden
reference).
Thanks,
Florian
--
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
More information about the Libc-alpha
mailing list