Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable fortify and stackprotector hardening for spl/zfs. #42430

Merged
merged 1 commit into from Jun 25, 2018

Conversation

clefru
Copy link
Contributor

@clefru clefru commented Jun 23, 2018

Linux 4.16 introduces a stackprotector detection script that returns
different results for the kernel compilation run and the spl/zfs
compilation run, as the setting for hardening are different. This
results in a broken ABI between spl/zfs and the compiled kernel,
breaking ZFS. Also disabling the fortify and stackprotector hardening,
as we do for the kernel, fixes that.

Motivation for this change

#39225

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change:
    nix-build -A stable nixos/tests/zfs.nix
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@clefru
Copy link
Contributor Author

clefru commented Jun 23, 2018

@Mic92 Please have a look.

I think that we should not allow different gcc hardening settings for out-of-tree module compilations and for the kernel. I would have this setting passed through from the kernel derivation so that we can ensure that the ABI matches with the module. This is something for a followup PR, probably going through all the packages in "linuxPackagesFor".

@NeQuissimus
Copy link
Member

This works with Linux 4.16.17 and ZFS on my system.

Linux 4.16 introduces a stackprotector detection script that returns
different results for the kernel compilation run and the spl/zfs
compilation run, as the setting for hardening are different. This
results in a broken ABI between spl/zfs and the compiled kernel,
breaking ZFS. Also disabling the fortify and stackprotector hardening,
as we do for the kernel, fixes that.
@clefru clefru force-pushed the zfs-v4.16-hardening-adjust branch from 0c86bb4 to 758dc06 Compare June 25, 2018 09:17
@clefru
Copy link
Contributor Author

clefru commented Jun 25, 2018

While "master" seems not to care, cherry-picking into release-18.03 doesn't give working spl/zfs modules unless I also disable the "fortify" hardening for the spl/zfs compilation branch.

I updated the PR with that, so we cherry-pick into 18.03

@clefru clefru changed the title Disable hardening the stackprotector for spl/zfs. Disable fortify and stackprotector hardening for spl/zfs. Jun 25, 2018
@globin globin merged commit 43a737b into NixOS:master Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants