Bug 437627

Summary: Check correctness of FORTIFY_SOURCE use
Product: [Fedora] Fedora Reporter: Jay Turner <jturner>
Component: rpmAssignee: Fedora Packaging Toolset Team <packaging-team>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: dberkholz, ffesti, lkundrak, pnasrat, srevivo, yersinia.spiros
Target Milestone: ---Keywords: FutureFeature, Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-20 10:38:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Check for incorrect FORTIFY_SOURCE use none

Description Lubomir Kundrak 2008-03-15 13:46:08 UTC
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.5 (3)
  130: 0000000000000000    144 FUNC    GLOBAL DEFAULT    UNDEF
sprintf.5 (3)
  282: 0000000000000000    144 FUNC    GLOBAL DEFAULT    UNDEF
fprintf.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.5 (3)
  130: 0000000000000000    144 FUNC    GLOBAL DEFAULT    UNDEF
sprintf.5 (3)
  282: 0000000000000000    144 FUNC    GLOBAL DEFAULT    UNDEF
fprintf.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 13:46:08 UTC
Created attachment 298147 [details]
Check for incorrect FORTIFY_SOURCE use

Comment 2 Bug Zapper 2008-05-14 06:05:33 UTC
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 23:46:55 UTC
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 14:34:02 UTC
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 23:12:53 UTC
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 23:14:11 UTC
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 10:38:54 UTC
This is ancient. Does anyone still care? Closing. Please reopen if you do.