From a695425e46a89a879fbe290a4ffa162c2b4a20c9 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Thu, 18 May 2023 00:19:21 +0200 Subject: [PATCH] linux: manual-config: use a non-random path for $buildRoot Fixes reproducibility issues with x86/amd64 VDSO ELFs Build-IDs. The kernel build system tries pretty hard to not leak build file paths in its output. However, the embedded VDSO ELF files are built using slightly different build options that do not include the path mapping options that protect the rest of the kernel against this issue. This should be fixed upstream eventually, but a lot of this logic is duplicated across architecture, so I don't expect it will be a trivial fix. Instead, make our derivation use a fixed build root directory so this does not impact the build reproducibility. Fixes #227800. --- pkgs/os-specific/linux/kernel/manual-config.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 6d1ad766d684..4a623fda9bec 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -179,7 +179,8 @@ stdenv.mkDerivation ({ configurePhase = '' runHook preConfigure - export buildRoot=$(mktemp -d) + export buildRoot=$TMPDIR/kernel-buildroot + mkdir -p $buildRoot echo "manual-config configurePhase buildRoot=$buildRoot pwd=$PWD"