git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #21118 from grahamc/fix-rsa-build-failure

linux_{4_8,grsec_nixos}: patch to fix build failure

commit01d022e16b0ec28cf531d6280781248238a2eda1 authorGraham Christensen <graham@grahamc.com> dateTue 13 Dec 2016, 09:15 (10 years ago) parentd918c807a813d3
3 files changed+53
pkgs/os-specific/linux/kernel/multithreaded-rsapubkey-asn1.patch+45 pkgs/os-specific/linux/kernel/patches.nix+6 pkgs/top-level/all-packages.nix+2
pkgs/os-specific/linux/kernel/multithreaded-rsapubkey-asn1.patchnew file+45
@@ -0,0 +1,45 @@
1+
2+From Yang Shi <>
3+Subject [PATCH] crypto: rsa - fix a potential race condition in build
4+Date Fri, 2 Dec 2016 15:41:04 -0800
5+
6+
7+When building kernel with RSA enabled with multithreaded, the below
8+compile failure might be caught:
9+
10+| /buildarea/kernel-source/crypto/rsa_helper.c:18:28: fatal error: rsapubkey-asn1.h: No such file or directory
11+| #include "rsapubkey-asn1.h"
12+| ^
13+| compilation terminated.
14+| CC crypto/rsa-pkcs1pad.o
15+| CC crypto/algboss.o
16+| CC crypto/testmgr.o
17+| make[3]: *** [/buildarea/kernel-source/scripts/Makefile.build:289: crypto/rsa_helper.o] Error 1
18+| make[3]: *** Waiting for unfinished jobs....
19+| make[2]: *** [/buildarea/kernel-source/Makefile:969: crypto] Error 2
20+| make[1]: *** [Makefile:150: sub-make] Error 2
21+| make: *** [Makefile:24: __sub-make] Error 2
22+
23+The header file is not generated before rsa_helper is compiled, so
24+adding dependency to avoid such issue.
25+
26+Signed-off-by: Yang Shi <yang.shi@windriver.com>
27+
28+---
29+ crypto/Makefile | 1 +
30+ 1 file changed, 1 insertion(+)
31+
32+diff --git a/crypto/Makefile b/crypto/Makefile
33+index 99cc64a..8db39f9 100644
34+--- a/crypto/Makefile
35++++ b/crypto/Makefile
36+@@ -40,6 +40,7 @@ obj-$(CONFIG_CRYPTO_ECDH) += ecdh_generic.o
37+
38+ $(obj)/rsapubkey-asn1.o: $(obj)/rsapubkey-asn1.c $(obj)/rsapubkey-asn1.h
39+ $(obj)/rsaprivkey-asn1.o: $(obj)/rsaprivkey-asn1.c $(obj)/rsaprivkey-asn1.h
40++$(obj)/rsa_helper.o: $(obj)/rsa_helper.c $(obj)/rsaprivkey-asn1.h
41+ clean-files += rsapubkey-asn1.c rsapubkey-asn1.h
42+ clean-files += rsaprivkey-asn1.c rsaprivkey-asn1.h
43+
44+--
45+2.0.2
pkgs/os-specific/linux/kernel/patches.nix+6
@@ -41,6 +41,12 @@ in
4141
4242rec {
4343
44+ multithreaded_rsapubkey =
45+ {
46+ name = "multithreaded-rsapubkey-asn1.patch";
47+ patch = ./multithreaded-rsapubkey-asn1.patch;
48+ };
49+
4450 bridge_stp_helper =
4551 { name = "bridge-stp-helper";
4652 patch = ./bridge-stp-helper.patch;
pkgs/top-level/all-packages.nix+2
@@ -11010,6 +11010,7 @@ in
1101011010 linux_4_8 = callPackage ../os-specific/linux/kernel/linux-4.8.nix {
1101111011 kernelPatches =
1101211012 [ kernelPatches.bridge_stp_helper
11013+ kernelPatches.multithreaded_rsapubkey
1101311014 # See pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/README.md
1101411015 # when adding a new linux version
1101511016 # !!! 4.7 patch doesn't apply, 4.8 patch not up yet, will keep checking
@@ -11233,6 +11234,7 @@ in
1123311234 inherit (lib) overrideDerivation;
1123411235 kernel = callPackage ../os-specific/linux/kernel/linux-grsecurity.nix {
1123511236 kernelPatches = with self.kernelPatches; [
11237+ kernelPatches.multithreaded_rsapubkey
1123611238 bridge_stp_helper
1123711239 modinst_arg_list_too_long
1123811240 ] ++ lib.optionals ((platform.kernelArch or null) == "mips")