Skip to contentSkip to conversation

qemu: fix CVE-2021-3592

PATCH In review Sakib Sajal 2 participants 8 messages Jan 14, 2022 – Jan 15, 2022 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/8 qemu: fix CVE-2021-3592

---
 meta/recipes-devtools/qemu/qemu.inc           |   3 +
 .../qemu/qemu/CVE-2021-3592_1.patch           |  58 ++++++
 .../qemu/qemu/CVE-2021-3592_2.patch           | 165 ++++++++++++++++++
 .../qemu/qemu/CVE-2021-3592_3.patch           |  40 +++++
 4 files changed, 266 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-3592_1.patch
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-3592_2.patch
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-3592_3.patch
meta/recipes-devtools/qemu/qemu.inc +3 -0
index 463339e42b..6c00bf274b 100644
@@ -70,6 +70,9 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
            file://CVE-2021-3607.patch \
            file://CVE-2021-3608.patch \
            file://CVE-2021-3682.patch \
+           file://CVE-2021-3592_1.patch \
+           file://CVE-2021-3592_2.patch \
+           file://CVE-2021-3592_3.patch \
            "
 UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
 
meta/recipes-devtools/qemu/qemu/CVE-2021-3592_1.patch new file +58 -0

58 lines not on this page · raw message

meta/recipes-devtools/qemu/qemu/CVE-2021-3592_2.patch new file +165 -0

165 lines not on this page · raw message

meta/recipes-devtools/qemu/qemu/CVE-2021-3592_3.patch new file +40 -0
new file mode 100644
index 0000000000..f07a0faeb7
@@ -0,0 +1,40 @@
+From d175694c607273b6c8f09717de9c455891d6765d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <[email protected]>
+Date: Fri, 4 Jun 2021 16:15:14 +0400
+Subject: [PATCH 03/12] bootp: check bootp_input buffer size
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes: CVE-2021-3592
+Fixes: https://gitlab.freedesktop.org/slirp/libslirp/-/issues/44
+
+Signed-off-by: Marc-André Lureau <[email protected]>
+
+Upstream-Status: Backport [2eca0838eee1da96204545e22cdaed860d9d7c6c]
+CVE: CVE-2021-3592
+
+Signed-off-by: Sakib Sajal <[email protected]>
+---
+ slirp/src/bootp.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/slirp/src/bootp.c b/slirp/src/bootp.c
+index e0db8d196..cafa1eb1f 100644
+--- a/slirp/src/bootp.c
++++ b/slirp/src/bootp.c
+@@ -365,9 +365,9 @@ static void bootp_reply(Slirp *slirp,
+ 
+ void bootp_input(struct mbuf *m)
+ {
+-    struct bootp_t *bp = mtod(m, struct bootp_t *);
++    struct bootp_t *bp = mtod_check(m, sizeof(struct bootp_t));
+ 
+-    if (bp->bp_op == BOOTP_REQUEST) {
++    if (bp && bp->bp_op == BOOTP_REQUEST) {
+         bootp_reply(m->slirp, bp, m_end(m));
+     }
+ }
+-- 
+2.31.1
+
Signature · 1 line
2.33.0
#1 lore raw

PATCH 2/8 qemu: fix CVE-2021-3593

---
 meta/recipes-devtools/qemu/qemu.inc           |  1 +
 .../qemu/qemu/CVE-2021-3593.patch             | 40 +++++++++++++++++++
 2 files changed, 41 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-3593.patch
meta/recipes-devtools/qemu/qemu.inc +1 -0
index 6c00bf274b..6b544a4344 100644
@@ -73,6 +73,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
            file://CVE-2021-3592_1.patch \
            file://CVE-2021-3592_2.patch \
            file://CVE-2021-3592_3.patch \
+           file://CVE-2021-3593.patch \
            "
 UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
 
meta/recipes-devtools/qemu/qemu/CVE-2021-3593.patch new file +40 -0
new file mode 100644
index 0000000000..dd14c240a8
@@ -0,0 +1,40 @@
+From fe99634066e1074aaf55e83b576385877d7e4bcc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <[email protected]>
+Date: Fri, 4 Jun 2021 16:32:55 +0400
+Subject: [PATCH 04/12] upd6: check udp6_input buffer size
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes: CVE-2021-3593
+Fixes: https://gitlab.freedesktop.org/slirp/libslirp/-/issues/45
+
+Signed-off-by: Marc-André Lureau <[email protected]>
+
+Upstream-Status: Backport [de71c15de66ba9350bf62c45b05f8fbff166517b]
+CVE: CVE-2021-3593
+
+Signed-off-by: Sakib Sajal <[email protected]>
+---
+ slirp/src/udp6.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/slirp/src/udp6.c b/slirp/src/udp6.c
+index 6f9486bbc..8c490e4d1 100644
+--- a/slirp/src/udp6.c
++++ b/slirp/src/udp6.c
+@@ -28,7 +28,10 @@ void udp6_input(struct mbuf *m)
+     ip = mtod(m, struct ip6 *);
+     m->m_len -= iphlen;
+     m->m_data += iphlen;
+-    uh = mtod(m, struct udphdr *);
++    uh = mtod_check(m, sizeof(struct udphdr));
++    if (uh == NULL) {
++        goto bad;
++    }
+     m->m_len += iphlen;
+     m->m_data -= iphlen;
+ 
+-- 
+2.31.1
+
Signature · 1 line
2.33.0
#2 lore raw

PATCH 4/8 qemu: fix CVE-2021-3594

In reply to Sakib Sajal
---
 meta/recipes-devtools/qemu/qemu.inc           |  1 +
 .../qemu/qemu/CVE-2021-3594.patch             | 40 +++++++++++++++++++
 2 files changed, 41 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-3594.patch
meta/recipes-devtools/qemu/qemu.inc +1 -0
index 811bdff426..4198d3a52c 100644
@@ -76,6 +76,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
            file://CVE-2021-3593.patch \
            file://CVE-2021-3595_1.patch \
            file://CVE-2021-3595_2.patch \
+           file://CVE-2021-3594.patch \
            "
 UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
 
meta/recipes-devtools/qemu/qemu/CVE-2021-3594.patch new file +40 -0
new file mode 100644
index 0000000000..c99ba7a7cc
@@ -0,0 +1,40 @@
+From 7a5ffd5475f2cbfe3cf91d9584893f1a4b3b4dff Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <[email protected]>
+Date: Fri, 4 Jun 2021 16:40:23 +0400
+Subject: [PATCH 07/12] udp: check upd_input buffer size
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes: CVE-2021-3594
+Fixes: https://gitlab.freedesktop.org/slirp/libslirp/-/issues/47
+
+Signed-off-by: Marc-André Lureau <[email protected]>
+
+Upstream-Status: Backport [74572be49247c8c5feae7c6e0b50c4f569ca9824]
+CVE: CVE-2021-3594
+
+Signed-off-by: Sakib Sajal <[email protected]>
+---
+ slirp/src/udp.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/slirp/src/udp.c b/slirp/src/udp.c
+index 0ad44d7c0..18b4acdfa 100644
+--- a/slirp/src/udp.c
++++ b/slirp/src/udp.c
+@@ -93,7 +93,10 @@ void udp_input(register struct mbuf *m, int iphlen)
+     /*
+      * Get IP and UDP header together in first mbuf.
+      */
+-    ip = mtod(m, struct ip *);
++    ip = mtod_check(m, iphlen + sizeof(struct udphdr));
++    if (ip == NULL) {
++        goto bad;
++    }
+     uh = (struct udphdr *)((char *)ip + iphlen);
+ 
+     /*
+-- 
+2.31.1
+
Signature · 1 line
2.33.0
#3 lore raw

PATCH 6/8 qemu: fix CVE-2021-3748

In reply to Sakib Sajal
---
 meta/recipes-devtools/qemu/qemu.inc           |   1 +
 .../qemu/qemu/CVE-2021-3748.patch             | 127 ++++++++++++++++++
 2 files changed, 128 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-3748.patch
meta/recipes-devtools/qemu/qemu.inc +1 -0
index 970aa96608..7648ce9a38 100644
@@ -78,6 +78,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
            file://CVE-2021-3595_2.patch \
            file://CVE-2021-3594.patch \
            file://CVE-2021-3713.patch \
+           file://CVE-2021-3748.patch \
            "
 UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
 
meta/recipes-devtools/qemu/qemu/CVE-2021-3748.patch new file +127 -0

127 lines not on this page · raw message

Signature · 1 line
2.33.0
#4 lore raw

PATCH 8/8 qemu: fix CVE-2021-20196

In reply to Sakib Sajal
---
 meta/recipes-devtools/qemu/qemu.inc           |  2 +
 .../qemu/qemu/CVE-2021-20196_1.patch          | 54 +++++++++++++++
 .../qemu/qemu/CVE-2021-20196_2.patch          | 67 +++++++++++++++++++
 3 files changed, 123 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-20196_1.patch
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-20196_2.patch
meta/recipes-devtools/qemu/qemu.inc +2 -0
index 4a5379893c..3401fd7194 100644
@@ -80,6 +80,8 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
            file://CVE-2021-3713.patch \
            file://CVE-2021-3748.patch \
            file://CVE-2021-3930.patch \
+           file://CVE-2021-20196_1.patch \
+           file://CVE-2021-20196_2.patch \
            "
 UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
 
meta/recipes-devtools/qemu/qemu/CVE-2021-20196_1.patch new file +54 -0

54 lines not on this page · raw message

meta/recipes-devtools/qemu/qemu/CVE-2021-20196_2.patch new file +67 -0

67 lines not on this page · raw message

Signature · 1 line
2.33.0

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Re: [OE-core] [hardknott][PATCH 4/8] qemu: fix CVE-2021-3594

Please disregard, sorry for the barrage of incomplete patch set.

Quoted 74 lines · Sakib Sajal
---
  meta/recipes-devtools/qemu/qemu.inc           |  1 +
  .../qemu/qemu/CVE-2021-3594.patch             | 40 +++++++++++++++++++
  2 files changed, 41 insertions(+)

create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-3594.patch

meta/recipes-devtools/qemu/qemu.inc +1 -0
index 811bdff426..4198d3a52c 100644
@@ -76,6 +76,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
             file://CVE-2021-3593.patch \
             file://CVE-2021-3595_1.patch \
             file://CVE-2021-3595_2.patch \
+           file://CVE-2021-3594.patch \
             "
  UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
 
meta/recipes-devtools/qemu/qemu/CVE-2021-3594.patch new file +40 -1
new file mode 100644
index 0000000000..c99ba7a7cc
@@ -0,0 +1,40 @@
+From 7a5ffd5475f2cbfe3cf91d9584893f1a4b3b4dff Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <[email protected]>
+Date: Fri, 4 Jun 2021 16:40:23 +0400
+Subject: [PATCH 07/12] udp: check upd_input buffer size
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes: CVE-2021-3594
+Fixes: https://gitlab.freedesktop.org/slirp/libslirp/-/issues/47
+
+Signed-off-by: Marc-André Lureau <[email protected]>
+
+Upstream-Status: Backport [74572be49247c8c5feae7c6e0b50c4f569ca9824]
+CVE: CVE-2021-3594
+
+Signed-off-by: Sakib Sajal <[email protected]>
+---
+ slirp/src/udp.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/slirp/src/udp.c b/slirp/src/udp.c
+index 0ad44d7c0..18b4acdfa 100644
+--- a/slirp/src/udp.c
++++ b/slirp/src/udp.c
+@@ -93,7 +93,10 @@ void udp_input(register struct mbuf *m, int iphlen)
+     /*
+      * Get IP and UDP header together in first mbuf.
+      */
+-    ip = mtod(m, struct ip *);
++    ip = mtod_check(m, iphlen + sizeof(struct udphdr));
++    if (ip == NULL) {
++        goto bad;
++    }
+     uh = (struct udphdr *)((char *)ip + iphlen);
+
+     /*
+--
+2.31.1
+
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#160576): https://lists.openembedded.org/g/openembedded-core/message/160576
Mute This Topic: https://lists.openembedded.org/mt/88426915/4422444
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw

Re: [OE-core] [hardknott][PATCH 2/8] qemu: fix CVE-2021-3593

Please disregard, sorry for the barrage of incomplete patch set.

Quoted 74 lines · Sakib Sajal
---
  meta/recipes-devtools/qemu/qemu.inc           |  1 +
  .../qemu/qemu/CVE-2021-3593.patch             | 40 +++++++++++++++++++
  2 files changed, 41 insertions(+)

create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021-3593.patch

meta/recipes-devtools/qemu/qemu.inc +1 -0
index 6c00bf274b..6b544a4344 100644
@@ -73,6 +73,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
             file://CVE-2021-3592_1.patch \
             file://CVE-2021-3592_2.patch \
             file://CVE-2021-3592_3.patch \
+           file://CVE-2021-3593.patch \
             "
  UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
 
meta/recipes-devtools/qemu/qemu/CVE-2021-3593.patch new file +40 -1
new file mode 100644
index 0000000000..dd14c240a8
@@ -0,0 +1,40 @@
+From fe99634066e1074aaf55e83b576385877d7e4bcc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <[email protected]>
+Date: Fri, 4 Jun 2021 16:32:55 +0400
+Subject: [PATCH 04/12] upd6: check udp6_input buffer size
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes: CVE-2021-3593
+Fixes: https://gitlab.freedesktop.org/slirp/libslirp/-/issues/45
+
+Signed-off-by: Marc-André Lureau <[email protected]>
+
+Upstream-Status: Backport [de71c15de66ba9350bf62c45b05f8fbff166517b]
+CVE: CVE-2021-3593
+
+Signed-off-by: Sakib Sajal <[email protected]>
+---
+ slirp/src/udp6.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/slirp/src/udp6.c b/slirp/src/udp6.c
+index 6f9486bbc..8c490e4d1 100644
+--- a/slirp/src/udp6.c
++++ b/slirp/src/udp6.c
+@@ -28,7 +28,10 @@ void udp6_input(struct mbuf *m)
+     ip = mtod(m, struct ip6 *);
+     m->m_len -= iphlen;
+     m->m_data += iphlen;
+-    uh = mtod(m, struct udphdr *);
++    uh = mtod_check(m, sizeof(struct udphdr));
++    if (uh == NULL) {
++        goto bad;
++    }
+     m->m_len += iphlen;
+     m->m_data -= iphlen;
+
+--
+2.31.1
+
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#160575): https://lists.openembedded.org/g/openembedded-core/message/160575
Mute This Topic: https://lists.openembedded.org/mt/88426914/4422444
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#9 lore raw

Re: [OE-core] [hardknott][PATCH 2/8] qemu: fix CVE-2021-3593

Quoted 1 line · Sakib Sajal

Please disregard, sorry for the barrage of incomplete patch set.

Do you also have a branch on contrib that I can pull these patches from?

Thanks,

Anuj

Quoted 91 lines · Sakib Sajal

Quoted 73 lines

---
 meta/recipes-devtools/qemu/qemu.inc | 1 +
 .../qemu/qemu/CVE-2021-3593.patch | 40
+++++++++++++++++++

 2 files changed, 41 insertions(+)

 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2021- 3593.patch

meta/recipes- renamed from meta/recipes-devtools/qemu/qemu.inc +0 -0

devtools/qemu/qemu.inc
index 6c00bf274b..6b544a4344 100644

meta/recipes-devtools/qemu/qemu.inc +1 -0
@@ -73,6 +73,7 @@ SRC_URI =
 "https://download.qemu.org/${BPN}-${PV}.tar.xz \
             file://CVE-2021-3592_1.patch \
             file://CVE-2021-3592_2.patch \
             file://CVE-2021-3592_3.patch \
+           file://CVE-2021-3593.patch \

            "
 UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"

meta/recipes-devtools/qemu/qemu/CVE-2021-3593.patch new file +1 -0
new file mode 100644
index 0000000000..dd14c240a8
@@ -0,0 +1,40 @@
+From fe99634066e1074aaf55e83b576385877d7e4bcc Mon Sep 17 00:00:00

2001
+From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?=
<[email protected]>

meta/recipes-devtools/qemu/qemu/CVE-2021-3593.patch new file +12 -0
+Date: Fri, 4 Jun 2021 16:32:55 +0400
+Subject: [PATCH 04/12] upd6: check udp6_input buffer size
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes: CVE-2021-3593
+Fixes: https://gitlab.freedesktop.org/slirp/libslirp/-/issues/45
+
+Signed-off-by: Marc-André Lureau <[email protected]>
+
+Upstream-Status: Backport

[de71c15de66ba9350bf62c45b05f8fbff166517b]

meta/recipes-devtools/qemu/qemu/CVE-2021-3593.patch new file +26 -0
+CVE: CVE-2021-3593
+
+Signed-off-by: Sakib Sajal <[email protected]>
+---
+ slirp/src/udp6.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/slirp/src/udp6.c b/slirp/src/udp6.c
+index 6f9486bbc..8c490e4d1 100644
+--- a/slirp/src/udp6.c
++++ b/slirp/src/udp6.c
+@@ -28,7 +28,10 @@ void udp6_input(struct mbuf *m)
+     ip = mtod(m, struct ip6 *);
+     m->m_len -= iphlen;
+     m->m_data += iphlen;
+-    uh = mtod(m, struct udphdr *);
++    uh = mtod_check(m, sizeof(struct udphdr));
++    if (uh == NULL) {
++        goto bad;
++    }
+     m->m_len += iphlen;
+     m->m_data -= iphlen;
+ 
+-- 
+2.31.1
+
Quoted 4 lines


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#160583):
https://lists.openembedded.org/g/openembedded-core/message/160583
Mute This Topic: https://lists.openembedded.org/mt/88427080/3616702
Group Owner: [email protected] Unsubscribe:
https://lists.openembedded.org/g/openembedded-core/unsub [
[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-