unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ng0 <ng0@n0.is>
To: Alex Vong <alexvong1995@gmail.com>
Cc: guix-devel@gnu.org, ng0@n0.is
Subject: Re: hardening
Date: Sun, 11 Mar 2018 13:37:32 +0000	[thread overview]
Message-ID: <20180311133732.ojqacszx2mckvdim@abyayala> (raw)
In-Reply-To: <871si6w76r.fsf@gmail.com>

Alex Vong transcribed 1.3K bytes:
> Hello,
> 
> ng0@n0.is writes:
> 
> > Hi,
> >
> > as we've long talked and not really taken action on hardening builds
> > I've started working on an opt-in way as last discussed in
> > september 2016, modifying the gnu-build-system with a
> > #:hardening-flags keyword.
> >
> > For my testing purposes I will use
> >
> >> CFLAGS="-fPIE -fstack-protector-all -D_FORTIFY_SOURCE=2"
> > LDFLAGS="-Wl,-z,now -Wl,-z,relro"
> >
> > which is used by Gentoo, but adjustments (wether to opt-in or
> > opt-out) will be made.
> 
> The flags I use (suggested by Debian Wiki[0]) are:
> 
>   CPPFLAGS=-D_FORTIFY_SOURCE=2

How does this differ from "-O2 -D_FORTIFY_SOURCE" in CFLAGS?
I know O2 is optimization and that FORTIFY_SOURCE requires optimization
to be specified.

>   CFLAGS=-fstack-protector-strong
>   CXXFLAGS=-fstack-protector-strong
>   LDFLAGS=-Wl,-z,relro,-z,now,--as-needed

What are your opinions about:
 -pipe -fPIE -fstack-shuffle -fstack-protector-all

> Also, should we use retpoline flags for all native binaries? This
> article[1] suggests ``applying a software mitigation (e.g., Google's
> Retpoline) to the hypervisor, operating system kernel, system programs
> and libraries, and user applications''. I've sent a patch to do so when
> bootstraping GCC 7 itself[2] but no reply are received yet (maybe I
> should have open a new bug instead of changing the title of an old
> bug).
> 
> [0]: https://wiki.debian.org/Hardening
> [1]: https://security.googleblog.com/2018/01/more-details-about-mitigations-for-cpu_4.html
> [2]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30111
> 

-- 
A88C8ADD129828D7EAC02E52E22F9BBFEE348588
https://n0.is

  reply	other threads:[~2018-03-11 13:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-29 12:44 hardening ng0
2018-01-29 19:21 ` hardening Joshua Branson
2018-01-29 20:55   ` hardening ng0
2018-01-31 12:20 ` hardening Alex Vong
2018-03-11 13:37   ` ng0 [this message]
2018-03-11 13:40     ` hardening ng0
2018-03-11 14:04       ` hardening Ricardo Wurmus
2018-03-11 14:36         ` hardening ng0
2018-03-22 13:16           ` hardening ng0
  -- strict thread matches above, loose matches on Subject: below --
2017-01-24 11:19 tor: update to 0.2.9.9 contact.ng0
2017-01-24 19:07 ` Leo Famulari
2017-01-24 20:56   ` Hardening (was: Re: tor: update to 0.2.9.9) ng0
2017-01-24 21:02     ` Leo Famulari
2017-01-24 21:09       ` ng0
2017-01-24 21:18         ` ng0
2017-01-24 21:32           ` Leo Famulari
2017-01-24 21:56             ` ng0
2017-01-25 13:04               ` Hardening Ludovic Courtès
2017-01-30 12:05                 ` Hardening ng0
2017-01-30 12:16                   ` Hardening ng0
2017-01-25  9:09       ` Hardening (was: Re: tor: update to 0.2.9.9) Ricardo Wurmus
2017-01-25 11:51         ` Hardening ng0
2015-10-31 13:56 [PATCH 1/2] Add (guix build build-flags) Alex Vong
2015-11-05 21:55 ` Ludovic Courtès
2015-12-25 15:38   ` Alex Vong
2015-12-30 16:06     ` Hardening Ludovic Courtès
2016-08-16 23:57       ` Hardening Leo Famulari
2016-08-17  6:49         ` Hardening Ricardo Wurmus
2016-08-17 13:48           ` Hardening Alex Vong
2016-08-17 20:28             ` Hardening ng0
2016-08-19  9:30               ` Hardening ng0
2016-08-20 16:45               ` Hardening Alex Vong
2016-09-02 13:08         ` Hardening Ludovic Courtès
2016-09-03 11:34           ` Hardening ng0

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180311133732.ojqacszx2mckvdim@abyayala \
    --to=ng0@n0.is \
    --cc=alexvong1995@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).