Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 847148 - [Tracker] Failures with FORTIFY_SOURCE=3
Summary: [Tracker] Failures with FORTIFY_SOURCE=3
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://developers.redhat.com/blog/20...
Whiteboard:
Keywords: Tracker
Depends on: 854324 854327 873745 841770 847145 847280 847295 847892 849587 850157 852974 854315 854318 854321 876625 882295
Blocks:
  Show dependency tree
 
Reported: 2022-05-23 22:34 UTC by Sam James
Modified: 2022-11-28 00:15 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fortify-source-3.patch (file_847148.txt,397 bytes, patch)
2022-05-29 06:05 UTC, Sam James
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-23 22:34:52 UTC
Needs GCC 12+ or Clang 9+.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-29 06:05:34 UTC
To reproduce bugs, you need at least -O2 (IIRC > -O0 might work, needs inlining at least, but use -O2 please or higher), GCC 12+, or Clang 9+ (but we're mostly using GCC here).

You also need (feel free to change -O2, as above):
CFLAGS="-O2 -D_FORTIFY_SOURCE=3"
CXXFLAGS="-O2 -D_FORTIFY_SOURCE=3"

I instead patch GCC because it's easier.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-29 06:05:45 UTC
Created attachment 781316 [details, diff]
fortify-source-3.patch
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-29 06:06:02 UTC
(In reply to Sam James from comment #2)
> Created attachment 781316 [details, diff] [details, diff]
> fortify-source-3.patch

Place at /etc/portage/patches/sys-devel/gcc:12/fortify-source-3.patch.