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

Force positive stackprotector detection on x64 for Linux >=4.16 #42362

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions pkgs/os-specific/linux/kernel/force-stack-protector-x64.diff
@@ -0,0 +1,13 @@
--- linux/scripts/gcc-x86_64-has-stack-protector.sh.orig 2018-06-22 09:18:45.601691761 +0200
+++ linux/scripts/gcc-x86_64-has-stack-protector.sh 2018-06-22 09:18:53.084892998 +0200
@@ -1,9 +1,4 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
+echo y

-echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -O0 -mcmodel=kernel -fno-PIE -fstack-protector - -o - 2> /dev/null | grep -q "%gs"
-if [ "$?" -eq "0" ] ; then
- echo y
-else
- echo n
-fi
5 changes: 5 additions & 0 deletions pkgs/os-specific/linux/kernel/patches.nix
Expand Up @@ -38,6 +38,11 @@ rec {
patch = ./copperhead-4-16.patch;
};

force_stack_protector_x64 = rec {
name = "force-stack-protector";
patch = ./force-stack-protector-x64.diff;
};

# https://bugzilla.kernel.org/show_bug.cgi?id=197591#c6
iwlwifi_mvm_support_version_7_scan_req_umac_fw_command = rec {
name = "iwlwifi_mvm_support_version_7_scan_req_umac_fw_command";
Expand Down
6 changes: 3 additions & 3 deletions pkgs/os-specific/linux/zfs/default.nix
Expand Up @@ -157,7 +157,7 @@ in {
# to be adapted
zfsStable = common {
# comment/uncomment if breaking kernel versions are known
incompatibleKernelVersion = "4.16";
# incompatibleKernelVersion = "4.xx";

# this package should point to the latest release.
version = "0.7.9";
Expand All @@ -176,7 +176,7 @@ in {

zfsUnstable = common rec {
# comment/uncomment if breaking kernel versions are known
incompatibleKernelVersion = "4.16";
# incompatibleKernelVersion = "4.xx";

# this package should point to a version / git revision compatible with the latest kernel release
version = "2018-05-22";
Expand All @@ -199,7 +199,7 @@ in {
# also remove boot.zfs.enableLegacyCrypto
zfsLegacyCrypto = common {
# comment/uncomment if breaking kernel versions are known
incompatibleKernelVersion = "4.16";
# incompatibleKernelVersion = "4.xx";

# this package should point to a version / git revision compatible with the latest kernel release
version = "2018-02-01";
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -13616,6 +13616,7 @@ with pkgs;
# kernelPatches.cpu-cgroup-v2."4.11"
kernelPatches.modinst_arg_list_too_long
kernelPatches.bcm2835_mmal_v4l2_camera_driver # Only needed for 4.16!
kernelPatches.force_stack_protector_x64
];
};

Expand All @@ -13627,6 +13628,7 @@ with pkgs;
# kernelPatches.cpu-cgroup-v2."4.11"
kernelPatches.modinst_arg_list_too_long
kernelPatches.bcm2835_mmal_v4l2_camera_driver # Only needed for 4.16!
kernelPatches.force_stack_protector_x64
];
};

Expand Down