diff options
| author | Vijay Anusuri <vanusuri@mvista.com> | 2025-01-05 11:13:11 +0530 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-01-09 08:41:04 -0800 |
| commit | fd884abc054f9f1e559d46ed1a35f713e844795e (patch) | |
| tree | a31c2d38bd531914e256df338850342b2247e898 /meta | |
| parent | 3ad4123a24e35c13273531ebcc34bd81328f3da3 (diff) | |
| download | poky-fd884abc054f9f1e559d46ed1a35f713e844795e.tar.gz | |
gstreamer1.0: Backport fix for CVE-2024-47606
Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/72af11b248b4cb60d3dfe4e9459eec0d20052c9b]
(From OE-Core rev: de94acd8f8be37fbc6e0b16693dae8a7efb5910c)
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-multimedia/gstreamer/gstreamer1.0/CVE-2024-47606.patch | 56 | ||||
| -rw-r--r-- | meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.7.bb | 1 |
2 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/CVE-2024-47606.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/CVE-2024-47606.patch new file mode 100644 index 0000000000..6334af4226 --- /dev/null +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/CVE-2024-47606.patch | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | From 72af11b248b4cb60d3dfe4e9459eec0d20052c9b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com> | ||
| 3 | Date: Thu, 26 Sep 2024 22:07:22 +0300 | ||
| 4 | Subject: [PATCH] allocator: Avoid integer overflow when allocating sysmem | ||
| 5 | |||
| 6 | Thanks to Antonio Morales for finding and reporting the issue. | ||
| 7 | |||
| 8 | Fixes GHSL-2024-166 | ||
| 9 | Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3851 | ||
| 10 | |||
| 11 | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8044> | ||
| 12 | |||
| 13 | Upstream-Status: Backport [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/72af11b248b4cb60d3dfe4e9459eec0d20052c9b] | ||
| 14 | CVE: CVE-2024-47606 | ||
| 15 | Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> | ||
| 16 | --- | ||
| 17 | gst/gstallocator.c | 14 ++++++++++++++ | ||
| 18 | 1 file changed, 14 insertions(+) | ||
| 19 | |||
| 20 | diff --git a/gst/gstallocator.c b/gst/gstallocator.c | ||
| 21 | index f3cd20e..ff6dda4 100644 | ||
| 22 | --- a/gst/gstallocator.c | ||
| 23 | +++ b/gst/gstallocator.c | ||
| 24 | @@ -430,8 +430,20 @@ _sysmem_new_block (GstMemoryFlags flags, | ||
| 25 | /* ensure configured alignment */ | ||
| 26 | align |= gst_memory_alignment; | ||
| 27 | /* allocate more to compensate for alignment */ | ||
| 28 | + if (align > G_MAXSIZE || maxsize > G_MAXSIZE - align) { | ||
| 29 | + GST_CAT_WARNING (GST_CAT_MEMORY, | ||
| 30 | + "Allocating %" G_GSIZE_FORMAT " bytes with alignment %" G_GSIZE_FORMAT | ||
| 31 | + "x overflows", maxsize, align); | ||
| 32 | + return NULL; | ||
| 33 | + } | ||
| 34 | maxsize += align; | ||
| 35 | /* alloc header and data in one block */ | ||
| 36 | + if (maxsize > G_MAXSIZE - sizeof (GstMemorySystem)) { | ||
| 37 | + GST_CAT_WARNING (GST_CAT_MEMORY, | ||
| 38 | + "Allocating %" G_GSIZE_FORMAT " bytes with alignment %" G_GSIZE_FORMAT | ||
| 39 | + "x overflows", maxsize, align); | ||
| 40 | + return NULL; | ||
| 41 | + } | ||
| 42 | slice_size = sizeof (GstMemorySystem) + maxsize; | ||
| 43 | |||
| 44 | mem = g_slice_alloc (slice_size); | ||
| 45 | @@ -481,6 +493,8 @@ _sysmem_copy (GstMemorySystem * mem, gssize offset, gsize size) | ||
| 46 | size = mem->mem.size > offset ? mem->mem.size - offset : 0; | ||
| 47 | |||
| 48 | copy = _sysmem_new_block (0, size, mem->mem.align, 0, size); | ||
| 49 | + if (!copy) | ||
| 50 | + return NULL; | ||
| 51 | GST_CAT_DEBUG (GST_CAT_PERFORMANCE, | ||
| 52 | "memcpy %" G_GSIZE_FORMAT " memory %p -> %p", size, mem, copy); | ||
| 53 | memcpy (copy->data, mem->data + mem->mem.offset + offset, size); | ||
| 54 | -- | ||
| 55 | 2.25.1 | ||
| 56 | |||
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.7.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.7.bb index cf81620833..b95c67f586 100644 --- a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.7.bb +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.20.7.bb | |||
| @@ -21,6 +21,7 @@ SRC_URI = "https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${PV}.tar.x | |||
| 21 | file://0002-tests-add-support-for-install-the-tests.patch;striplevel=3 \ | 21 | file://0002-tests-add-support-for-install-the-tests.patch;striplevel=3 \ |
| 22 | file://0003-tests-use-a-dictionaries-for-environment.patch;striplevel=3 \ | 22 | file://0003-tests-use-a-dictionaries-for-environment.patch;striplevel=3 \ |
| 23 | file://0004-tests-add-helper-script-to-run-the-installed_tests.patch;striplevel=3 \ | 23 | file://0004-tests-add-helper-script-to-run-the-installed_tests.patch;striplevel=3 \ |
| 24 | file://CVE-2024-47606.patch \ | ||
| 24 | " | 25 | " |
| 25 | SRC_URI[sha256sum] = "1757184a07b9703219e8b1961f81cb1dd64320d147fc045ac8eb499efbea79be" | 26 | SRC_URI[sha256sum] = "1757184a07b9703219e8b1961f81cb1dd64320d147fc045ac8eb499efbea79be" |
| 26 | 27 | ||
