Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Oct 2021 21:15:53 GMT
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org
Subject:   git: ce99ac162f41 - 2021Q4 - security/openssh-portable: Bring in patch for CVE-2021-41617
Message-ID:  <202110122115.19CLFrH7094029@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch 2021Q4 has been updated by bdrewery:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ce99ac162f41d3eb620d835abb8869ba28404d20

commit ce99ac162f41d3eb620d835abb8869ba28404d20
Author:     Bryan Drewery <bdrewery@FreeBSD.org>
AuthorDate: 2021-10-12 21:12:20 +0000
Commit:     Bryan Drewery <bdrewery@FreeBSD.org>
CommitDate: 2021-10-12 21:12:20 +0000

    security/openssh-portable: Bring in patch for CVE-2021-41617
    
    Obtained from:  OpenSSH-portable git
---
 security/openssh-portable/Makefile                 |  2 +-
 ...-41617-bf944e3794eff5413f2df1ef37cddf96918c6bde | 18 ++++++++++++
 ...-41617-f3cbe43e28fe71427d41cfe3a17125b972710455 | 33 ++++++++++++++++++++++
 3 files changed, 52 insertions(+), 1 deletion(-)

diff --git a/security/openssh-portable/Makefile b/security/openssh-portable/Makefile
index b7b71af99747..59f6b06bd804 100644
--- a/security/openssh-portable/Makefile
+++ b/security/openssh-portable/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	openssh
 DISTVERSION=	8.7p1
-PORTREVISION=	1
+PORTREVISION=	2
 PORTEPOCH=	1
 CATEGORIES=	security
 MASTER_SITES=	OPENBSD/OpenSSH/portable
diff --git a/security/openssh-portable/files/patch-CVE-2021-41617-bf944e3794eff5413f2df1ef37cddf96918c6bde b/security/openssh-portable/files/patch-CVE-2021-41617-bf944e3794eff5413f2df1ef37cddf96918c6bde
new file mode 100644
index 000000000000..f8d2ccbc2605
--- /dev/null
+++ b/security/openssh-portable/files/patch-CVE-2021-41617-bf944e3794eff5413f2df1ef37cddf96918c6bde
@@ -0,0 +1,18 @@
+commit bf944e3794eff5413f2df1ef37cddf96918c6bde
+Author: Damien Miller <djm@mindrot.org>
+Date:   Mon Sep 27 00:03:19 2021 +1000
+
+    initgroups needs grp.h
+
+diff --git misc.c misc.c
+index d94438da6..0134d6949 100644
+--- misc.c
++++ misc.c
+@@ -56,6 +56,7 @@
+ #ifdef HAVE_PATHS_H
+ # include <paths.h>
+ #include <pwd.h>
++#include <grp.h>
+ #endif
+ #ifdef SSH_TUN_OPENBSD
+ #include <net/if.h>
diff --git a/security/openssh-portable/files/patch-CVE-2021-41617-f3cbe43e28fe71427d41cfe3a17125b972710455 b/security/openssh-portable/files/patch-CVE-2021-41617-f3cbe43e28fe71427d41cfe3a17125b972710455
new file mode 100644
index 000000000000..0662cee96811
--- /dev/null
+++ b/security/openssh-portable/files/patch-CVE-2021-41617-f3cbe43e28fe71427d41cfe3a17125b972710455
@@ -0,0 +1,33 @@
+commit f3cbe43e28fe71427d41cfe3a17125b972710455
+Author: djm@openbsd.org <djm@openbsd.org>
+Date:   Sun Sep 26 14:01:03 2021 +0000
+
+    upstream: need initgroups() before setresgid(); reported by anton@,
+    
+    ok deraadt@
+    
+    OpenBSD-Commit-ID: 6aa003ee658b316960d94078f2a16edbc25087ce
+
+diff --git misc.c misc.c
+index b8d1040d1..d94438da6 100644
+--- misc.c
++++ misc.c
+@@ -1,4 +1,4 @@
+-/* $OpenBSD: misc.c,v 1.169 2021/08/09 23:47:44 djm Exp $ */
++/* $OpenBSD: misc.c,v 1.170 2021/09/26 14:01:03 djm Exp $ */
+ /*
+  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
+  * Copyright (c) 2005-2020 Damien Miller.  All rights reserved.
+@@ -2695,6 +2695,12 @@ subprocess(const char *tag, const char *command,
+ 		}
+ 		closefrom(STDERR_FILENO + 1);
+ 
++		if (geteuid() == 0 &&
++		    initgroups(pw->pw_name, pw->pw_gid) == -1) {
++			error("%s: initgroups(%s, %u): %s", tag,
++			    pw->pw_name, (u_int)pw->pw_gid, strerror(errno));
++			_exit(1);
++		}
+ 		if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) == -1) {
+ 			error("%s: setresgid %u: %s", tag, (u_int)pw->pw_gid,
+ 			    strerror(errno));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202110122115.19CLFrH7094029>