Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 318171 - [TRACKER] Merge SSP and >=gcc 4.4 hardened to the tree.
Summary: [TRACKER] Merge SSP and >=gcc 4.4 hardened to the tree.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL: http://forums.gentoo.org/viewtopic-t-...
Whiteboard:
Keywords: Tracker
Depends on: 106690 149292 293721 305283
Blocks: 324743
  Show dependency tree
 
Reported: 2010-05-02 16:05 UTC by Magnus Granberg
Modified: 2017-01-19 18:47 UTC (History)
4 users (show)

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


Attachments
Needed change for SSP and >=gcc 4.4 hardened support. (toolchain.eclass.patch,8.65 KB, patch)
2010-05-02 16:30 UTC, Magnus Granberg
Details | Diff
The needed specs files to enable SSP in gcc 4.3.4 (gcc-4.3.4-specs-0.9.5.tar.bz2,1.65 KB, application/octet-stream)
2010-05-02 16:53 UTC, Magnus Granberg
Details
The needed pie patchset for gcc 4.4.3 (gcc-4.4.3-piepatches-v0.4.1.tar.bz2,17.57 KB, application/octet-stream)
2010-05-02 16:57 UTC, Magnus Granberg
Details
the needed specs files for gcc 4.4.3 (gcc-4.4.3-specs-0.1.8.tar.bz2,1.95 KB, application/octet-stream)
2010-05-02 16:59 UTC, Magnus Granberg
Details
Needed change for SSP with gcc 4.3.4 and >=gcc 4.4 hardened support. (toolchain.eclass.patch,8.75 KB, patch)
2010-05-02 22:14 UTC, Magnus Granberg
Details | Diff
Needed change for >=gcc 4.4 hardened support. (toolchain.eclass.patch,7.36 KB, patch)
2010-05-14 17:13 UTC, Magnus Granberg
Details | Diff
Needed change for >=gcc 4.4 hardened support. (toolchain.eclass.patch,7.65 KB, patch)
2010-05-15 12:27 UTC, Magnus Granberg
Details | Diff
Patch to fix the gcc 4.X SSP build errors (common.eblit.patch,713 bytes, patch)
2010-05-26 21:16 UTC, Magnus Granberg
Details | Diff
Needed change for >=gcc 4.4 and SSP hardened support. (toolchain.eclass.patch,9.75 KB, patch)
2010-05-26 21:24 UTC, Magnus Granberg
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Granberg gentoo-dev 2010-05-02 16:05:41 UTC
This tracker is for mergeing SSP and >=gcc 4.4 with hardened support to the tree.
Comment 1 Magnus Granberg gentoo-dev 2010-05-02 16:08:05 UTC
Bug #293721 have the needed pathces for flag-o-matic or glibc.
Comment 2 Magnus Granberg gentoo-dev 2010-05-02 16:15:23 UTC
We need a bump of grub with that fix in the tree to enable SSP on >gcc 4.X
Comment 3 Magnus Granberg gentoo-dev 2010-05-02 16:19:40 UTC
(In reply to comment #2)
> We need a bump of grub with that fix in the tree to enable SSP on >gcc 4.X
> 
Bug #305283
Comment 4 Magnus Granberg gentoo-dev 2010-05-02 16:30:00 UTC
Created attachment 230049 [details, diff]
Needed change for SSP and >=gcc 4.4 hardened support.

This patch is needed for toolchain.eclass for add SSP and >=gcc 4.4 hardened support
Comment 5 Magnus Granberg gentoo-dev 2010-05-02 16:53:06 UTC
Created attachment 230063 [details]
The needed specs files to enable SSP in gcc 4.3.4

This specs files will enable SSP for gcc 4.3.4
Comment 6 Magnus Granberg gentoo-dev 2010-05-02 16:57:07 UTC
Created attachment 230065 [details]
The needed pie patchset for gcc 4.4.3

This is the hardened patchset for gcc 4.4.3
Comment 7 Magnus Granberg gentoo-dev 2010-05-02 16:59:52 UTC
Created attachment 230067 [details]
the needed specs files for gcc 4.4.3

This specs files is for the gcc-config options in 4.4.3
hardenednopiessp, hardenednopie, hardenednossp and vanilla
Comment 8 Magnus Granberg gentoo-dev 2010-05-02 19:20:28 UTC
Bug #106690 will be WONTFIX.
Comment 9 Magnus Granberg gentoo-dev 2010-05-02 21:07:16 UTC
Will not add any ssp support to uclibc for some arch need TLS support in uclibc. And that patch to fix it don't work on some arch so i will wait for TLS support in uclibc to enable SSP in uclibc. But if toolchain want to add the fix fill free to put it in the uclibc patchset for gcc or any fix that fix it.
gcc4-stack-protector-uclibc_no_tls.patch
The fix for stack smashing attack in function ix86_split_to_parts() is in the
pie patchset allready.
Bug #149292
Comment 10 Magnus Granberg gentoo-dev 2010-05-02 21:14:58 UTC
(In reply to comment #8)
> Bug #106690 will be WONTFIX.
> 
We don't use any split specs for default gcc and the pie patchset on >gcc 4.x don't support it. So that lines should be removed from the ebuilds.
Comment 11 Magnus Granberg gentoo-dev 2010-05-02 22:14:30 UTC
Created attachment 230089 [details, diff]
Needed change for SSP with gcc 4.3.4 and >=gcc 4.4 hardened support.

Updatef with a fix so we don't unpack piepatchset if we have USE -hardened nopie.
Comment 12 Magnus Granberg gentoo-dev 2010-05-02 22:20:26 UTC
@ toolchain can you review the toolchain.eclass change and what to use for the glibc bug #293721 fix in glibc or fix in flag-o-matic.
Comment 13 SpanKY gentoo-dev 2010-05-10 02:49:54 UTC
how are you guys dealing with SSP in <=gcc-3.4 ?  is that no longer supported ?  i dont have a problem culling all of the code related to those versions ... it would make things simpler i think.
Comment 14 Magnus Granberg gentoo-dev 2010-05-10 19:19:26 UTC
(In reply to comment #13)
> how are you guys dealing with SSP in <=gcc-3.4 ?  is that no longer supported ?
>  i dont have a problem culling all of the code related to those versions ... it
> would make things simpler i think.
> 
The GCC <= 3.4 SSP/PIE should work as it does now in the code. I have avoided and try to stay out of that code as it predates me. The old code does have some problems for example if you do -nopie the pie patch would not be unpack and all the defines for SSP/PIE would be gone and the code in make_gcc_hard() does not work as it should, and was even broken in the part for GCC 4.X (wantminispecs) and -nopie. Have fix that for the GCC 4.X and added the needed code for adding SSP support for GCC 4.x. On the piepatch for >=GCC 4.4 we use built-in hardened specs and only use specs files for gcc-config options.
Comment 15 Magnus Granberg gentoo-dev 2010-05-14 17:13:52 UTC
Created attachment 231461 [details, diff]
Needed change for >=gcc 4.4 hardened support.

Cleaned some code and removed SSP support for gcc 4.3.X for
Gcc 4.4.3 is going stable.
Comment 16 Magnus Granberg gentoo-dev 2010-05-15 02:19:21 UTC
All this stuff is in the hardened-dev overlay
http://git.overlays.gentoo.org/gitroot/proj/hardened-dev.git
The piepatches and the specs is in the hardened-gccpatchset overlay
http://git.overlays.gentoo.org/gitroot/proj/hardened-gccpatchset.git
Tested with USE-flags hardened -hardened vanilla -nopie -nossp gcj fortran
GCC versions 3.4.6/4.3.4/4.4.3/4.4.4/4.5.0
Deves/Users may have tested with more stuff.
Forum tread see URL.
Comment 17 Magnus Granberg gentoo-dev 2010-05-15 12:27:14 UTC
Created attachment 231555 [details, diff]
Needed change for >=gcc 4.4 hardened support.

The last did have a error for want_minispecs with ${WORKDIR}"/specs/*.specs
This fix is needed if we want 4.3.x SSP support.
@@ -713,7 +727,12 @@
 		if hardened_gcc_works pie ; then
 			cat "${WORKDIR}"/specs/pie.specs >> "${WORKDIR}"/build.specs
 		fi
-		for s in nostrict znow; do
+		if hardened_gcc_works ssp ; then
+			for s in ssp sspall ; do
+				cat "${WORKDIR}"/specs/${s}.specs >> "${WORKDIR}"/build.specs
+			done
+		fi
+		for s in nostrict znow ; do
 			cat "${WORKDIR}"/specs/${s}.specs >> "${WORKDIR}"/build.specs
 		done
 		export GCC_SPECS="${WORKDIR}"/build.specs
Comment 18 Magnus Granberg gentoo-dev 2010-05-26 21:16:26 UTC
Created attachment 233051 [details, diff]
Patch to fix the gcc 4.X SSP build errors 

@toolchain is this patch okey for glibc see more in #293721
Comment 19 Magnus Granberg gentoo-dev 2010-05-26 21:24:09 UTC
Created attachment 233053 [details, diff]
Needed change for >=gcc 4.4 and SSP hardened support.

Updated the toolchain.eclass so it use more of the GCC 3.x code.
Comment 20 Magnus Granberg gentoo-dev 2010-05-30 01:06:26 UTC
(In reply to comment #13)
> how are you guys dealing with SSP in <=gcc-3.4 ?  is that no longer supported ?
>  i dont have a problem culling all of the code related to those versions ... it
> would make things simpler i think.
> 
If i got it correct you are willing to drop hardened support for gcc <=3.4?
Then we need to make it in steps or do we start from a new and clean toolchainX.eclass file and work from there?


Comment 21 Magnus Granberg gentoo-dev 2010-06-02 22:54:05 UTC
Do the last toolchain.eclass patch looks okey for commite to the tree?
Before we even can mask or remove code for <=gcc 3.4 we need 
>=gcc 4.4 hardened ssp/pie full supported and stable in the tree and the packages that depend on <=gcc 3.4 fixed or masked.
Comment 22 Mark Loeser (RETIRED) gentoo-dev 2010-06-12 23:44:56 UTC
Mike,

Could you check these over as well?

They look alright to me, but you know the eclass a hell of a lot better.

Magnus,

If we don't get a response in a day or so, go ahead and commit.
Comment 23 Magnus Granberg gentoo-dev 2010-06-18 01:07:28 UTC
Have commited the glibc fix and toolchain.eclass to cvs
Comment 24 Magnus Granberg gentoo-dev 2010-06-19 02:16:47 UTC
Have commited the ebuild and the files to mirrors so now it is only grub left
before unmasking
Comment 25 Magnus Granberg gentoo-dev 2010-06-25 09:33:10 UTC
GCC 4.4.X with SSP support is in the tree and all deps to.