[PATCH v3] Fix FORTIFY_SOURCE false positive
Florian Weimer
fweimer@redhat.com
Thu Feb 13 13:17:01 GMT 2025
* Volker Weißmann:
> Shall I implement it or is there anyone else who wants to do that?
Arjun has expressed in this. He could help you along and review your
changes.
Our downstream issue is:
glibc: Reduce likelihood of spurious %n failure in printf
<https://issues.redhat.com/browse/RHEL-79064>
(It's worded from an older glibc perspective. We might want upstream
issue for the SUID hardening regression, too.)
There, I proposed the following approach:
* Use _dl_find_object to get the link map
* Iterate over the LOAD segments to find a matching read-only segment.
* If it is read-write, also check the RELRO area.
* Do the link map access from a new function in the dynamic linker, not
libc, to limit layout dependencies.
* Process termination should be handled from within libc.
* If we cannot find a link map, proceed as before with
/proc/self/maps. But if opening or reading fails, write a different,
new error message using __libc_fatal.
Thanks,
Florian
More information about the Libc-alpha
mailing list