summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-qt/qt5/qtsvg/CVE-2021-3481.patch73
-rw-r--r--recipes-qt/qt5/qtsvg_git.bb2
2 files changed, 75 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtsvg/CVE-2021-3481.patch b/recipes-qt/qt5/qtsvg/CVE-2021-3481.patch
new file mode 100644
index 00000000..1b67914c
--- /dev/null
+++ b/recipes-qt/qt5/qtsvg/CVE-2021-3481.patch
@@ -0,0 +1,73 @@
1CVE: CVE-2021-3481
2Upstream-Status: Backport [https://codereview.qt-project.org/gitweb?p=qt%2Fqtsvg.git;a=commit;h=bfd6ee0]
3
4Backport and squash commits 85b70a721695991e8a5bbe4aa52e5320e170e90c and
5bfd6ee0d8cf34b63d32adf10ed93daa0086b359f to fix CVE-2021-3481.
6
7Signed-off-by: Kai Kang <kai.kang@windriver.com>
8
9From 6c40fd492eafabe67177c0e84839beec5be298b8 Mon Sep 17 00:00:00 2001
10From: Eirik Aavitsland <eirik.aavitsland@qt.io>
11Date: Tue, 1 Dec 2020 14:39:59 +0100
12Subject: [PATCH] Improve handling of malformed numeric values in svg files
13MIME-Version: 1.0
14Content-Type: text/plain; charset=UTF-8
15Content-Transfer-Encoding: 8bit
16
17Catch cases where the input is not containable in a qreal, and avoid
18passing on inf values.
19
20Pick-to: 6.0 5.15 5.12
21Change-Id: I1ab8932d94473916815385240c29e03afb0e0c9e
22Reviewed-by: Robert Loehning <robert.loehning@qt.io>
23Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
24
25Clamp parsed doubles to float representable values
26
27Parts of our rendering assumes incoming doubles can still be sane
28floats.
29
30Pick-to: 6.1 6.0 5.15 5.12
31Fixes: QTBUG-91507
32Change-Id: I7086a121e1b5ed47695a1251ea90e774dd8f148d
33Reviewed-by: Robert Löhning <robert.loehning@qt.io>
34Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
35Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
36---
37 src/svg/qsvghandler.cpp | 6 ++++++
38 1 file changed, 6 insertions(+)
39
40diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
41index c937254..9dac05c 100644
42--- a/src/svg/qsvghandler.cpp
43+++ b/src/svg/qsvghandler.cpp
44@@ -65,6 +65,7 @@
45 #include "private/qmath_p.h"
46
47 #include "float.h"
48+#include <cmath>
49
50 QT_BEGIN_NAMESPACE
51
52@@ -672,6 +673,9 @@ static qreal toDouble(const QChar *&str)
53 val = -val;
54 } else {
55 val = QByteArray::fromRawData(temp, pos).toDouble();
56+ // Do not tolerate values too wild to be represented normally by floats
57+ if (qFpClassify(float(val)) != FP_NORMAL)
58+ val = 0;
59 }
60 return val;
61
62@@ -3043,6 +3047,8 @@ static QSvgStyleProperty *createRadialGradientNode(QSvgNode *node,
63 ncy = toDouble(cy);
64 if (!r.isEmpty())
65 nr = toDouble(r);
66+ if (nr < 0.5)
67+ nr = 0.5;
68
69 qreal nfx = ncx;
70 if (!fx.isEmpty())
71--
722.29.2
73
diff --git a/recipes-qt/qt5/qtsvg_git.bb b/recipes-qt/qt5/qtsvg_git.bb
index 52d82653..1fe6d7c4 100644
--- a/recipes-qt/qt5/qtsvg_git.bb
+++ b/recipes-qt/qt5/qtsvg_git.bb
@@ -12,4 +12,6 @@ LIC_FILES_CHKSUM = " \
12 12
13DEPENDS += "qtbase" 13DEPENDS += "qtbase"
14 14
15SRC_URI:append = " file://CVE-2021-3481.patch"
16
15SRCREV = "52d3788c7b0116ea3db232dccca5f1e3f1e229ac" 17SRCREV = "52d3788c7b0116ea3db232dccca5f1e3f1e229ac"