public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "orbea" <orbea@riseup.net>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/libressl:master commit in: dev-qt/qtbase/, dev-qt/qtbase/files/
Date: Thu,  8 Jun 2023 18:29:31 +0000 (UTC)	[thread overview]
Message-ID: <1686248926.7ec6da79c2bf3f753580a6b311fc1d22fae8fa9e.orbea@gentoo> (raw)

commit:     7ec6da79c2bf3f753580a6b311fc1d22fae8fa9e
Author:     orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Thu Jun  8 18:21:07 2023 +0000
Commit:     orbea <orbea <AT> riseup <DOT> net>
CommitDate: Thu Jun  8 18:28:46 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=7ec6da79

dev-qt/qtbase: add 6.5.0-r3

Signed-off-by: orbea <orbea <AT> riseup.net>

 .../qtbase/files/qtbase-6.5.0-CVE-2023-33285.patch | 101 +++++++++++++++++++++
 ...base-6.5.0-r2.ebuild => qtbase-6.5.0-r3.ebuild} |   1 +
 2 files changed, 102 insertions(+)

diff --git a/dev-qt/qtbase/files/qtbase-6.5.0-CVE-2023-33285.patch b/dev-qt/qtbase/files/qtbase-6.5.0-CVE-2023-33285.patch
new file mode 100644
index 0000000..c982cce
--- /dev/null
+++ b/dev-qt/qtbase/files/qtbase-6.5.0-CVE-2023-33285.patch
@@ -0,0 +1,101 @@
+From a2dc11b37fd71f785c342c40549f54edfdd1a6f8 Mon Sep 17 00:00:00 2001
+From: Thiago Macieira <thiago.macieira@intel.com>
+Date: Thu, 11 May 2023 21:40:15 -0700
+Subject: [PATCH] QDnsLookup/Unix: make sure we don't overflow the buffer
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+The DNS Records are variable length and encode their size in 16 bits
+before the Record Data (RDATA). Ensure that both the RDATA and the
+Record header fields before it fall inside the buffer we have.
+
+Additionally reject any replies containing more than one query records.
+
+[ChangeLog][QtNetwork][QDnsLookup] Fixed a bug that could cause a buffer
+overflow in Unix systems while parsing corrupt, malicious, or truncated
+replies.
+
+Pick-to: 5.15 6.2 6.5.1
+Change-Id: I3e3bfef633af4130a03afffd175e4b9547654b95
+Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
+Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
+(cherry picked from commit 7dba2c87619d558a61a30eb30cc1d9c3fe6df94c)
+Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
+---
+ src/network/kernel/qdnslookup_unix.cpp | 31 +++++++++++++++++++++++++------
+ 1 file changed, 25 insertions(+), 6 deletions(-)
+
+diff --git a/src/network/kernel/qdnslookup_unix.cpp b/src/network/kernel/qdnslookup_unix.cpp
+index 8db79028f775..ad7bb51f67a5 100644
+--- a/src/network/kernel/qdnslookup_unix.cpp
++++ b/src/network/kernel/qdnslookup_unix.cpp
+@@ -193,7 +193,6 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
+     // responseLength in case of error, we still can extract the
+     // exact error code from the response.
+     HEADER *header = (HEADER*)response;
+-    const int answerCount = ntohs(header->ancount);
+     switch (header->rcode) {
+     case NOERROR:
+         break;
+@@ -227,18 +226,31 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
+         return;
+     }
+ 
+-    // Skip the query host, type (2 bytes) and class (2 bytes).
+     char host[PACKETSZ], answer[PACKETSZ];
+     unsigned char *p = response + sizeof(HEADER);
+-    int status = local_dn_expand(response, response + responseLength, p, host, sizeof(host));
+-    if (status < 0) {
++    int status;
++
++    if (ntohs(header->qdcount) == 1) {
++        // Skip the query host, type (2 bytes) and class (2 bytes).
++        status = local_dn_expand(response, response + responseLength, p, host, sizeof(host));
++        if (status < 0) {
++            reply->error = QDnsLookup::InvalidReplyError;
++            reply->errorString = tr("Could not expand domain name");
++            return;
++        }
++        if ((p - response) + status + 4 >= responseLength)
++            header->qdcount = 0xffff;   // invalid reply below
++        else
++            p += status + 4;
++    }
++    if (ntohs(header->qdcount) > 1) {
+         reply->error = QDnsLookup::InvalidReplyError;
+-        reply->errorString = tr("Could not expand domain name");
++        reply->errorString = tr("Invalid reply received");
+         return;
+     }
+-    p += status + 4;
+ 
+     // Extract results.
++    const int answerCount = ntohs(header->ancount);
+     int answerIndex = 0;
+     while ((p < response + responseLength) && (answerIndex < answerCount)) {
+         status = local_dn_expand(response, response + responseLength, p, host, sizeof(host));
+@@ -250,6 +262,11 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
+         const QString name = QUrl::fromAce(host);
+ 
+         p += status;
++
++        if ((p - response) + 10 > responseLength) {
++            // probably just a truncated reply, return what we have
++            return;
++        }
+         const quint16 type = (p[0] << 8) | p[1];
+         p += 2; // RR type
+         p += 2; // RR class
+@@ -257,6 +274,8 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
+         p += 4;
+         const quint16 size = (p[0] << 8) | p[1];
+         p += 2;
++        if ((p - response) + size > responseLength)
++            return;             // truncated
+ 
+         if (type == QDnsLookup::A) {
+             if (size != 4) {
+-- 
+2.16.3
+

diff --git a/dev-qt/qtbase/qtbase-6.5.0-r2.ebuild b/dev-qt/qtbase/qtbase-6.5.0-r3.ebuild
similarity index 99%
rename from dev-qt/qtbase/qtbase-6.5.0-r2.ebuild
rename to dev-qt/qtbase/qtbase-6.5.0-r3.ebuild
index 08f45a6..8f12328 100644
--- a/dev-qt/qtbase/qtbase-6.5.0-r2.ebuild
+++ b/dev-qt/qtbase/qtbase-6.5.0-r3.ebuild
@@ -107,6 +107,7 @@ PATCHES=(
 	"${FILESDIR}/${PN}-6.5.0-libressl.patch"
 	"${FILESDIR}/${PN}-6.5.0-setActiveWindow-deprecated-version.patch"
 	"${FILESDIR}/${PN}-6.5.0-CVE-2023-32762.patch"
+	"${FILESDIR}/${PN}-6.5.0-CVE-2023-33285.patch"
 )
 
 src_configure() {


             reply	other threads:[~2023-06-08 18:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08 18:29 orbea [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-09-30 15:23 [gentoo-commits] repo/proj/libressl:master commit in: dev-qt/qtbase/, dev-qt/qtbase/files/ orbea
2025-07-31 14:18 orbea
2025-07-14 19:18 orbea
2025-07-14 19:18 orbea
2025-06-28 22:36 orbea
2025-06-06  1:10 orbea
2025-04-23 15:02 orbea
2025-01-31 15:46 orbea
2025-01-31 15:46 orbea
2024-09-25 23:52 orbea
2024-08-26 22:47 orbea
2024-08-24 15:09 orbea
2024-08-13 16:16 orbea
2024-05-24 13:18 orbea
2024-04-05 16:50 orbea
2024-03-27 20:03 orbea
2024-02-25  2:42 orbea
2024-01-09 15:48 orbea
2023-12-06  4:58 orbea
2023-10-22 16:54 orbea
2023-06-13  3:27 orbea
2023-01-31 23:14 Quentin Retornaz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1686248926.7ec6da79c2bf3f753580a6b311fc1d22fae8fa9e.orbea@gentoo \
    --to=orbea@riseup.net \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox