diff options
| -rw-r--r-- | meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-01.patch | 40 | ||||
| -rw-r--r-- | meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-02.patch | 43 | ||||
| -rw-r--r-- | meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb | 2 |
3 files changed, 85 insertions, 0 deletions
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-01.patch b/meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-01.patch new file mode 100644 index 0000000000..cb096fca42 --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-01.patch | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | From 285db475ecaa4d2cc39ce326b4c63aacb87ca6ad Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alexander Kanavin <alex@linutronix.de> | ||
| 3 | Date: Tue, 22 Aug 2023 19:57:48 +0200 | ||
| 4 | Subject: [PATCH] glib/gfileutils.c: use 64 bits for value in get_tmp_file() | ||
| 5 | |||
| 6 | On 32 bit systems 'long' value will overflow in 2038 and become negative. | ||
| 7 | As it is used to index into letters array, and % operation preserves signs, | ||
| 8 | data corruption will then occur. | ||
| 9 | |||
| 10 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> | ||
| 11 | |||
| 12 | CVE: CVE-2025-7039 | ||
| 13 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/285db475ecaa4d2cc39ce326b4c63aacb87ca6ad] | ||
| 14 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 15 | --- | ||
| 16 | glib/gfileutils.c | 4 ++-- | ||
| 17 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 18 | |||
| 19 | diff --git a/glib/gfileutils.c b/glib/gfileutils.c | ||
| 20 | index 9646c696e..bd3cc179a 100644 | ||
| 21 | --- a/glib/gfileutils.c | ||
| 22 | +++ b/glib/gfileutils.c | ||
| 23 | @@ -1475,7 +1475,7 @@ get_tmp_file (gchar *tmpl, | ||
| 24 | static const char letters[] = | ||
| 25 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | ||
| 26 | static const int NLETTERS = sizeof (letters) - 1; | ||
| 27 | - glong value; | ||
| 28 | + gint64 value; | ||
| 29 | gint64 now_us; | ||
| 30 | static int counter = 0; | ||
| 31 | |||
| 32 | @@ -1496,7 +1496,7 @@ get_tmp_file (gchar *tmpl, | ||
| 33 | |||
| 34 | for (count = 0; count < 100; value += 7777, ++count) | ||
| 35 | { | ||
| 36 | - glong v = value; | ||
| 37 | + gint64 v = value; | ||
| 38 | |||
| 39 | /* Fill in the random bits. */ | ||
| 40 | XXXXXX[0] = letters[v % NLETTERS]; | ||
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-02.patch b/meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-02.patch new file mode 100644 index 0000000000..37e32fefc3 --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-7039-02.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | From 61e963284889ddb4544e6f1d5261c16120f6fcc3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Michael Catanzaro <mcatanzaro@redhat.com> | ||
| 3 | Date: Tue, 1 Jul 2025 10:58:07 -0500 | ||
| 4 | Subject: [PATCH] gfileutils: fix computation of temporary file name | ||
| 5 | |||
| 6 | We need to ensure that the value we use to index into the letters array | ||
| 7 | is always positive. | ||
| 8 | |||
| 9 | Fixes #3716 | ||
| 10 | |||
| 11 | CVE: CVE-2025-7039 | ||
| 12 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/61e963284889ddb4544e6f1d5261c16120f6fcc3] | ||
| 13 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 14 | --- | ||
| 15 | glib/gfileutils.c | 8 ++++---- | ||
| 16 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/glib/gfileutils.c b/glib/gfileutils.c | ||
| 19 | index c7d3339d1..286b1b154 100644 | ||
| 20 | --- a/glib/gfileutils.c | ||
| 21 | +++ b/glib/gfileutils.c | ||
| 22 | @@ -1475,9 +1475,9 @@ get_tmp_file (gchar *tmpl, | ||
| 23 | static const char letters[] = | ||
| 24 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | ||
| 25 | static const int NLETTERS = sizeof (letters) - 1; | ||
| 26 | - gint64 value; | ||
| 27 | - gint64 now_us; | ||
| 28 | - static int counter = 0; | ||
| 29 | + guint64 value; | ||
| 30 | + guint64 now_us; | ||
| 31 | + static guint counter = 0; | ||
| 32 | |||
| 33 | g_return_val_if_fail (tmpl != NULL, -1); | ||
| 34 | |||
| 35 | @@ -1496,7 +1496,7 @@ get_tmp_file (gchar *tmpl, | ||
| 36 | |||
| 37 | for (count = 0; count < 100; value += 7777, ++count) | ||
| 38 | { | ||
| 39 | - gint64 v = value; | ||
| 40 | + guint64 v = value; | ||
| 41 | |||
| 42 | /* Fill in the random bits. */ | ||
| 43 | XXXXXX[0] = letters[v % NLETTERS]; | ||
diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb index 31b6c1fe98..7ba52b5c79 100644 --- a/meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb +++ b/meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb | |||
| @@ -62,6 +62,8 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \ | |||
| 62 | file://CVE-2025-3360-06.patch \ | 62 | file://CVE-2025-3360-06.patch \ |
| 63 | file://CVE-2025-4373-01.patch \ | 63 | file://CVE-2025-4373-01.patch \ |
| 64 | file://CVE-2025-4373-02.patch \ | 64 | file://CVE-2025-4373-02.patch \ |
| 65 | file://CVE-2025-7039-01.patch \ | ||
| 66 | file://CVE-2025-7039-02.patch \ | ||
| 65 | " | 67 | " |
| 66 | SRC_URI:append:class-native = " file://relocate-modules.patch" | 68 | SRC_URI:append:class-native = " file://relocate-modules.patch" |
| 67 | 69 | ||
