Bug 437627 - Check correctness of FORTIFY_SOURCE use
Check correctness of FORTIFY_SOURCE use
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Fedora Packaging Toolset Team
Fedora Extras Quality Assurance
: FutureFeature, Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-15 09:46 EDT by Jay Turner
Modified: 2015-03-20 06:38 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-20 06:38:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Check for incorrect FORTIFY_SOURCE use (2.27 KB, text/plain)
2008-03-15 09:46 EDT, Lubomir Kundrak
no flags Details

  None (edit)
Description Lubomir Kundrak 2008-03-15 09:46:08 EDT
Description of problem:

From time to time a package comes up that doesn't use %{_optflags} correctly. It
would be nice to detect it at build time (as it can have security consequences).

See bug #437331 for an example.

Expected results:

On a faulty package, this generates output like this, hopefully maintainer would
spot that:

...

WARNING: File
/usr/lib/jvm/java-1.7.0-icedtea-1.7.0.0.x86_64/jre/lib/amd64/xawt/libmawt.so
uses these possibly unsafe symbols:
   11: 0000000000000000    162 FUNC    GLOBAL DEFAULT    UNDEF
printf@GLIBC_2.2.5 (3)
  130: 0000000000000000    144 FUNC    GLOBAL DEFAULT    UNDEF
sprintf@GLIBC_2.2.5 (3)
  282: 0000000000000000    144 FUNC    GLOBAL DEFAULT    UNDEF
fprintf@GLIBC_2.2.5 (3)

WARNING: File
/usr/lib/jvm/java-1.7.0-icedtea-1.7.0.0.x86_64/jre/lib/amd64/xawt/libmawt.so
uses these possibly unsafe symbols:
   11: 0000000000000000    162 FUNC    GLOBAL DEFAULT    UNDEF
printf@GLIBC_2.2.5 (3)
  130: 0000000000000000    144 FUNC    GLOBAL DEFAULT    UNDEF
sprintf@GLIBC_2.2.5 (3)
  282: 0000000000000000    144 FUNC    GLOBAL DEFAULT    UNDEF
fprintf@GLIBC_2.2.5 (3)

***************************************************************************

The above warnings might indicate that FORTIFY_SOURCE is not used correctly

Possible causes:
 1.) %optflags are not passed to the compiler
 2.) Source files don't include the relevant headers

***************************************************************************

Additional info:

If this can not be enabled by default, at least the script should be shipped
with rpm-build, similarly to check-rpaths, and can be made default in
rpmdevtools generated rpmmacros, by including in __os_install_post or
__arch_install_post.

Apart from cases where optflags are not passed, this also complains on cases
where *printf calls were not replaced with functions that check the arguments
(length for buffer overflow protection, and whether format string containing
"%n" is in read only memory for format string attack protection). This happens
when people use *printf, but not unclude <stdio.h> -- maintainers should fix the
code as this is insecure.

See the attachment for the script.
Comment 1 Lubomir Kundrak 2008-03-15 09:46:08 EDT
Created attachment 298147 [details]
Check for incorrect FORTIFY_SOURCE use
Comment 2 Bug Zapper 2008-05-14 02:05:33 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 4 Bug Zapper 2009-06-09 19:46:55 EDT
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 5 Bug Zapper 2009-07-14 10:34:02 EDT
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 6 Fedora Admin XMLRPC Client 2012-04-13 19:12:53 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 7 Fedora Admin XMLRPC Client 2012-04-13 19:14:11 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 9 Florian Festi 2015-03-20 06:38:54 EDT
This is ancient. Does anyone still care? Closing. Please reopen if you do.

Note You need to log in before you can comment on or make changes to this bug.