Bug 437627 - Check correctness of FORTIFY_SOURCE use
Summary: Check correctness of FORTIFY_SOURCE use
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Fedora Packaging Toolset Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-03-15 13:46 UTC by Jay Turner
Modified: 2015-03-20 10:38 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-20 10:38:54 UTC
Type: ---
Embargoed:


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

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.


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