diff options
| -rw-r--r-- | meta/recipes-core/glib-2.0/glib-2.0/0001-gvariant-serialiser-Convert-endianness-of-offsets.patch | 68 | ||||
| -rw-r--r-- | meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb | 1 |
2 files changed, 69 insertions, 0 deletions
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/0001-gvariant-serialiser-Convert-endianness-of-offsets.patch b/meta/recipes-core/glib-2.0/glib-2.0/0001-gvariant-serialiser-Convert-endianness-of-offsets.patch new file mode 100644 index 0000000000..86cce768ed --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/0001-gvariant-serialiser-Convert-endianness-of-offsets.patch | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | From dc16dffed0480d0c8cdd6a05ede68263fc8723a9 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Simon McVittie <smcv@collabora.com> | ||
| 3 | Date: Thu, 15 Dec 2022 12:51:37 +0000 | ||
| 4 | Subject: [PATCH] gvariant-serialiser: Convert endianness of offsets | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | The array of offsets is little-endian, even on big-endian architectures | ||
| 10 | like s390x. | ||
| 11 | |||
| 12 | Fixes: ade71fb5 "gvariant: Don’t allow child elements to overlap with each other" | ||
| 13 | Resolves: https://gitlab.gnome.org/GNOME/glib/-/issues/2839 | ||
| 14 | Signed-off-by: Simon McVittie <smcv@collabora.com> | ||
| 15 | |||
| 16 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/dc16dffed0480d0c8cdd6a05ede68263fc8723a9] | ||
| 17 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 18 | --- | ||
| 19 | glib/gvariant-serialiser.c | 19 +++++++++++-------- | ||
| 20 | 1 file changed, 11 insertions(+), 8 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/glib/gvariant-serialiser.c b/glib/gvariant-serialiser.c | ||
| 23 | index 25c85b30b..e9b0eab2b 100644 | ||
| 24 | --- a/glib/gvariant-serialiser.c | ||
| 25 | +++ b/glib/gvariant-serialiser.c | ||
| 26 | @@ -712,17 +712,19 @@ gvs_variable_sized_array_n_children (GVariantSerialised value) | ||
| 27 | /* Find the index of the first out-of-order element in @data, assuming that | ||
| 28 | * @data is an array of elements of given @type, starting at index @start and | ||
| 29 | * containing a further @len-@start elements. */ | ||
| 30 | -#define DEFINE_FIND_UNORDERED(type) \ | ||
| 31 | +#define DEFINE_FIND_UNORDERED(type, le_to_native) \ | ||
| 32 | static gsize \ | ||
| 33 | find_unordered_##type (const guint8 *data, gsize start, gsize len) \ | ||
| 34 | { \ | ||
| 35 | gsize off; \ | ||
| 36 | - type current, previous; \ | ||
| 37 | + type current_le, previous_le, current, previous; \ | ||
| 38 | \ | ||
| 39 | - memcpy (&previous, data + start * sizeof (current), sizeof (current)); \ | ||
| 40 | + memcpy (&previous_le, data + start * sizeof (current), sizeof (current)); \ | ||
| 41 | + previous = le_to_native (previous_le); \ | ||
| 42 | for (off = (start + 1) * sizeof (current); off < len * sizeof (current); off += sizeof (current)) \ | ||
| 43 | { \ | ||
| 44 | - memcpy (¤t, data + off, sizeof (current)); \ | ||
| 45 | + memcpy (¤t_le, data + off, sizeof (current)); \ | ||
| 46 | + current = le_to_native (current_le); \ | ||
| 47 | if (current < previous) \ | ||
| 48 | break; \ | ||
| 49 | previous = current; \ | ||
| 50 | @@ -730,10 +732,11 @@ gvs_variable_sized_array_n_children (GVariantSerialised value) | ||
| 51 | return off / sizeof (current) - 1; \ | ||
| 52 | } | ||
| 53 | |||
| 54 | -DEFINE_FIND_UNORDERED (guint8); | ||
| 55 | -DEFINE_FIND_UNORDERED (guint16); | ||
| 56 | -DEFINE_FIND_UNORDERED (guint32); | ||
| 57 | -DEFINE_FIND_UNORDERED (guint64); | ||
| 58 | +#define NO_CONVERSION(x) (x) | ||
| 59 | +DEFINE_FIND_UNORDERED (guint8, NO_CONVERSION); | ||
| 60 | +DEFINE_FIND_UNORDERED (guint16, GUINT16_FROM_LE); | ||
| 61 | +DEFINE_FIND_UNORDERED (guint32, GUINT32_FROM_LE); | ||
| 62 | +DEFINE_FIND_UNORDERED (guint64, GUINT64_FROM_LE); | ||
| 63 | |||
| 64 | static GVariantSerialised | ||
| 65 | gvs_variable_sized_array_get_child (GVariantSerialised value, | ||
| 66 | -- | ||
| 67 | 2.30.2 | ||
| 68 | |||
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 35b51a3ec9..239099d568 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 | |||
| @@ -49,6 +49,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \ | |||
| 49 | file://CVE-2024-34397_16.patch \ | 49 | file://CVE-2024-34397_16.patch \ |
| 50 | file://CVE-2024-34397_17.patch \ | 50 | file://CVE-2024-34397_17.patch \ |
| 51 | file://CVE-2024-34397_18.patch \ | 51 | file://CVE-2024-34397_18.patch \ |
| 52 | file://0001-gvariant-serialiser-Convert-endianness-of-offsets.patch \ | ||
| 52 | " | 53 | " |
| 53 | SRC_URI:append:class-native = " file://relocate-modules.patch" | 54 | SRC_URI:append:class-native = " file://relocate-modules.patch" |
| 54 | 55 | ||
