thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-slirp-fix-big-little-endian-conversion-in-ident-prot.patch

3f5fa1
From 6e4dad9d915f8de71e1695720398160c97e8ebd0 Mon Sep 17 00:00:00 2001
3f5fa1
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
3f5fa1
Date: Mon, 20 May 2019 17:00:53 +0200
3f5fa1
Subject: [PATCH 2/4] slirp: fix big/little endian conversion in ident protocol
3f5fa1
MIME-Version: 1.0
3f5fa1
Content-Type: text/plain; charset=UTF-8
3f5fa1
Content-Transfer-Encoding: 8bit
3f5fa1
3f5fa1
RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
3f5fa1
Message-id: <20190520170055.15404-3-marcandre.lureau@redhat.com>
3f5fa1
Patchwork-id: 88100
3f5fa1
O-Subject: [RHEL-7.6.z qemu-kvm PATCH 2/4] slirp: fix big/little endian conversion in ident protocol
3f5fa1
Bugzilla: 1669067
3f5fa1
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
3f5fa1
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
3f5fa1
RH-Acked-by: Thomas Huth <thuth@redhat.com>
3f5fa1
3f5fa1
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
3f5fa1
3f5fa1
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
3f5fa1
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
3f5fa1
3f5fa1
[ MA - backported to ease backport of CVE-2019-6778 ]
3f5fa1
3f5fa1
(cherry picked from commit 1fd71067dae501f1c78618e9583c6cc72db0cfa6)
3f5fa1
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
3f5fa1
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
3f5fa1
---
3f5fa1
 slirp/tcp_subr.c | 4 +++-
3f5fa1
 1 file changed, 3 insertions(+), 1 deletion(-)
3f5fa1
3f5fa1
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
3f5fa1
index 0b7138b..80538a9 100644
3f5fa1
--- a/slirp/tcp_subr.c
3f5fa1
+++ b/slirp/tcp_subr.c
3f5fa1
@@ -601,10 +601,12 @@ tcp_emu(struct socket *so, struct mbuf *m)
3f5fa1
 						    tmpso->so_fport == n1) {
3f5fa1
 							if (getsockname(tmpso->s,
3f5fa1
 								(struct sockaddr *)&addr, &addrlen) == 0)
3f5fa1
-							   n2 = ntohs(addr.sin_port);
3f5fa1
+							   n2 = addr.sin_port;
3f5fa1
 							break;
3f5fa1
 						}
3f5fa1
 					}
3f5fa1
+					NTOHS(n1);
3f5fa1
+					NTOHS(n2);
3f5fa1
 					so_rcv->sb_cc = snprintf(so_rcv->sb_data,
3f5fa1
 								 so_rcv->sb_datalen,
3f5fa1
 								 "%d,%d\r\n", n1, n2);
3f5fa1
-- 
3f5fa1
1.8.3.1
3f5fa1