Commit dd281d50 authored by Ariadne Conill's avatar Ariadne Conill 🐰
Browse files

main/gdk-pixbuf: add mitigation for CVE-2020-29385, add missing secfixes data for CVE-2021-20240

parent f7d64f9e
......@@ -3,7 +3,7 @@
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=gdk-pixbuf
pkgver=2.40.0
pkgrel=1
pkgrel=2
pkgdesc="GTK+ image loading library"
url="https://wiki.gnome.org/Projects/GdkPixbuf"
arch="all"
......@@ -16,10 +16,15 @@ install="$pkgname.pre-deinstall"
triggers="$pkgname.trigger=/usr/lib/gdk-pixbuf-2.0/*/loaders"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang $pkgname-dbg"
source="https://download.gnome.org/sources/gdk-pixbuf/${pkgver%.*}/gdk-pixbuf-$pkgver.tar.xz
80704d84055d8f33cd66824d78d16b89fc45db45.patch"
80704d84055d8f33cd66824d78d16b89fc45db45.patch
CVE-2020-29385.patch"
replaces="gtk+"
# secfixes:
# 2.40.0-r2:
# - CVE-2020-29385
# 2.40.0-r1:
# - CVE-2021-20240
# 2.36.6-r1:
# - CVE-2017-6311
# - CVE-2017-6312
......@@ -64,5 +69,8 @@ dev() {
default_dev
}
sha512sums="6512befd379494dbfd89a16fc4c92641842eb7b82fc820ec83a5b057526209947db646570db1124c073b0ef69c117bdf0f8d3fea807e302a4950db39187c35aa gdk-pixbuf-2.40.0.tar.xz
7dcb3c295ffd6701170e46cb6163939b087f41d928cb455a31f704fb9660dc110bf464a9a14af6296d5a17c9270ac9f0412dd949a9428644bf8a6e9f22ad0b62 80704d84055d8f33cd66824d78d16b89fc45db45.patch"
sha512sums="
6512befd379494dbfd89a16fc4c92641842eb7b82fc820ec83a5b057526209947db646570db1124c073b0ef69c117bdf0f8d3fea807e302a4950db39187c35aa gdk-pixbuf-2.40.0.tar.xz
7dcb3c295ffd6701170e46cb6163939b087f41d928cb455a31f704fb9660dc110bf464a9a14af6296d5a17c9270ac9f0412dd949a9428644bf8a6e9f22ad0b62 80704d84055d8f33cd66824d78d16b89fc45db45.patch
5d66c0c4a80d1658fb02275d18ad4b9d77371067ab90091b49609ac6a8e299ae4768a26fdf7db6457172ea246240b2636974b69e15fe2ec425a2f60537e16624 CVE-2020-29385.patch
"
From bdd3acbd48a575d418ba6bf1b32d7bda2fae1c81 Mon Sep 17 00:00:00 2001
From: Robert Ancell <robert.ancell@canonical.com>
Date: Mon, 30 Nov 2020 12:26:12 +1300
Subject: [PATCH] gif: Fix LZW decoder accepting invalid LZW code.
The code value after a reset wasn't being validated, which means we would
accept invalid codes. This could cause an infinite loop in the decoder.
Fixes CVE-2020-29385
Fixes https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/164
---
gdk-pixbuf/lzw.c | 13 +++++++------
tests/test-images/fail/hang_114.gif | Bin 0 -> 5561 bytes
2 files changed, 7 insertions(+), 6 deletions(-)
create mode 100644 tests/test-images/fail/hang_114.gif
diff --git a/gdk-pixbuf/lzw.c b/gdk-pixbuf/lzw.c
index 9e052a6f7..105daf2b1 100644
--- a/gdk-pixbuf/lzw.c
+++ b/gdk-pixbuf/lzw.c
@@ -195,19 +195,20 @@ lzw_decoder_feed (LZWDecoder *self,
if (self->last_code != self->clear_code && self->code_table_size < MAX_CODES) {
if (self->code < self->code_table_size)
add_code (self, self->code);
- else if (self->code == self->code_table_size)
+ else
add_code (self, self->last_code);
- else {
- /* Invalid code received - just stop here */
- self->last_code = self->eoi_code;
- return output_length;
- }
/* When table is full increase code size */
if (self->code_table_size == (1 << self->code_size) && self->code_size < LZW_CODE_MAX)
self->code_size++;
}
+ /* Invalid code received - just stop here */
+ if (self->code >= self->code_table_size) {
+ self->last_code = self->eoi_code;
+ return output_length;
+ }
+
/* Convert codeword into indexes */
n_written += write_indexes (self, output + n_written, output_length - n_written);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment