summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2024-01-10 21:01:53 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-12 11:54:05 +0000
commitef9f8330c1b85325969f76bc97272905eeedd5e0 (patch)
treeac2a91865c58f40b4ff08e4336fff79f90a336cb /meta
parentac6fb1aa6a524e133422e6bb468122b07b9c87e9 (diff)
downloadpoky-ef9f8330c1b85325969f76bc97272905eeedd5e0.tar.gz
cairo: upgrade to 1.18.0
The changelog is large[1] but: Added: - Type 3 colour and COLRv2 fonts - Tee surfice automatically enabled - Meson build system Removed: - The cairo-sphinx tool - The XML, GL, GLES, Qt5, BeOS, OS/2, DirectFB, DRM, Cogl, and OpenVL backends - Autotools build system These CVE patches have been merged upstream: CVE-2018-19876.patch: https://gitlab.freedesktop.org/cairo/cairo/-/commit/90e85c2493fdfa3551f202ff10282463f1e36645 CVE-2019-6461.patch: https://gitlab.freedesktop.org/cairo/cairo/-/commit/09643ee1abdd5daacebfcb564448f29be9a79bac CVE-2019-6462.patch: https://gitlab.freedesktop.org/cairo/cairo/-/commit/bbeaf08190d3006a80b80a77724801cd477a37b8 CVE-2020-35492.patch: https://gitlab.freedesktop.org/cairo/cairo/-/commit/c986a7310bb06582b7d8a566d5f007ba4e5e75bf Some niche options have been removed in the migration to Meson, so the recipe can be cleaned up. Put libcairo-fdr ("flight data recorder") in the perf-utils package instead of deleting it. There is an executable test for IPC behaviour that needs to be set via a cross file if qemu-user isn't available, thanks to Alex Kanavin for this portion. [1] https://www.cairographics.org/news/cairo-1.18.0/ (From OE-Core rev: 9a4ca6b08d6031ebb67adcdd650aa59acd4fb5fb) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-graphics/cairo/cairo/CVE-2018-19876.patch34
-rw-r--r--meta/recipes-graphics/cairo/cairo/CVE-2019-6461.patch20
-rw-r--r--meta/recipes-graphics/cairo/cairo/CVE-2019-6462.patch40
-rw-r--r--meta/recipes-graphics/cairo/cairo/CVE-2020-35492.patch60
-rw-r--r--meta/recipes-graphics/cairo/cairo/cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff2
-rw-r--r--meta/recipes-graphics/cairo/cairo_1.18.0.bb (renamed from meta/recipes-graphics/cairo/cairo_1.16.0.bb)73
6 files changed, 27 insertions, 202 deletions
diff --git a/meta/recipes-graphics/cairo/cairo/CVE-2018-19876.patch b/meta/recipes-graphics/cairo/cairo/CVE-2018-19876.patch
deleted file mode 100644
index 4252a5663b..0000000000
--- a/meta/recipes-graphics/cairo/cairo/CVE-2018-19876.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1CVE: CVE-2018-19876
2Upstream-Status: Backport
3Signed-off-by: Ross Burton <ross.burton@intel.com>
4
5From 90e85c2493fdfa3551f202ff10282463f1e36645 Mon Sep 17 00:00:00 2001
6From: Carlos Garcia Campos <cgarcia@igalia.com>
7Date: Mon, 19 Nov 2018 12:33:07 +0100
8Subject: [PATCH] ft: Use FT_Done_MM_Var instead of free when available in
9 cairo_ft_apply_variations
10
11Fixes a crash when using freetype >= 2.9
12---
13 src/cairo-ft-font.c | 4 ++++
14 1 file changed, 4 insertions(+)
15
16diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
17index 325dd61b4..981973f78 100644
18--- a/src/cairo-ft-font.c
19+++ b/src/cairo-ft-font.c
20@@ -2393,7 +2393,11 @@ skip:
21 done:
22 free (coords);
23 free (current_coords);
24+#if HAVE_FT_DONE_MM_VAR
25+ FT_Done_MM_Var (face->glyph->library, ft_mm_var);
26+#else
27 free (ft_mm_var);
28+#endif
29 }
30 }
31
32--
332.11.0
34
diff --git a/meta/recipes-graphics/cairo/cairo/CVE-2019-6461.patch b/meta/recipes-graphics/cairo/cairo/CVE-2019-6461.patch
deleted file mode 100644
index a2dba6cb20..0000000000
--- a/meta/recipes-graphics/cairo/cairo/CVE-2019-6461.patch
+++ /dev/null
@@ -1,20 +0,0 @@
1There is an assertion in function _cairo_arc_in_direction().
2
3CVE: CVE-2019-6461
4Upstream-Status: Pending
5Signed-off-by: Ross Burton <ross.burton@intel.com>
6
7diff --git a/src/cairo-arc.c b/src/cairo-arc.c
8index 390397bae..1bde774a4 100644
9--- a/src/cairo-arc.c
10+++ b/src/cairo-arc.c
11@@ -186,7 +186,8 @@ _cairo_arc_in_direction (cairo_t *cr,
12 if (cairo_status (cr))
13 return;
14
15- assert (angle_max >= angle_min);
16+ if (angle_max < angle_min)
17+ return;
18
19 if (angle_max - angle_min > 2 * M_PI * MAX_FULL_CIRCLES) {
20 angle_max = fmod (angle_max - angle_min, 2 * M_PI);
diff --git a/meta/recipes-graphics/cairo/cairo/CVE-2019-6462.patch b/meta/recipes-graphics/cairo/cairo/CVE-2019-6462.patch
deleted file mode 100644
index 7c3209291b..0000000000
--- a/meta/recipes-graphics/cairo/cairo/CVE-2019-6462.patch
+++ /dev/null
@@ -1,40 +0,0 @@
1CVE: CVE-2019-6462
2Upstream-Status: Backport
3Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
4
5From ab2c5ee21e5f3d3ee4b3f67cfcd5811a4f99c3a0 Mon Sep 17 00:00:00 2001
6From: Heiko Lewin <hlewin@gmx.de>
7Date: Sun, 1 Aug 2021 11:16:03 +0000
8Subject: [PATCH] _arc_max_angle_for_tolerance_normalized: fix infinite loop
9
10---
11 src/cairo-arc.c | 4 +++-
12 1 file changed, 3 insertions(+), 1 deletion(-)
13
14diff --git a/src/cairo-arc.c b/src/cairo-arc.c
15index 390397bae..1c891d1a0 100644
16--- a/src/cairo-arc.c
17+++ b/src/cairo-arc.c
18@@ -90,16 +90,18 @@ _arc_max_angle_for_tolerance_normalized (double tolerance)
19 { M_PI / 11.0, 9.81410988043554039085e-09 },
20 };
21 int table_size = ARRAY_LENGTH (table);
22+ const int max_segments = 1000; /* this value is chosen arbitrarily. this gives an error of about 1.74909e-20 */
23
24 for (i = 0; i < table_size; i++)
25 if (table[i].error < tolerance)
26 return table[i].angle;
27
28 ++i;
29+
30 do {
31 angle = M_PI / i++;
32 error = _arc_error_normalized (angle);
33- } while (error > tolerance);
34+ } while (error > tolerance && i < max_segments);
35
36 return angle;
37 }
38--
392.38.1
40
diff --git a/meta/recipes-graphics/cairo/cairo/CVE-2020-35492.patch b/meta/recipes-graphics/cairo/cairo/CVE-2020-35492.patch
deleted file mode 100644
index fb6ce5cfdf..0000000000
--- a/meta/recipes-graphics/cairo/cairo/CVE-2020-35492.patch
+++ /dev/null
@@ -1,60 +0,0 @@
1Fix stack buffer overflow.
2
3CVE: CVE-2020-35492
4Upstream-Status: Backport
5Signed-off-by: Ross Burton <ross.burton@arm.com>
6
7From 03a820b173ed1fdef6ff14b4468f5dbc02ff59be Mon Sep 17 00:00:00 2001
8From: Heiko Lewin <heiko.lewin@worldiety.de>
9Date: Tue, 15 Dec 2020 16:48:19 +0100
10Subject: [PATCH] Fix mask usage in image-compositor
11
12---
13 src/cairo-image-compositor.c | 8 ++--
14 test/Makefile.sources | 1 +
15 test/bug-image-compositor.c | 39 ++++++++++++++++++++
16 test/reference/bug-image-compositor.ref.png | Bin 0 -> 185 bytes
17 4 files changed, 44 insertions(+), 4 deletions(-)
18 create mode 100644 test/bug-image-compositor.c
19 create mode 100644 test/reference/bug-image-compositor.ref.png
20
21diff --git a/src/cairo-image-compositor.c b/src/cairo-image-compositor.c
22index 79ad69f68..4f8aaed99 100644
23--- a/src/cairo-image-compositor.c
24+++ b/src/cairo-image-compositor.c
25@@ -2601,14 +2601,14 @@ _inplace_src_spans (void *abstract_renderer, int y, int h,
26 unsigned num_spans)
27 {
28 cairo_image_span_renderer_t *r = abstract_renderer;
29- uint8_t *m;
30+ uint8_t *m, *base = (uint8_t*)pixman_image_get_data(r->mask);
31 int x0;
32
33 if (num_spans == 0)
34 return CAIRO_STATUS_SUCCESS;
35
36 x0 = spans[0].x;
37- m = r->_buf;
38+ m = base;
39 do {
40 int len = spans[1].x - spans[0].x;
41 if (len >= r->u.composite.run_length && spans[0].coverage == 0xff) {
42@@ -2655,7 +2655,7 @@ _inplace_src_spans (void *abstract_renderer, int y, int h,
43 spans[0].x, y,
44 spans[1].x - spans[0].x, h);
45
46- m = r->_buf;
47+ m = base;
48 x0 = spans[1].x;
49 } else if (spans[0].coverage == 0x0) {
50 if (spans[0].x != x0) {
51@@ -2684,7 +2684,7 @@ _inplace_src_spans (void *abstract_renderer, int y, int h,
52 #endif
53 }
54
55- m = r->_buf;
56+ m = base;
57 x0 = spans[1].x;
58 } else {
59 *m++ = spans[0].coverage;
60--
diff --git a/meta/recipes-graphics/cairo/cairo/cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff b/meta/recipes-graphics/cairo/cairo/cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff
index 7aaad2eedd..6c761bf2a7 100644
--- a/meta/recipes-graphics/cairo/cairo/cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff
+++ b/meta/recipes-graphics/cairo/cairo/cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff
@@ -3,7 +3,7 @@ Cairo: Fix Denial-of-Service Attack due to Logical Problem in Program
3https://bugs.freedesktop.org/show_bug.cgi?id=100763 3https://bugs.freedesktop.org/show_bug.cgi?id=100763
4 4
5CVE: CVE-2017-7475 5CVE: CVE-2017-7475
6Upstream-Status: Submitted 6Upstream-Status: Submitted [https://gitlab.freedesktop.org/cairo/cairo/-/issues/80]
7 7
8Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com> 8Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
9 9
diff --git a/meta/recipes-graphics/cairo/cairo_1.16.0.bb b/meta/recipes-graphics/cairo/cairo_1.18.0.bb
index ffb813d290..fe72537b77 100644
--- a/meta/recipes-graphics/cairo/cairo_1.16.0.bb
+++ b/meta/recipes-graphics/cairo/cairo_1.18.0.bb
@@ -7,7 +7,7 @@ optional translucence (opacity/alpha) and combined using the \
7extended Porter/Duff compositing algebra as found in the X Render \ 7extended Porter/Duff compositing algebra as found in the X Render \
8Extension." 8Extension."
9HOMEPAGE = "http://cairographics.org" 9HOMEPAGE = "http://cairographics.org"
10BUGTRACKER = "http://bugs.freedesktop.org" 10BUGTRACKER = "https://gitlab.freedesktop.org/cairo/cairo/-/issues"
11SECTION = "libs" 11SECTION = "libs"
12 12
13LICENSE = "(MPL-1.1 | LGPL-2.1-only) & GPL-3.0-or-later" 13LICENSE = "(MPL-1.1 | LGPL-2.1-only) & GPL-3.0-or-later"
@@ -26,62 +26,41 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=e73e999e0c72b5ac9012424fa157ad77 \
26 ${@bb.utils.contains('PACKAGECONFIG', 'trace', 'file://util/cairo-trace/COPYING-GPL-3;md5=d32239bcb673463ab874e80d47fae504', '', d)}" 26 ${@bb.utils.contains('PACKAGECONFIG', 'trace', 'file://util/cairo-trace/COPYING-GPL-3;md5=d32239bcb673463ab874e80d47fae504', '', d)}"
27 27
28 28
29DEPENDS = "fontconfig glib-2.0 libpng pixman zlib" 29DEPENDS = "fontconfig freetype glib-2.0 libpng pixman zlib"
30 30
31SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.xz \ 31SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.xz \
32 file://cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff \ 32 file://cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff \
33 file://CVE-2018-19876.patch \
34 file://CVE-2019-6461.patch \
35 file://CVE-2019-6462.patch \
36 file://CVE-2020-35492.patch \
37 " 33 "
38 34
39SRC_URI[md5sum] = "f19e0353828269c22bd72e271243a552" 35SRC_URI[sha256sum] = "243a0736b978a33dee29f9cca7521733b78a65b5418206fef7bd1c3d4cf10b64"
40SRC_URI[sha256sum] = "5e7b29b3f113ef870d1e3ecf8adf21f923396401604bda16d44be45e66052331"
41 36
42inherit autotools pkgconfig upstream-version-is-even gtk-doc multilib_script 37inherit meson pkgconfig upstream-version-is-even gtk-doc multilib_script
38
39# if qemu usermode isn't available, this value needs to be set statically
40# (otherwise it's determinted by running a small target executable with qemu)
41do_write_config:append:class-target() {
42 cat >${WORKDIR}/cairo.cross <<EOF
43[properties]
44ipc_rmid_deferred_release = 'true'
45EOF
46}
47EXTRA_OEMESON:append:class-target = "${@' --cross-file ${WORKDIR}/cairo.cross' if d.getVar('EXEWRAPPER_ENABLED') == 'False' else ''}"
48
49GTKDOC_MESON_OPTION = "gtk_doc"
43 50
44MULTILIB_SCRIPTS = "${PN}-perf-utils:${bindir}/cairo-trace" 51MULTILIB_SCRIPTS = "${PN}-perf-utils:${bindir}/cairo-trace"
45 52
46X11DEPENDS = "virtual/libx11 libsm libxrender libxext" 53PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xlib xcb', '', d)} trace"
47 54PACKAGECONFIG[xlib] = "-Dxlib=enabled,-Dxlib=disabled,virtual/libx11 libxrender libxext"
48PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'directfb', d)} \ 55PACKAGECONFIG[xcb] = "-Dxcb=enabled,-Dxcb=disabled,libxcb"
49 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 xcb', '', d)} \ 56# cairo-trace is GPLv3 so add an option to remove it
50 ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'opengl', '', d)} \ 57PACKAGECONFIG[trace] = ""
51 trace"
52PACKAGECONFIG:class-native = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 xcb', '', d)}"
53PACKAGECONFIG:class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 xcb', '', d)}"
54
55PACKAGECONFIG[x11] = "--with-x=yes -enable-xlib,--with-x=no --disable-xlib,${X11DEPENDS}"
56PACKAGECONFIG[xcb] = "--enable-xcb,--disable-xcb,libxcb"
57PACKAGECONFIG[directfb] = "--enable-directfb=yes,,directfb"
58PACKAGECONFIG[valgrind] = "--enable-valgrind=yes,--disable-valgrind,valgrind"
59PACKAGECONFIG[egl] = "--enable-egl=yes,--disable-egl,virtual/egl"
60PACKAGECONFIG[glesv2] = "--enable-glesv2,--disable-glesv2,virtual/libgles2"
61PACKAGECONFIG[opengl] = "--enable-gl,--disable-gl,virtual/libgl"
62# trace is under GPLv3
63PACKAGECONFIG[trace] = "--enable-trace,--disable-trace"
64
65EXTRA_OECONF += " \
66 ${@bb.utils.contains('TARGET_FPU', 'soft', '--disable-some-floating-point', '', d)} \
67 --enable-tee \
68"
69
70# We don't depend on binutils so we need to disable this
71export ac_cv_lib_bfd_bfd_openr="no"
72# Ensure we don't depend on LZO
73export ac_cv_lib_lzo2_lzo2a_decompress="no"
74 58
75do_install:append () { 59do_install:append () {
76 rm -rf ${D}${bindir}/cairo-sphinx 60 if ! ${@bb.utils.contains('PACKAGECONFIG', 'trace', 'true', 'false', d)}; then
77 rm -rf ${D}${libdir}/cairo/cairo-fdr* 61 rm ${D}${bindir}/cairo-trace ${D}${libdir}/cairo/libcairo-trace.so
78 rm -rf ${D}${libdir}/cairo/cairo-sphinx* 62 rmdir --ignore-fail-on-non-empty ${D}${bindir} ${D}${libdir}/cairo
79 rm -rf ${D}${libdir}/cairo/.debug/cairo-fdr* 63 fi
80 rm -rf ${D}${libdir}/cairo/.debug/cairo-sphinx*
81 [ ! -d ${D}${bindir} ] ||
82 rmdir -p --ignore-fail-on-non-empty ${D}${bindir}
83 [ ! -d ${D}${libdir}/cairo ] ||
84 rmdir -p --ignore-fail-on-non-empty ${D}${libdir}/cairo
85} 64}
86 65
87PACKAGES =+ "cairo-gobject cairo-script-interpreter cairo-perf-utils" 66PACKAGES =+ "cairo-gobject cairo-script-interpreter cairo-perf-utils"
@@ -99,7 +78,7 @@ DESCRIPTION:cairo-perf-utils = "The Cairo library performance utilities"
99FILES:${PN} = "${libdir}/libcairo.so.*" 78FILES:${PN} = "${libdir}/libcairo.so.*"
100FILES:${PN}-gobject = "${libdir}/libcairo-gobject.so.*" 79FILES:${PN}-gobject = "${libdir}/libcairo-gobject.so.*"
101FILES:${PN}-script-interpreter = "${libdir}/libcairo-script-interpreter.so.*" 80FILES:${PN}-script-interpreter = "${libdir}/libcairo-script-interpreter.so.*"
102FILES:${PN}-perf-utils = "${bindir}/cairo-trace* ${libdir}/cairo/*.la ${libdir}/cairo/libcairo-trace.so" 81FILES:${PN}-perf-utils = "${bindir}/cairo-* ${libdir}/cairo/libcairo-trace.so ${libdir}/cairo/libcairo-fdr.so"
103 82
104BBCLASSEXTEND = "native nativesdk" 83BBCLASSEXTEND = "native nativesdk"
105 84