diff options
| author | Hitendra Prajapati <hprajapati@mvista.com> | 2022-08-09 10:24:14 +0530 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-18 17:52:23 +0100 |
| commit | c35c1e15f0e9903079691981f49540aeef1f39b6 (patch) | |
| tree | a11621359f66552f3aa930db13685aa5e7257a63 | |
| parent | 820e8891b8b64ac583f251eaed6909b342dccb04 (diff) | |
| download | poky-c35c1e15f0e9903079691981f49540aeef1f39b6.tar.gz | |
gdk-pixbuf: CVE-2021-46829 a heap-based buffer overflow
Source: https://gitlab.gnome.org/GNOME/gdk-pixbuf
MR: 120380
Type: Security Fix
Disposition: Backport from https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/commit/5398f04d772f7f8baf5265715696ed88db0f0512
ChangeID: d8a843bcf97268ee4f0c6870f1339790a9a908e5
Description:
CVE-2021-46829 gdk-pixbuf: a heap-based buffer overflow when compositing or clearing frames in GIF files.
(From OE-Core rev: ef3f5fba3c3b5e8b16d6b8b7721468e61c65f72f)
Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2021-46829.patch | 61 | ||||
| -rw-r--r-- | meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.40.0.bb | 1 |
2 files changed, 62 insertions, 0 deletions
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2021-46829.patch b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2021-46829.patch new file mode 100644 index 0000000000..b29ab209ce --- /dev/null +++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2021-46829.patch | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | From bdf3a2630c02a63803309cf0ad4b274234c814ce Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hitendra Prajapati <hprajapati@mvista.com> | ||
| 3 | Date: Tue, 9 Aug 2022 09:45:42 +0530 | ||
| 4 | Subject: [PATCH] CVE-2021-46829 | ||
| 5 | |||
| 6 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/commit/5398f04d772f7f8baf5265715696ed88db0f0512] | ||
| 7 | CVE: CVE-2021-46829 | ||
| 8 | Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> | ||
| 9 | --- | ||
| 10 | gdk-pixbuf/io-gif-animation.c | 21 +++++++++++++-------- | ||
| 11 | 1 file changed, 13 insertions(+), 8 deletions(-) | ||
| 12 | |||
| 13 | diff --git a/gdk-pixbuf/io-gif-animation.c b/gdk-pixbuf/io-gif-animation.c | ||
| 14 | index d742963..9544391 100644 | ||
| 15 | --- a/gdk-pixbuf/io-gif-animation.c | ||
| 16 | +++ b/gdk-pixbuf/io-gif-animation.c | ||
| 17 | @@ -364,7 +364,7 @@ composite_frame (GdkPixbufGifAnim *anim, GdkPixbufFrame *frame) | ||
| 18 | for (i = 0; i < n_indexes; i++) { | ||
| 19 | guint8 index = index_buffer[i]; | ||
| 20 | guint x, y; | ||
| 21 | - int offset; | ||
| 22 | + gsize offset; | ||
| 23 | |||
| 24 | if (index == frame->transparent_index) | ||
| 25 | continue; | ||
| 26 | @@ -374,11 +374,13 @@ composite_frame (GdkPixbufGifAnim *anim, GdkPixbufFrame *frame) | ||
| 27 | if (x >= anim->width || y >= anim->height) | ||
| 28 | continue; | ||
| 29 | |||
| 30 | - offset = y * gdk_pixbuf_get_rowstride (anim->last_frame_data) + x * 4; | ||
| 31 | - pixels[offset + 0] = frame->color_map[index * 3 + 0]; | ||
| 32 | - pixels[offset + 1] = frame->color_map[index * 3 + 1]; | ||
| 33 | - pixels[offset + 2] = frame->color_map[index * 3 + 2]; | ||
| 34 | - pixels[offset + 3] = 255; | ||
| 35 | + if (g_size_checked_mul (&offset, gdk_pixbuf_get_rowstride (anim->last_frame_data), y) && | ||
| 36 | + g_size_checked_add (&offset, offset, x * 4)) { | ||
| 37 | + pixels[offset + 0] = frame->color_map[index * 3 + 0]; | ||
| 38 | + pixels[offset + 1] = frame->color_map[index * 3 + 1]; | ||
| 39 | + pixels[offset + 2] = frame->color_map[index * 3 + 2]; | ||
| 40 | + pixels[offset + 3] = 255; | ||
| 41 | + } | ||
| 42 | } | ||
| 43 | |||
| 44 | out: | ||
| 45 | @@ -443,8 +445,11 @@ gdk_pixbuf_gif_anim_iter_get_pixbuf (GdkPixbufAnimationIter *anim_iter) | ||
| 46 | x_end = MIN (anim->last_frame->x_offset + anim->last_frame->width, anim->width); | ||
| 47 | y_end = MIN (anim->last_frame->y_offset + anim->last_frame->height, anim->height); | ||
| 48 | for (y = anim->last_frame->y_offset; y < y_end; y++) { | ||
| 49 | - guchar *line = pixels + y * gdk_pixbuf_get_rowstride (anim->last_frame_data) + anim->last_frame->x_offset * 4; | ||
| 50 | - memset (line, 0, (x_end - anim->last_frame->x_offset) * 4); | ||
| 51 | + gsize offset; | ||
| 52 | + if (g_size_checked_mul (&offset, gdk_pixbuf_get_rowstride (anim->last_frame_data), y) && | ||
| 53 | + g_size_checked_add (&offset, offset, anim->last_frame->x_offset * 4)) { | ||
| 54 | + memset (pixels + offset, 0, (x_end - anim->last_frame->x_offset) * 4); | ||
| 55 | + } | ||
| 56 | } | ||
| 57 | break; | ||
| 58 | case GDK_PIXBUF_FRAME_REVERT: | ||
| 59 | -- | ||
| 60 | 2.25.1 | ||
| 61 | |||
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.40.0.bb b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.40.0.bb index 60a04c3581..1171e6cc11 100644 --- a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.40.0.bb +++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.40.0.bb | |||
| @@ -26,6 +26,7 @@ SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \ | |||
| 26 | file://missing-test-data.patch \ | 26 | file://missing-test-data.patch \ |
| 27 | file://CVE-2020-29385.patch \ | 27 | file://CVE-2020-29385.patch \ |
| 28 | file://CVE-2021-20240.patch \ | 28 | file://CVE-2021-20240.patch \ |
| 29 | file://CVE-2021-46829.patch \ | ||
| 29 | " | 30 | " |
| 30 | 31 | ||
| 31 | SRC_URI_append_class-target = " \ | 32 | SRC_URI_append_class-target = " \ |
