Package not found: openSUSE:Containers:Tumbleweed/distribution-image.20240523154527

File 0252-libslirp-upd6-check-udp6_input-buff.patch of Package qemu-testsuite.20749

From: Jose R Ziviani <jose.ziviani@suse.com>
Date: Wed, 7 Jul 2021 11:13:50 -0600
Subject: libslirp: upd6: check udp6_input buffer size
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Git-commit: de71c15de66ba9350bf62c45b05f8fbff166517b
References: bsc#1187365, CVE-2021-3593

Fixes: CVE-2021-3593
Fixes: https://gitlab.freedesktop.org/slirp/libslirp/-/issues/45

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Jose R Ziviani <jose.ziviani@suse.com>
---
 slirp/udp6.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/slirp/udp6.c b/slirp/udp6.c
index 9fa314bc2dd2a8ffba2f296c1f14..444809a9cf96bbf1ee34e17eafe7 100644
--- a/slirp/udp6.c
+++ b/slirp/udp6.c
@@ -29,7 +29,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;
 
openSUSE Build Service is sponsored by