Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionStefan Cornelius
2012-07-06 09:23:00 UTC
Description of problem:
Huzaifa S. Sidhpurwala of SRT noticed that some functions using formatted printing (e.g. "warn()", "err()", and "warnx()") are not protected by the fortify source format string protection. The relevant functions were never meant to be protected by fortify source, so from a security point of view, this is an enhancement only. Since fixing this would break the ABI, we need to work with upstream to see if a protection for these functions can be included in future versions.
Description from the original bug #836931:
While looking into some format string issue, i found that the warn() function does not seem to be protected by the glibc FORTIFY_SOURCE Format string protection mechanism.
Here is a simple example to prove my point:
[huzaifas@babylon ~]$ cat warn1.c
#include <stdio.h>
#include <err.h>
void main(int argc, char *argv[])
{
warn(argv[1]);
//printf(argv[1]);
}
[huzaifas@babylon ~]$ gcc -O -g -D_FORTIFY_SOURCE=2 -o warn warn1.c
[huzaifas@babylon ~]$ cat print.c
#include <stdio.h>
#include <err.h>
void main(int argc, char *argv[])
{
//warn(argv[1]);
printf(argv[1]);
}
[huzaifas@babylon ~]$ gcc -O -g -D_FORTIFY_SOURCE=2 -o print print.c
[huzaifas@babylon ~]$ ./warn "%100s%n"
warn: ?▮�: Segmentation fault
[huzaifas@babylon ~]$ ./print "%100s%n"
*** %n in writable segment detected ***
L�|�Aborted
[huzaifas@babylon ~]$
It might be interesting to do an audit and see if anything is actually using those functions. I'd be a bit surprised given they're really outside the standard and better functions exist within the standard to handle this stuf
Jeff
This request is due https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2012-1151 where we had to fix a format string flaw in a RHEL package because of the lack of warn() fortification and ended up having to do an impact=important RHSA
Thanks Mark. Amazing to find code using these bogus interfaces.
Any thoughts on doing an audit of the RHEL packages & libraries for other instances that are using these bogus interfaces? In theory, it's just "nm" piped to "grep" across everything in RHEL.
Jeff
Comment 12RHEL Program Management
2013-09-06 17:26:18 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.