[oe-commits] Jonathan Liu : qt4: add patch for BMP denial-of-service vulnerability

git at git.openembedded.org git at git.openembedded.org
Tue Mar 10 12:09:40 UTC 2015


Module: openembedded-core.git
Branch: daisy
Commit: 4c61140ae04b3957bec12b18863d8ff39b81b396
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=4c61140ae04b3957bec12b18863d8ff39b81b396

Author: Jonathan Liu <net147 at gmail.com>
Date:   Thu Mar  5 07:57:39 2015 +1100

qt4: add patch for BMP denial-of-service vulnerability

For further details, see:
https://bugreports.qt.io/browse/QTBUG-44547

Signed-off-by: Jonathan Liu <net147 at gmail.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/recipes-qt/qt4/qt4-4.8.5.inc                  |  1 +
 ...ion-by-zero-when-processing-malformed-BMP.patch | 44 ++++++++++++++++++++++
 2 files changed, 45 insertions(+)

diff --git a/meta/recipes-qt/qt4/qt4-4.8.5.inc b/meta/recipes-qt/qt4/qt4-4.8.5.inc
index 843ad7a..f364a78 100644
--- a/meta/recipes-qt/qt4/qt4-4.8.5.inc
+++ b/meta/recipes-qt/qt4/qt4-4.8.5.inc
@@ -26,6 +26,7 @@ SRC_URI = "http://download.qt-project.org/archive/qt/4.8/${PV}/qt-everywhere-ope
            file://0024-Ensure-lastPixel.y-is-also-initalized-to-1-when-nece.patch \
            file://0025-Fix-misaligned-selection-region-with-text-when-cente.patch \
            file://0027-tools.pro-disable-qmeegographicssystemhelper.patch \
+           file://0028-Fix-a-division-by-zero-when-processing-malformed-BMP.patch \
            file://g++.conf \
            file://linux.conf \
            "
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0028-Fix-a-division-by-zero-when-processing-malformed-BMP.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0028-Fix-a-division-by-zero-when-processing-malformed-BMP.patch
new file mode 100644
index 0000000..8ff4ad5
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.5/0028-Fix-a-division-by-zero-when-processing-malformed-BMP.patch
@@ -0,0 +1,44 @@
+From e50aa2252cdd5cb53eef7d8c4503c7edff634f68 Mon Sep 17 00:00:00 2001
+From: "Richard J. Moore" <rich at kde.org>
+Date: Tue, 24 Feb 2015 19:02:35 +0000
+Subject: [PATCH] Fix a division by zero when processing malformed BMP files.
+
+This fixes a division by 0 when processing a maliciously crafted BMP
+file. No impact beyond DoS.
+
+Backport of 661f6bfd032dacc62841037732816a583640e187
+
+Upstream-Status: Backport
+
+Task-number: QTBUG-44547
+Change-Id: I43f06e752b11cb50669101460902a82b885ae618
+Reviewed-by: Thiago Macieira <thiago.macieira at intel.com>
+Signed-off-by: Jonathan Liu <net147 at gmail.com>
+---
+ src/gui/image/qbmphandler.cpp | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp
+index b22e842..30fa9e0 100644
+--- a/src/gui/image/qbmphandler.cpp
++++ b/src/gui/image/qbmphandler.cpp
+@@ -319,10 +319,16 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int
+         }
+     } else if (comp == BMP_BITFIELDS && (nbits == 16 || nbits == 32)) {
+         red_shift = calc_shift(red_mask);
++        if (((red_mask >> red_shift) + 1) == 0)
++            return false;
+         red_scale = 256 / ((red_mask >> red_shift) + 1);
+         green_shift = calc_shift(green_mask);
++        if (((green_mask >> green_shift) + 1) == 0)
++            return false;
+         green_scale = 256 / ((green_mask >> green_shift) + 1);
+         blue_shift = calc_shift(blue_mask);
++        if (((blue_mask >> blue_shift) + 1) == 0)
++            return false;
+         blue_scale = 256 / ((blue_mask >> blue_shift) + 1);
+     } else if (comp == BMP_RGB && (nbits == 24 || nbits == 32)) {
+         blue_mask = 0x000000ff;
+-- 
+2.3.1
+



More information about the Openembedded-commits mailing list