From 6c302ef6256cff378b17b032db3d65542bbd5997 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 11 Nov 2022 13:55:16 +0100 Subject: [PATCH] redis: patch for CVE-2022-3647 https://nvd.nist.gov/vuln/detail/CVE-2022-3647 (cherry picked from commit c1135fc57de106496d14bfa4be1329741a705fa6) --- pkgs/servers/nosql/redis/default.nix | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/pkgs/servers/nosql/redis/default.nix b/pkgs/servers/nosql/redis/default.nix index 4943b10c2624..102574b63a0b 100644 --- a/pkgs/servers/nosql/redis/default.nix +++ b/pkgs/servers/nosql/redis/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchurl, lua, pkg-config, nixosTests -, tcl, which, ps +, tcl, which, ps, fetchpatch , withSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isStatic, systemd # dependency ordering is broken at the moment when building with openssl , tlsSupport ? !stdenv.hostPlatform.isStatic, openssl @@ -14,16 +14,14 @@ stdenv.mkDerivation rec { hash = "sha256-ZwVMw3tYwSXfk714AAJh7A70Q2omtA84Jix4DlYxXMM="; }; - # Cross-compiling fixes - configurePhase = '' - runHook preConfigure - ${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' - # This fixes hiredis, which has the AR awkwardly coded. - # Probably a good candidate for a patch upstream. - makeFlagsArray+=('STLIB_MAKE_CMD=${stdenv.cc.targetPrefix}ar rcs $(STLIBNAME)') - ''} - runHook postConfigure - ''; + patches = [ + # https://nvd.nist.gov/vuln/detail/CVE-2022-3647 + (fetchpatch { + name = "CVE-2022-3647.patch"; + url = "https://github.com/redis/redis/commit/0bf90d944313919eb8e63d3588bf63a367f020a3.patch"; + sha256 = "sha256-R5Tj/bHFTRnvWXiOYvRulqePzU5zvKbGfpO87TLfLWk="; + }) + ]; nativeBuildInputs = [ pkg-config ];