sys-libs/glibc: switch -fstack-protector-all to -strong, bug #712356
authorSergei Trofimovich <slyfox@gentoo.org>
Sun, 15 Mar 2020 15:17:09 +0000 (15:17 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Sun, 15 Mar 2020 15:46:25 +0000 (15:46 +0000)
--enable-stack-protector=all adds protection to functions that don't
have a chance to corrupt stack. On top of that glibc's own tests fail
on static IFUNC resolver.

Let's use -fstack-protector-strong which matches Gentoo's gcc default.

Should fix at least the following test failures:
    FAIL: elf/ifuncmain9picstatic
    FAIL: elf/ifuncmain9static

Reported-by: Toralf Förster
Bug: https://bugs.gentoo.org/712356
Bug: https://sourceware.org/PR25680
Package-Manager: Portage-2.3.94, Repoman-2.3.20
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
sys-libs/glibc/glibc-2.31-r1.ebuild
sys-libs/glibc/glibc-9999.ebuild

index d303115a4a6d64774705a474f7a150b8d081c04f..00feda902bda172a6f063d85d35831a7ee98af16 100644 (file)
@@ -870,7 +870,11 @@ glibc_do_configure() {
                        myconf+=( --enable-stack-protector=no )
                        ;;
                *)
-                       myconf+=( --enable-stack-protector=$(usex ssp all no) )
+                       # Use '=strong' instead of '=all' to protect only functions
+                       # worth protecting from stack smashes.
+                       # '=all' is also known to have a problem in IFUNC resolution
+                       # tests: https://sourceware.org/PR25680, bug #712356.
+                       myconf+=( --enable-stack-protector=$(usex ssp strong no) )
                        ;;
        esac
        myconf+=( --enable-stackguard-randomization )
index 229af08f2ca8d2519885cb0a419279e63c9b19d9..b77e0177feb23072f2152306055b9d7f22f5ee44 100644 (file)
@@ -869,7 +869,11 @@ glibc_do_configure() {
                        myconf+=( --enable-stack-protector=no )
                        ;;
                *)
-                       myconf+=( --enable-stack-protector=$(usex ssp all no) )
+                       # Use '=strong' instead of '=all' to protect only functions
+                       # worth protecting from stack smashes.
+                       # '=all' is also known to have a problem in IFUNC resolution
+                       # tests: https://sourceware.org/PR25680, bug #712356.
+                       myconf+=( --enable-stack-protector=$(usex ssp strong no) )
                        ;;
        esac
        myconf+=( --enable-stackguard-randomization )