diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2021-12-08 12:41:55 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2021-12-08 12:50:11 +0100 |
commit | 798f3ef0cd900a1fd5935c3a2ce1fe8b27ec3862 (patch) | |
tree | 6b3a48557d4be585f3997d5cd82f4e47aece8812 | |
parent | 5ecb2181ec78690c0e56c21b29b8804a73f4f606 (diff) |
main/lz4: backport fix for CVE-2021-3520
ref: https://github.com/lz4/lz4/pull/972
-rw-r--r-- | main/lz4/APKBUILD | 11 | ||||
-rw-r--r-- | main/lz4/CVE-2021-3520.patch | 22 |
2 files changed, 30 insertions, 3 deletions
diff --git a/main/lz4/APKBUILD b/main/lz4/APKBUILD index b3b89891c04..49eaa4af3e8 100644 --- a/main/lz4/APKBUILD +++ b/main/lz4/APKBUILD @@ -2,16 +2,20 @@ # Maintainer: Stuart Cardall <developer@it-offshore.co.uk> pkgname=lz4 pkgver=1.9.2 -pkgrel=0 +pkgrel=1 pkgdesc="LZ4 is lossless compression algorithm with fast decoder @ multiple GB/s per core." url="https://github.com/lz4/lz4" arch="all" license="BSD-2-Clause GPL-2.0-only" checkdepends="diffutils" subpackages="$pkgname-static $pkgname-dev $pkgname-doc $pkgname-libs $pkgname-tests:tests" -source="$pkgname-$pkgver.tar.gz::https://github.com/lz4/lz4/archive/v$pkgver.tar.gz" +source="$pkgname-$pkgver.tar.gz::https://github.com/lz4/lz4/archive/v$pkgver.tar.gz + CVE-2021-3520.patch + " # secfixes: +# 1.9.2-r1: +# - CVE-2021-3520 # 1.9.2-r0: # - CVE-2019-17543 @@ -34,4 +38,5 @@ package() { make PREFIX="/usr" DESTDIR="$pkgdir" install } -sha512sums="ae714c61ec8e33ed91359b63f2896cfa102d66b730dce112b74696ec5850e59d88bd5527173e01e354a70fbe8f036557a47c767ee0766bc5f9c257978116c3c1 lz4-1.9.2.tar.gz" +sha512sums="ae714c61ec8e33ed91359b63f2896cfa102d66b730dce112b74696ec5850e59d88bd5527173e01e354a70fbe8f036557a47c767ee0766bc5f9c257978116c3c1 lz4-1.9.2.tar.gz +29038d80c4399ded52b49e69d0f0d80bef8bf424e3540de366ef539706c8c1119784d6137c96130f131239d74a4c110dd9790cae5c9b17c102820446582c5637 CVE-2021-3520.patch" diff --git a/main/lz4/CVE-2021-3520.patch b/main/lz4/CVE-2021-3520.patch new file mode 100644 index 00000000000..053958dfe87 --- /dev/null +++ b/main/lz4/CVE-2021-3520.patch @@ -0,0 +1,22 @@ +From 8301a21773ef61656225e264f4f06ae14462bca7 Mon Sep 17 00:00:00 2001 +From: Jasper Lievisse Adriaanse <j@jasper.la> +Date: Fri, 26 Feb 2021 15:21:20 +0100 +Subject: [PATCH] Fix potential memory corruption with negative memmove() size + +--- + lib/lz4.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/lz4.c b/lib/lz4.c +index 5f524d01d..c2f504ef3 100644 +--- a/lib/lz4.c ++++ b/lib/lz4.c +@@ -1749,7 +1749,7 @@ LZ4_decompress_generic( + const size_t dictSize /* note : = 0 if noDict */ + ) + { +- if (src == NULL) { return -1; } ++ if ((src == NULL) || (outputSize < 0)) { return -1; } + + { const BYTE* ip = (const BYTE*) src; + const BYTE* const iend = ip + srcSize; |