Skip to content

Disable PIE hardening in more places#50295

Merged
matthewbauer merged 1 commit intoNixOS:stagingfrom
matthewbauer:pie
Nov 13, 2018
Merged

Disable PIE hardening in more places#50295
matthewbauer merged 1 commit intoNixOS:stagingfrom
matthewbauer:pie

Conversation

@matthewbauer
Copy link
Member

Motivation for this change

/cc @dtzWill

@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Nov 13, 2018
@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: libxml2

Partial log (click to expand)

/nix/store/sfvr5ib3yqyxj2vzr832in3dsihqsriy-libxml2-2.9.8-bin

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: libxml2

Partial log (click to expand)

/nix/store/h73hfs1kkr9r8zr8rgjzivdc2ff0azdq-libxml2-2.9.8-bin

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: libxml2

Partial log (click to expand)

these paths will be fetched (0.03 MiB download, 0.09 MiB unpacked):
  /nix/store/fy1lmal54cgkr714fv1iy3m5wprjks2h-libxml2-2.9.8-bin
copying path '/nix/store/fy1lmal54cgkr714fv1iy3m5wprjks2h-libxml2-2.9.8-bin' from 'https://cache.nixos.org'...
/nix/store/fy1lmal54cgkr714fv1iy3m5wprjks2h-libxml2-2.9.8-bin

Some packages don’t work correctly with pie. Here I disable it for:

- busybox
- linux kernel
- kexectools

I also get rid of the Musl conditional for disabling pie in GCC and
Binutils. Some day we might want to enable PIE without Musl and it
will be useful to have the *just* work with our compiler and linkers.
@matthewbauer matthewbauer changed the base branch from master to staging November 13, 2018 13:04
@GrahamcOfBorg GrahamcOfBorg added 6.topic: erlang General-purpose, concurrent, functional high-level programming language 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 6.topic: golang Go is a high-level general purpose programming language that is statically typed and compiled. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: ruby A dynamic, open source programming language with a focus on simplicity and productivity. 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 6.topic: stdenv Standard environment 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 8.has: clean-up This PR removes packages or removes other cruft 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. labels Nov 13, 2018
@GrahamcOfBorg GrahamcOfBorg removed 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 6.topic: erlang General-purpose, concurrent, functional high-level programming language 6.topic: fetch Fetchers (e.g. fetchgit, fetchsvn, ...) 6.topic: golang Go is a high-level general purpose programming language that is statically typed and compiled. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: ruby A dynamic, open source programming language with a focus on simplicity and productivity. 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 6.topic: stdenv Standard environment 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation labels Nov 13, 2018
@matthewbauer matthewbauer merged commit 79faee1 into NixOS:staging Nov 13, 2018
@zimbatm
Copy link
Member

zimbatm commented Nov 13, 2018

what is the motivation behind that change @matthewbauer ? Isn't PIE a good thing to have?

@matthewbauer
Copy link
Member Author

It doesn't work in many places. You will frequently get something along the lines of ld: -r and -pie may not be used together. Some packages will explicitly pass -nopie when they absolutely need to link relocatably. These packages that I put here don't have it though.

More info: https://wiki.ubuntu.com/SecurityTeam/PIE

@LnL7
Copy link
Member

LnL7 commented Nov 13, 2018

I had the same question, it's enabled for a reason so this seems kind of undesirable to me.

@dtzWill
Copy link
Member

dtzWill commented Nov 13, 2018 via email

@zimbatm
Copy link
Member

zimbatm commented Nov 13, 2018

Thanks for the update @dtzWill, makes sense! Without the context it looked like protections where casually removed but it's not the case.

@globin
Copy link
Member

globin commented Nov 14, 2018

Yes, just to clear this up, we have never had PIE being enabled by default. It was always opt-in. This was mostly done because this caused much more breakage than the other hardening flags, and even without this it was hard enough to get it in. :)

@matthewbauer matthewbauer deleted the pie branch February 22, 2019 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: clean-up This PR removes packages or removes other cruft 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants