From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id DNIWGYNCrWCwcAEAgWs5BA (envelope-from ) for ; Tue, 25 May 2021 20:31:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id CHUUFINCrWA3DAAAbx9fmQ (envelope-from ) for ; Tue, 25 May 2021 18:31:31 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 341221A173 for ; Tue, 25 May 2021 20:31:30 +0200 (CEST) Received: from localhost ([::1]:57140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llbpx-00076N-5B for larch@yhetil.org; Tue, 25 May 2021 14:31:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llbjl-0007f7-2h for guix-patches@gnu.org; Tue, 25 May 2021 14:25:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35188) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1llbji-0007x2-96 for guix-patches@gnu.org; Tue, 25 May 2021 14:25:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1llbji-0008Ku-67 for guix-patches@gnu.org; Tue, 25 May 2021 14:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48656] [PATCH] gnu: lz4: Add a patch for CVE-2021-3520. Resent-From: Solene Rapenne Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 25 May 2021 18:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48656 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48656@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162196706931998 (code B ref -1); Tue, 25 May 2021 18:25:01 +0000 Received: (at submit) by debbugs.gnu.org; 25 May 2021 18:24:29 +0000 Received: from localhost ([127.0.0.1]:46734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llbjB-0008K2-DQ for submit@debbugs.gnu.org; Tue, 25 May 2021 14:24:29 -0400 Received: from lists.gnu.org ([209.51.188.17]:60800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llbj7-0008Jr-Qe for submit@debbugs.gnu.org; Tue, 25 May 2021 14:24:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llbj7-00070L-B3 for guix-patches@gnu.org; Tue, 25 May 2021 14:24:25 -0400 Received: from perso.pw ([163.172.223.238]:17711) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llbj5-0007gp-41 for guix-patches@gnu.org; Tue, 25 May 2021 14:24:25 -0400 Received: from perso.pw (localhost [127.0.0.1]) by perso.pw (OpenSMTPD) with ESMTP id 694815d8 for ; Tue, 25 May 2021 20:24:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=perso.pw; h=date:from:to :subject:message-id:mime-version:content-type :content-transfer-encoding; s=1337; bh=dNy+jjGmGe+VR1TsY24mVSgjH lQ=; b=pAwOpf+PKL+9SbFi1JBxrPPboPb3TPnCcq6l8gZjbuGDAeE1B1R/reCtV Y2J2S4mLLwJlWIMus0lapxG4NT/fT7oazzuuvp8K7f8OD+w7krp8cJu8gfkgbVmB NjeBTEbWBb/LRGxd0Ds9FwuJAqQNAOUpu613hiXo7GlPpumBMI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=perso.pw; h=date:from:to :subject:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=1337; b=MjemXaWE8ffyWqt5Z+l stIomTsjmg7p3OdCwltXrYC/1V67Iq323KKnlm7QcVs5NJzp9k1lOooBvT59GMh6 lJY4JQZlz9txlq6h12/zSQ4YPBa/hQH/nSJgodY3zx/jkaw75/AdMAxnV0/tjjjO APxt4xJd84uaIhwIkKsqMTuw= Received: from localhost (176-154-164-34.abo.bbox.fr [176.154.164.34]) by perso.pw (OpenSMTPD) with ESMTPSA id 9266ae62 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Tue, 25 May 2021 20:24:09 +0200 (CEST) Date: Tue, 25 May 2021 20:24:07 +0200 Message-ID: <20210525202407.383e1713@perso.pw> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=163.172.223.238; envelope-from=solene@perso.pw; helo=perso.pw X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Solene Rapenne X-ACL-Warn: , Solene Rapenne via Guix-patches From: Solene Rapenne via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621967490; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=FVfco31GZVF+9dSMAiv8XXi1Wg4z4gb0xBKiJ+iGZy0=; b=GAo+7E5GwRT8k6HV6K272oHWklCip5XzrzWEEjTezDoorA4hd6UuvgrFNKfqIyksIhj+Zi UzZqv8YWqlDxlYjmV9MbZpE0qIqjyOs1auw/WSgQ/72oIHSapDACDisdZJ/qMvI1gPMJvM 4igvOVv+9PyQYy1WMVHFun/qFJCI3QRvvEX3FInMtAPLODYU6DI5WCyfLLREo91WRnRpDa dibU4Djy77TWZs3Th0a2/syyTL/VFcZUptSQ5vemPQfhgR1/y0Lpu8h3+US5zXYwh/EAht wZv3eim50zH7G5aZQ+sA54Etcs9zTFz3oJo5eOPffyIzn+OwfrUXNkjURGlt6w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621967490; a=rsa-sha256; cv=none; b=OKGGMCMvfHcQ9NiffP2/TIhBfvW9Bkxq+ylxCVlPQF54T150rdfb+h8SrAh4Clf1Gp0+py FqD0NUjo9GA6qGpUto7FjHwZvEd20PH1OGxdoP56JDvooFEz00IOotNOA80uVsnNp4Lmsm /MIAer3XbGIBv8N8j4DllqLAH1ZjR9YYKk40e8A7jBwzRTuvkdMgVR882/Yv9U+zeVhHVt vzJZjSkDi5q0wY4cvrStm/BbagNhQP3MgUFC58d6/U5xKCyJeo4Qa2Yzm3MALxlYduVrcR cU6jio2orShbXKuRd4fJOLmxifePgbMoAzI93cUWJnPQ9caF4O52jdmrwfmVkQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=perso.pw header.s=1337 header.b=pAwOpf+P; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -1.43 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=perso.pw header.s=1337 header.b=pAwOpf+P; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 341221A173 X-Spam-Score: -1.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: hX2wDPYHrsAT This imports a patch that is not committed upstream yet but pending for merge on github https://github.com/lz4/lz4/commit/8301a21773ef61656225e264f4f06ae14462bca7 This is already widely used in many distributions distributing lz4 --- gnu/packages/compression.scm | 7 +++++-- gnu/packages/patches/lz4-CVE-2021-3520.patch | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/lz4-CVE-2021-3520.patch diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index 64816a30c0..53ab999151 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -33,6 +33,7 @@ ;;; Copyright =C2=A9 2021 Antoine C=C3=B4t=C3=A9 ;;; Copyright =C2=A9 2021 Vincent Legoll ;;; Copyright =C2=A9 2021 Simon Tournier +;;; Copyright =C2=A9 2021 Solene Rapenne ;;; ;;; This file is part of GNU Guix. ;;; @@ -810,15 +811,17 @@ decompression of some loosely related file formats us= ed by Microsoft.") (commit (string-append "v" version)))) (sha256 (base32 "1w02kazh1fps3sji2sn89fz862j1199c5ajrqcgl1bnlxj09kcbz")) + (patches + (search-patches "lz4-CVE-2021-3520.patch")) (file-name (git-file-name name version)))) (build-system gnu-build-system) (outputs (list "out" "static")) (native-inputs - `(;; For tests. + `( ;; For tests. ("python" ,python) ("valgrind" ,valgrind))) (arguments - `(;; Not designed for parallel testing. + `( ;; Not designed for parallel testing. ;; See https://github.com/lz4/lz4/issues/957#issuecomment-737419821 #:parallel-tests? #f #:test-target "test" diff --git a/gnu/packages/patches/lz4-CVE-2021-3520.patch b/gnu/packages/pa= tches/lz4-CVE-2021-3520.patch new file mode 100644 index 0000000000..100baa4758 --- /dev/null +++ b/gnu/packages/patches/lz4-CVE-2021-3520.patch @@ -0,0 +1,15 @@ +Not merged patch fixing CVE-2021-3520 +https://github.com/lz4/lz4/commit/8301a21773ef61656225e264f4f06ae14462bca7 + +Index: b/lib/lz4.c +--- a/lib/lz4.c.orig ++++ b/lib/lz4.c +@@ -1749,7 +1749,7 @@ LZ4_decompress_generic( + const size_t dictSize /* note : =3D 0 if noDict = */ + ) + { +- if (src =3D=3D NULL) { return -1; } ++ if ((src =3D=3D NULL) || (outputSize < 0)) { return -1; } +=20 + { const BYTE* ip =3D (const BYTE*) src; + const BYTE* const iend =3D ip + srcSize; --=20 2.31.1