openssh: Unregister the KEXINIT handler after message has been
authorPeter Wagner <tripolar@gmx.at>
Mon, 17 Oct 2016 19:26:26 +0000 (21:26 +0200)
committerPeter Wagner <tripolar@gmx.at>
Mon, 17 Oct 2016 19:26:26 +0000 (21:26 +0200)
received. Otherwise an unauthenticated peer can repeat the KEXINIT and cause
allocation of up to 128MB -- until the connection is closed. Reported by
shilei-c at 360.cn

https://github.com/openssh/openssh-portable/commit/ec165c392ca54317dbe3064a8c200de6531e89ad

Signed-off-by: Peter Wagner <tripolar@gmx.at>
net/openssh/Makefile
net/openssh/patches/101-Unregister-the-KEXINIT-handler-after-receive.patch [new file with mode: 0644]

index 10eb434f5b5e253a3861e97f17b1a2a880c43af2..73e7e676593a9ee06ab47fa7ed5750a33e6390f3 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssh
 PKG_VERSION:=7.3p1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
diff --git a/net/openssh/patches/101-Unregister-the-KEXINIT-handler-after-receive.patch b/net/openssh/patches/101-Unregister-the-KEXINIT-handler-after-receive.patch
new file mode 100644 (file)
index 0000000..f7b41dc
--- /dev/null
@@ -0,0 +1,18 @@
+diff --git a/kex.c b/kex.c
+index 50c7a0f..d09c27b 100644
+--- a/kex.c
++++ b/kex.c
+@@ -1,4 +1,4 @@
+-/* $OpenBSD: kex.c,v 1.118 2016/05/02 10:26:04 djm Exp $ */
++/* $OpenBSD: kex.c,v 1.127 2016/10/10 19:28:48 markus Exp $ */
+ /*
+  * Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.
+  *
+@@ -472,6 +472,7 @@ kex_input_kexinit(int type, u_int32_t seq, void *ctxt)
+       if (kex == NULL)
+               return SSH_ERR_INVALID_ARGUMENT;
++      ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, NULL);
+       ptr = sshpkt_ptr(ssh, &dlen);
+       if ((r = sshbuf_put(kex->peer, ptr, dlen)) != 0)
+               return r;