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. #42654

Merged
merged 1 commit into from Jun 27, 2018

Conversation

clefru
Copy link
Contributor

@clefru clefru commented Jun 27, 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.

(cherry picked from commit 43a737b)

Motivation for this change

#39225

Things done

Running this on my 4.16 machine for two days.

  • 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 (look inside nixos/tests)
  • 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.

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.

(cherry picked from commit 43a737b)
@Mic92
Copy link
Member

Mic92 commented Jun 27, 2018

@GrahamcOfBorg build kernelPackages.zfs

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: kernelPackages.zfs

Partial log (click to expand)

Cannot nix-instantiate `kernelPackages.zfs' because:
�[31;1merror:�[0m attribute 'kernelPackages' in selection path 'kernelPackages.zfs' not found

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: kernelPackages.zfs

Partial log (click to expand)

Cannot nix-instantiate `kernelPackages.zfs' because:
error: attribute 'kernelPackages' in selection path 'kernelPackages.zfs' not found

@GrahamcOfBorg
Copy link

No attempt on x86_64-linux (full log)

The following builds were skipped because they don't evaluate on x86_64-linux: kernelPackages.zfs

Partial log (click to expand)

Cannot nix-instantiate `kernelPackages.zfs' because:
error: attribute 'kernelPackages' in selection path 'kernelPackages.zfs' not found

@Mic92
Copy link
Member

Mic92 commented Jun 27, 2018

@GrahamcOfBorg build linuxPackages.zfs

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: linuxPackages.zfs

Partial log (click to expand)

�[31;1merror:�[0m while evaluating the attribute 'zfsStable' at �[1m/private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/os-specific/linux/zfs/default.nix�[0m:149:3:
while evaluating 'common' at �[1m/private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/os-specific/linux/zfs/default.nix�[0m:18:12, called from �[1m/private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/os-specific/linux/zfs/default.nix�[0m:149:15:
while evaluating the attribute 'linux_4_14' at �[1m/private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/top-level/all-packages.nix�[0m:13312:3:
while evaluating 'callPackageWith' at �[1m/private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix�[0m:113:35, called from �[1m/private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/top-level/all-packages.nix�[0m:13312:16:
while evaluating 'makeOverridable' at �[1m/private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix�[0m:72:24, called from �[1m/private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix�[0m:117:8:
while evaluating anonymous function at �[1m/private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/os-specific/linux/kernel/linux-4.14.nix�[0m:1:1, called from �[1m/private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix�[0m:74:12:
while evaluating 'makeOverridable' at �[1m/private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix�[0m:72:24, called from �[1m/private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/os-specific/linux/kernel/linux-4.14.nix�[0m:5:1:
while evaluating anonymous function at �[1m/private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/os-specific/linux/kernel/generic.nix�[0m:9:1, called from �[1m/private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix�[0m:74:12:
assertion failed at �[1m/private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/os-specific/linux/kernel/generic.nix�[0m:41:1

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: linuxPackages.zfs

Partial log (click to expand)

 /nix/store/cb3slv3szhp46xkrczqw7mscy5mnk64l-coreutils-8.29/bin/install -c -m 644 zfs.release zfs_config.h module/Module.symvers '/nix/store/b7zkw6nm6vdmj43b0hdh54p4v2xjszn0-zfs-kernel-0.7.9-4.14.52/zfs-0.7.9/4.14.52'
make[2]: Leaving directory '/build/source'
make[1]: Leaving directory '/build/source'
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/b7zkw6nm6vdmj43b0hdh54p4v2xjszn0-zfs-kernel-0.7.9-4.14.52
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/b7zkw6nm6vdmj43b0hdh54p4v2xjszn0-zfs-kernel-0.7.9-4.14.52/lib  /nix/store/b7zkw6nm6vdmj43b0hdh54p4v2xjszn0-zfs-kernel-0.7.9-4.14.52/libexec
patching script interpreter paths in /nix/store/b7zkw6nm6vdmj43b0hdh54p4v2xjszn0-zfs-kernel-0.7.9-4.14.52
checking for references to /build in /nix/store/b7zkw6nm6vdmj43b0hdh54p4v2xjszn0-zfs-kernel-0.7.9-4.14.52...
/nix/store/b7zkw6nm6vdmj43b0hdh54p4v2xjszn0-zfs-kernel-0.7.9-4.14.52

@Mic92 Mic92 merged commit a4e1e9c into NixOS:release-18.03 Jun 27, 2018
@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: linuxPackages.zfs

Partial log (click to expand)

 /nix/store/dlrcrmmby0nxr7xwm01yqvbhw8ld068j-coreutils-8.29/bin/install -c -m 644 zfs.release zfs_config.h module/Module.symvers '/nix/store/0sjwmg190b85b9pj3w5q13bs9dyaasgw-zfs-kernel-0.7.9-4.14.52/zfs-0.7.9/4.14.52'
make[2]: Leaving directory '/build/source'
make[1]: Leaving directory '/build/source'
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/0sjwmg190b85b9pj3w5q13bs9dyaasgw-zfs-kernel-0.7.9-4.14.52
strip is /nix/store/ppn001bfygzlqx4h50n9zgxc3kqv2d6k-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/0sjwmg190b85b9pj3w5q13bs9dyaasgw-zfs-kernel-0.7.9-4.14.52/lib  /nix/store/0sjwmg190b85b9pj3w5q13bs9dyaasgw-zfs-kernel-0.7.9-4.14.52/libexec
patching script interpreter paths in /nix/store/0sjwmg190b85b9pj3w5q13bs9dyaasgw-zfs-kernel-0.7.9-4.14.52
checking for references to /build in /nix/store/0sjwmg190b85b9pj3w5q13bs9dyaasgw-zfs-kernel-0.7.9-4.14.52...
/nix/store/0sjwmg190b85b9pj3w5q13bs9dyaasgw-zfs-kernel-0.7.9-4.14.52

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

3 participants