Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Aug 2016 19:29:00 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r305081 - in projects/clang390-import: cddl/contrib/opensolaris/common/ctf contrib/netbsd-tests/usr.bin/dirname contrib/telnet/libtelnet crypto/openssh lib/atf/libatf-c lib/atf/libatf-c...
Message-ID:  <201608301929.u7UJT03h020859@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Tue Aug 30 19:29:00 2016
New Revision: 305081
URL: https://svnweb.freebsd.org/changeset/base/305081

Log:
  Merge ^/head r305029 through r305080.

Added:
  projects/clang390-import/crypto/openssh/blacklist.c
     - copied unchanged from r305080, head/crypto/openssh/blacklist.c
  projects/clang390-import/crypto/openssh/blacklist_client.h
     - copied unchanged from r305080, head/crypto/openssh/blacklist_client.h
Modified:
  projects/clang390-import/cddl/contrib/opensolaris/common/ctf/ctf_types.c
  projects/clang390-import/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh
  projects/clang390-import/contrib/telnet/libtelnet/pk.c
  projects/clang390-import/crypto/openssh/auth-pam.c
  projects/clang390-import/crypto/openssh/auth.c
  projects/clang390-import/crypto/openssh/auth1.c
  projects/clang390-import/crypto/openssh/auth2.c
  projects/clang390-import/crypto/openssh/packet.c
  projects/clang390-import/crypto/openssh/servconf.c
  projects/clang390-import/crypto/openssh/servconf.h
  projects/clang390-import/crypto/openssh/sshd.c
  projects/clang390-import/crypto/openssh/sshd_config
  projects/clang390-import/crypto/openssh/sshd_config.5
  projects/clang390-import/lib/atf/libatf-c++/Makefile
  projects/clang390-import/lib/atf/libatf-c/Makefile
  projects/clang390-import/lib/libdevctl/devctl.3
  projects/clang390-import/lib/libdevctl/devctl.c
  projects/clang390-import/lib/libdevctl/devctl.h
  projects/clang390-import/sbin/newfs_msdos/mkfs_msdos.c
  projects/clang390-import/secure/usr.sbin/sshd/Makefile
  projects/clang390-import/secure/usr.sbin/sshd/Makefile.depend
  projects/clang390-import/share/man/man9/mbuf.9
  projects/clang390-import/sys/arm/allwinner/aw_wdog.c
  projects/clang390-import/sys/arm/ti/ti_pruss.c
  projects/clang390-import/sys/arm64/arm64/pmap.c
  projects/clang390-import/sys/boot/powerpc/boot1.chrp/boot1.c
  projects/clang390-import/sys/dev/cxgbe/t4_iov.c
  projects/clang390-import/sys/dev/hyperv/netvsc/hv_net_vsc.c
  projects/clang390-import/sys/dev/hyperv/netvsc/hv_net_vsc.h
  projects/clang390-import/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  projects/clang390-import/sys/dev/hyperv/netvsc/hv_rndis.h
  projects/clang390-import/sys/dev/hyperv/netvsc/hv_rndis_filter.c
  projects/clang390-import/sys/dev/hyperv/netvsc/hv_rndis_filter.h
  projects/clang390-import/sys/dev/hyperv/netvsc/if_hnvar.h
  projects/clang390-import/sys/dev/hyperv/netvsc/ndis.h
  projects/clang390-import/sys/dev/iscsi_initiator/iscsi.h
  projects/clang390-import/sys/dev/kbdmux/kbdmux.c
  projects/clang390-import/sys/dev/syscons/syscons.c
  projects/clang390-import/sys/dev/tsec/if_tsec.h
  projects/clang390-import/sys/dev/tsec/if_tsec_fdt.c
  projects/clang390-import/sys/dev/usb/net/if_urndis.c
  projects/clang390-import/sys/kern/subr_bus.c
  projects/clang390-import/sys/kern/subr_smp.c
  projects/clang390-import/sys/net/rndis.h
  projects/clang390-import/sys/powerpc/mpc85xx/platform_mpc85xx.c
  projects/clang390-import/sys/sys/bus.h
  projects/clang390-import/sys/sys/mbuf.h
  projects/clang390-import/sys/vm/swap_pager.c
  projects/clang390-import/sys/vm/vm_page.c
  projects/clang390-import/tools/tools/crypto/cryptotest.c
  projects/clang390-import/usr.bin/newkey/generic.c
  projects/clang390-import/usr.sbin/bhyve/pci_e82545.c
  projects/clang390-import/usr.sbin/devctl/devctl.8
  projects/clang390-import/usr.sbin/devctl/devctl.c
Directory Properties:
  projects/clang390-import/   (props changed)
  projects/clang390-import/cddl/   (props changed)
  projects/clang390-import/cddl/contrib/opensolaris/   (props changed)
  projects/clang390-import/crypto/openssh/   (props changed)

Modified: projects/clang390-import/cddl/contrib/opensolaris/common/ctf/ctf_types.c
==============================================================================
--- projects/clang390-import/cddl/contrib/opensolaris/common/ctf/ctf_types.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/cddl/contrib/opensolaris/common/ctf/ctf_types.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -644,11 +644,8 @@ ctf_type_compat(ctf_file_t *lfp, ctf_id_
 	}
 }
 
-/*
- * Return the type and offset for a given member of a STRUCT or UNION.
- */
-int
-ctf_member_info(ctf_file_t *fp, ctf_id_t type, const char *name,
+static int
+_ctf_member_info(ctf_file_t *fp, ctf_id_t type, const char *name, ulong_t off,
     ctf_membinfo_t *mip)
 {
 	ctf_file_t *ofp = fp;
@@ -673,9 +670,13 @@ ctf_member_info(ctf_file_t *fp, ctf_id_t
 		    ((uintptr_t)tp + increment);
 
 		for (n = LCTF_INFO_VLEN(fp, tp->ctt_info); n != 0; n--, mp++) {
+			if (mp->ctm_name == 0 &&
+			    _ctf_member_info(fp, mp->ctm_type, name,
+			    mp->ctm_offset + off, mip) == 0)
+				return (0);
 			if (strcmp(ctf_strptr(fp, mp->ctm_name), name) == 0) {
 				mip->ctm_type = mp->ctm_type;
-				mip->ctm_offset = mp->ctm_offset;
+				mip->ctm_offset = mp->ctm_offset + off;
 				return (0);
 			}
 		}
@@ -684,9 +685,14 @@ ctf_member_info(ctf_file_t *fp, ctf_id_t
 		    ((uintptr_t)tp + increment);
 
 		for (n = LCTF_INFO_VLEN(fp, tp->ctt_info); n != 0; n--, lmp++) {
+			if (lmp->ctlm_name == 0 &&
+			    _ctf_member_info(fp, lmp->ctlm_name, name,
+			    (ulong_t)CTF_LMEM_OFFSET(lmp) + off, mip) == 0)
+				return (0);
 			if (strcmp(ctf_strptr(fp, lmp->ctlm_name), name) == 0) {
 				mip->ctm_type = lmp->ctlm_type;
-				mip->ctm_offset = (ulong_t)CTF_LMEM_OFFSET(lmp);
+				mip->ctm_offset =
+				    (ulong_t)CTF_LMEM_OFFSET(lmp) + off;
 				return (0);
 			}
 		}
@@ -696,6 +702,17 @@ ctf_member_info(ctf_file_t *fp, ctf_id_t
 }
 
 /*
+ * Return the type and offset for a given member of a STRUCT or UNION.
+ */
+int
+ctf_member_info(ctf_file_t *fp, ctf_id_t type, const char *name,
+    ctf_membinfo_t *mip)
+{
+
+	return (_ctf_member_info(fp, type, name, 0, mip));
+}
+
+/*
  * Return the array type, index, and size information for the specified ARRAY.
  */
 int

Modified: projects/clang390-import/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh
==============================================================================
--- projects/clang390-import/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/contrib/netbsd-tests/usr.bin/dirname/t_dirname.sh	Tue Aug 30 19:29:00 2016	(r305081)
@@ -33,7 +33,7 @@ basic_head()
 basic_body()
 {
 	# Begin FreeBSD
-	atf_tc_expect_fail "dirname //usr//bin doesn't return //usr like it used to; bug # 212193"
+	atf_expect_fail "dirname //usr//bin doesn't return //usr like it used to; bug # 212193"
 	# End FreeBSD
 	atf_check -o inline:"/\n" dirname /
 	atf_check -o inline:"/\n" dirname //

Modified: projects/clang390-import/contrib/telnet/libtelnet/pk.c
==============================================================================
--- projects/clang390-import/contrib/telnet/libtelnet/pk.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/contrib/telnet/libtelnet/pk.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -164,7 +164,7 @@ genkeys(char *public, char *secret)
         MINT *pk = mp_itom(0);
         MINT *sk = mp_itom(0);
         MINT *tmp;
-        MINT *base = mp_itom(BASE);
+        MINT *base = mp_itom((short)BASE);
         MINT *root = mp_itom(PROOT);
         MINT *modulus = mp_xtom(HEXMODULUS);
         short r;

Modified: projects/clang390-import/crypto/openssh/auth-pam.c
==============================================================================
--- projects/clang390-import/crypto/openssh/auth-pam.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/crypto/openssh/auth-pam.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -98,6 +98,7 @@
 #include "ssh-gss.h"
 #endif
 #include "monitor_wrap.h"
+#include "blacklist_client.h"
 
 extern ServerOptions options;
 extern Buffer loginmsg;
@@ -794,6 +795,7 @@ sshpam_query(void *ctx, char **name, cha
 				free(msg);
 				return (0);
 			}
+			BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL);
 			error("PAM: %s for %s%.100s from %.100s", msg,
 			    sshpam_authctxt->valid ? "" : "illegal user ",
 			    sshpam_authctxt->user,

Modified: projects/clang390-import/crypto/openssh/auth.c
==============================================================================
--- projects/clang390-import/crypto/openssh/auth.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/crypto/openssh/auth.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -75,6 +75,7 @@ __RCSID("$FreeBSD$");
 #include "authfile.h"
 #include "ssherr.h"
 #include "compat.h"
+#include "blacklist_client.h"
 
 /* import */
 extern ServerOptions options;
@@ -292,8 +293,11 @@ auth_log(Authctxt *authctxt, int authent
 		authmsg = "Postponed";
 	else if (partial)
 		authmsg = "Partial";
-	else
+	else {
 		authmsg = authenticated ? "Accepted" : "Failed";
+		BLACKLIST_NOTIFY(authenticated ?
+		    BLACKLIST_AUTH_OK : BLACKLIST_AUTH_FAIL);
+	}
 
 	authlog("%s %s%s%s for %s%.100s from %.200s port %d %s%s%s",
 	    authmsg,
@@ -640,6 +644,7 @@ getpwnamallow(const char *user)
 	}
 #endif
 	if (pw == NULL) {
+		BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL);
 		logit("Invalid user %.100s from %.100s",
 		    user, get_remote_ipaddr());
 #ifdef CUSTOM_FAILED_LOGIN

Modified: projects/clang390-import/crypto/openssh/auth1.c
==============================================================================
--- projects/clang390-import/crypto/openssh/auth1.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/crypto/openssh/auth1.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -43,6 +43,7 @@
 #endif
 #include "monitor_wrap.h"
 #include "buffer.h"
+#include "blacklist_client.h"
 
 /* import */
 extern ServerOptions options;
@@ -337,6 +338,7 @@ do_authloop(Authctxt *authctxt)
 			char *msg;
 			size_t len;
 
+			BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL);
 			error("Access denied for user %s by PAM account "
 			    "configuration", authctxt->user);
 			len = buffer_len(&loginmsg);
@@ -404,6 +406,7 @@ do_authentication(Authctxt *authctxt)
 	else {
 		debug("do_authentication: invalid user %s", user);
 		authctxt->pw = fakepw();
+		BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL);
 	}
 
 	/* Configuration may have changed as a result of Match */

Modified: projects/clang390-import/crypto/openssh/auth2.c
==============================================================================
--- projects/clang390-import/crypto/openssh/auth2.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/crypto/openssh/auth2.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -52,6 +52,7 @@ __RCSID("$FreeBSD$");
 #include "pathnames.h"
 #include "buffer.h"
 #include "canohost.h"
+#include "blacklist_client.h"
 
 #ifdef GSSAPI
 #include "ssh-gss.h"
@@ -248,6 +249,7 @@ input_userauth_request(int type, u_int32
 		} else {
 			logit("input_userauth_request: invalid user %s", user);
 			authctxt->pw = fakepw();
+			BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL);
 #ifdef SSH_AUDIT_EVENTS
 			PRIVSEP(audit_event(SSH_INVALID_USER));
 #endif

Copied: projects/clang390-import/crypto/openssh/blacklist.c (from r305080, head/crypto/openssh/blacklist.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang390-import/crypto/openssh/blacklist.c	Tue Aug 30 19:29:00 2016	(r305081, copy of r305080, head/crypto/openssh/blacklist.c)
@@ -0,0 +1,97 @@
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * Copyright (c) 2016 The FreeBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Kurt Lidl
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "includes.h"
+
+#include <ctype.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <syslog.h>
+#include <unistd.h>
+
+#include "ssh.h"
+#include "packet.h"
+#include "log.h"
+#include "misc.h"
+#include "servconf.h"
+#include "blacklist_client.h"
+#include <blacklist.h>
+
+static struct blacklist *blstate = NULL;
+
+/* import */
+extern ServerOptions options;
+
+/* internal definition from bl.h */
+struct blacklist *bl_create(bool, char *, void (*)(int, const char *, va_list));
+
+/* impedence match vsyslog() to sshd's internal logging levels */
+void
+im_log(int priority, const char *message, va_list args)
+{
+	LogLevel imlevel;
+
+	switch (priority) {
+	case LOG_ERR:
+		imlevel = SYSLOG_LEVEL_ERROR;
+		break;
+	case LOG_DEBUG:
+		imlevel = SYSLOG_LEVEL_DEBUG1;
+		break;
+	case LOG_INFO:
+		imlevel = SYSLOG_LEVEL_INFO;
+		break;
+	default:
+		imlevel = SYSLOG_LEVEL_DEBUG2;
+	}
+	do_log(imlevel, message, args);
+}
+
+void
+blacklist_init(void)
+{
+
+	if (options.use_blacklist)
+		blstate = bl_create(false, NULL, im_log);
+}
+
+void
+blacklist_notify(int action)
+{
+
+	if (blstate != NULL && packet_connection_is_on_socket())
+		(void)blacklist_r(blstate, action,
+		packet_get_connection_in(), "ssh");
+}

Copied: projects/clang390-import/crypto/openssh/blacklist_client.h (from r305080, head/crypto/openssh/blacklist_client.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang390-import/crypto/openssh/blacklist_client.h	Tue Aug 30 19:29:00 2016	(r305081, copy of r305080, head/crypto/openssh/blacklist_client.h)
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * Copyright (c) 2016 The FreeBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Portions of this software were developed by Kurt Lidl
+ * under sponsorship from the FreeBSD Foundation.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef BLACKLIST_CLIENT_H
+#define BLACKLIST_CLIENT_H
+
+enum {
+	BLACKLIST_AUTH_OK = 0,
+	BLACKLIST_AUTH_FAIL
+};
+
+#ifdef USE_BLACKLIST
+void blacklist_init(void);
+void blacklist_notify(int);
+
+#define BLACKLIST_INIT() blacklist_init()
+#define BLACKLIST_NOTIFY(x) blacklist_notify(x)
+
+#else
+
+#define BLACKLIST_INIT()
+#define BLACKLIST_NOTIFY(x)
+
+#endif
+
+
+#endif /* BLACKLIST_CLIENT_H */

Modified: projects/clang390-import/crypto/openssh/packet.c
==============================================================================
--- projects/clang390-import/crypto/openssh/packet.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/crypto/openssh/packet.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -86,6 +86,7 @@ __RCSID("$FreeBSD$");
 #include "packet.h"
 #include "ssherr.h"
 #include "sshbuf.h"
+#include "blacklist_client.h"
 
 #ifdef PACKET_DEBUG
 #define DBG(x) x
@@ -2071,6 +2072,7 @@ sshpkt_fatal(struct ssh *ssh, const char
 	case SSH_ERR_NO_KEX_ALG_MATCH:
 	case SSH_ERR_NO_HOSTKEY_ALG_MATCH:
 		if (ssh && ssh->kex && ssh->kex->failed_choice) {
+			BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL);
 			fatal("Unable to negotiate with %.200s port %d: %s. "
 			    "Their offer: %s", ssh_remote_ipaddr(ssh),
 			    ssh_remote_port(ssh), ssh_err(r),

Modified: projects/clang390-import/crypto/openssh/servconf.c
==============================================================================
--- projects/clang390-import/crypto/openssh/servconf.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/crypto/openssh/servconf.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -172,6 +172,7 @@ initialize_server_options(ServerOptions 
 	options->ip_qos_bulk = -1;
 	options->version_addendum = NULL;
 	options->fingerprint_hash = -1;
+	options->use_blacklist = -1;
 }
 
 /* Returns 1 if a string option is unset or set to "none" or 0 otherwise. */
@@ -360,6 +361,8 @@ fill_default_server_options(ServerOption
 		options->fwd_opts.streamlocal_bind_unlink = 0;
 	if (options->fingerprint_hash == -1)
 		options->fingerprint_hash = SSH_FP_HASH_DEFAULT;
+	if (options->use_blacklist == -1)
+		options->use_blacklist = 0;
 
 	assemble_algorithms(options);
 
@@ -437,6 +440,7 @@ typedef enum {
 	sAuthenticationMethods, sHostKeyAgent, sPermitUserRC,
 	sStreamLocalBindMask, sStreamLocalBindUnlink,
 	sAllowStreamLocalForwarding, sFingerprintHash,
+	sUseBlacklist,
 	sDeprecated, sUnsupported
 } ServerOpCodes;
 
@@ -579,6 +583,7 @@ static struct {
 	{ "streamlocalbindunlink", sStreamLocalBindUnlink, SSHCFG_ALL },
 	{ "allowstreamlocalforwarding", sAllowStreamLocalForwarding, SSHCFG_ALL },
 	{ "fingerprinthash", sFingerprintHash, SSHCFG_GLOBAL },
+	{ "useblacklist", sUseBlacklist, SSHCFG_GLOBAL },
 	{ "noneenabled", sUnsupported, SSHCFG_ALL },
 	{ "hpndisabled", sDeprecated, SSHCFG_ALL },
 	{ "hpnbuffersize", sDeprecated, SSHCFG_ALL },
@@ -1861,6 +1866,10 @@ process_server_config_line(ServerOptions
 			options->fingerprint_hash = value;
 		break;
 
+	case sUseBlacklist:
+		intptr = &options->use_blacklist;
+		goto parse_flag;
+
 	case sDeprecated:
 		logit("%s line %d: Deprecated option %s",
 		    filename, linenum, arg);
@@ -2304,6 +2313,7 @@ dump_config(ServerOptions *o)
 	dump_cfg_fmtint(sAllowStreamLocalForwarding, o->allow_streamlocal_forwarding);
 	dump_cfg_fmtint(sUsePrivilegeSeparation, use_privsep);
 	dump_cfg_fmtint(sFingerprintHash, o->fingerprint_hash);
+	dump_cfg_fmtint(sUseBlacklist, o->use_blacklist);
 
 	/* string arguments */
 	dump_cfg_string(sPidFile, o->pid_file);

Modified: projects/clang390-import/crypto/openssh/servconf.h
==============================================================================
--- projects/clang390-import/crypto/openssh/servconf.h	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/crypto/openssh/servconf.h	Tue Aug 30 19:29:00 2016	(r305081)
@@ -195,6 +195,7 @@ typedef struct {
 	char   *auth_methods[MAX_AUTH_METHODS];
 
 	int	fingerprint_hash;
+	int	use_blacklist;
 }       ServerOptions;
 
 /* Information about the incoming connection as used by Match */

Modified: projects/clang390-import/crypto/openssh/sshd.c
==============================================================================
--- projects/clang390-import/crypto/openssh/sshd.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/crypto/openssh/sshd.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -135,6 +135,7 @@ __RCSID("$FreeBSD$");
 #include "ssh-sandbox.h"
 #include "version.h"
 #include "ssherr.h"
+#include "blacklist_client.h"
 
 #ifdef LIBWRAP
 #include <tcpd.h>
@@ -388,6 +389,8 @@ grace_alarm_handler(int sig)
 		kill(0, SIGTERM);
 	}
 
+	BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL);
+
 	/* Log error and exit. */
 	sigdie("Timeout before authentication for %s", get_remote_ipaddr());
 }
@@ -2251,6 +2254,8 @@ main(int ac, char **av)
 	buffer_init(&loginmsg);
 	auth_debug_reset();
 
+	BLACKLIST_INIT();
+
 	if (use_privsep) {
 		if (privsep_preauth(authctxt) == 1)
 			goto authenticated;

Modified: projects/clang390-import/crypto/openssh/sshd_config
==============================================================================
--- projects/clang390-import/crypto/openssh/sshd_config	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/crypto/openssh/sshd_config	Tue Aug 30 19:29:00 2016	(r305081)
@@ -120,6 +120,7 @@
 #MaxStartups 10:30:100
 #PermitTunnel no
 #ChrootDirectory none
+#UseBlacklist no
 #VersionAddendum FreeBSD-20160310
 
 # no default banner path

Modified: projects/clang390-import/crypto/openssh/sshd_config.5
==============================================================================
--- projects/clang390-import/crypto/openssh/sshd_config.5	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/crypto/openssh/sshd_config.5	Tue Aug 30 19:29:00 2016	(r305081)
@@ -1537,6 +1537,15 @@ for authentication using
 .Cm TrustedUserCAKeys .
 For more details on certificates, see the CERTIFICATES section in
 .Xr ssh-keygen 1 .
+.It Cm UseBlacklist
+Specifies whether
+.Xr sshd 8
+attempts to send authentication success and failure messages
+to the
+.Xr blacklistd 8
+daemon.
+The default is
+.Dq no .
 .It Cm UseDNS
 Specifies whether
 .Xr sshd 8

Modified: projects/clang390-import/lib/atf/libatf-c++/Makefile
==============================================================================
--- projects/clang390-import/lib/atf/libatf-c++/Makefile	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/lib/atf/libatf-c++/Makefile	Tue Aug 30 19:29:00 2016	(r305081)
@@ -35,15 +35,15 @@ SHLIB_MAJOR=	2
 # libatf-c++ depends on the C version of the ATF library to build.
 LIBADD+=	atf_c
 
-LDFLAGS+=	-L${.OBJDIR}/../libatf-c
+LDFLAGS+=	-L${.OBJDIR:H}/libatf-c
 
-ATF=		${.CURDIR:H:H:H}/contrib/atf
+ATF=		${SRCTOP}/contrib/atf
 .PATH:		${ATF}
 .PATH:		${ATF}/atf-c++
 .PATH:		${ATF}/atf-c++/detail
 
 CFLAGS+=	-I${ATF}
-CFLAGS+=	-I${.CURDIR}/../libatf-c
+CFLAGS+=	-I${.CURDIR:H}/libatf-c
 CFLAGS+=	-I.
 
 CFLAGS+=	-DHAVE_CONFIG_H

Modified: projects/clang390-import/lib/atf/libatf-c/Makefile
==============================================================================
--- projects/clang390-import/lib/atf/libatf-c/Makefile	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/lib/atf/libatf-c/Makefile	Tue Aug 30 19:29:00 2016	(r305081)
@@ -28,25 +28,25 @@
 .include <src.opts.mk>
 .include <bsd.init.mk>
 
-_CFLAGS:=	${CFLAGS}
-_CPPFLAGS:=	${CPPFLAGS}
-_CXXFLAGS:=	${CXXFLAGS}
+ATF_BUILD_CFLAGS:=	${CFLAGS:M-[DILOWf]*}
+ATF_BUILD_CPPFLAGS:=	${CPPFLAGS:M-[DILOWf]*}
+ATF_BUILD_CXXFLAGS:=	${CXXFLAGS:M-[DILOWf]*}
 
 LIB=		atf-c
 PRIVATELIB=	true
 SHLIB_MAJOR=	1
 
-ATF=		${.CURDIR:H:H:H}/contrib/atf
+ATF=		${SRCTOP}/contrib/atf
 .PATH:		${ATF}
 .PATH:		${ATF}/atf-c
 .PATH:		${ATF}/atf-c/detail
 
 CFLAGS+=	-DATF_BUILD_CC='"${CC}"'
-CFLAGS+=	-DATF_BUILD_CFLAGS='"${_CFLAGS}"'
+CFLAGS+=	-DATF_BUILD_CFLAGS='"${ATF_BUILD_CFLAGS}"'
 CFLAGS+=	-DATF_BUILD_CPP='"${CPP}"'
-CFLAGS+=	-DATF_BUILD_CPPFLAGS='"${_CPPFLAGS}"'
+CFLAGS+=	-DATF_BUILD_CPPFLAGS='"${ATF_BUILD_CPPFLAGS}"'
 CFLAGS+=	-DATF_BUILD_CXX='"${CXX}"'
-CFLAGS+=	-DATF_BUILD_CXXFLAGS='"${_CXXFLAGS}"'
+CFLAGS+=	-DATF_BUILD_CXXFLAGS='"${ATF_BUILD_CXXFLAGS}"'
 CFLAGS+=	-I${ATF}
 CFLAGS+=	-I${.CURDIR}
 CFLAGS+=	-I.

Modified: projects/clang390-import/lib/libdevctl/devctl.3
==============================================================================
--- projects/clang390-import/lib/libdevctl/devctl.3	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/lib/libdevctl/devctl.3	Tue Aug 30 19:29:00 2016	(r305081)
@@ -25,12 +25,13 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 27, 2016
+.Dd August 29, 2016
 .Dt DEVCTL 3
 .Os
 .Sh NAME
 .Nm devctl ,
 .Nm devctl_attach ,
+.Nm devctl_clear_driver ,
 .Nm devctl_delete ,
 .Nm devctl_detach ,
 .Nm devctl_disable ,
@@ -47,6 +48,8 @@
 .Ft int
 .Fn devctl_attach "const char *device"
 .Ft int
+.Fn devctl_clear_driver "const char *device" "bool force"
+.Ft int
 .Fn devctl_delete "const char *device" "bool force"
 .Ft int
 .Fn devctl_detach "const char *device" "bool force"
@@ -166,12 +169,30 @@ the device will be detached from its cur
 attached to the new device driver.
 .Pp
 The
+.Fn devctl_clear_driver
+function resets a device so that it can be attached to any valid device
+driver rather than only drivers with a previously specified name.
+This function is used to undo a previous call to
+.Fn devctl_set_driver .
+If the device is already attached and
+.Fa force
+is false,
+the request will fail.
+If the device is already attached and
+.Fa force
+is true,
+the device will be detached from its current device driver.
+After the device's name is reset,
+it is reprobed and attached to a suitable device driver if one is found.
+.Pp
+The
 .Fn devctl_rescan
 function rescans a bus device checking for devices that have been added or
 removed.
 .Sh RETURN VALUES
-.Rv -std devctl_attach devctl_delete devctl_detach devctl_disable \
-devctl_enable devctl_suspend devctl_rescan devctl_resume devctl_set_driver
+.Rv -std devctl_attach devctl_clear_driver devctl_delete devctl_detach \
+devctl_disable devctl_enable devctl_suspend devctl_rescan devctl_resume \
+devctl_set_driver
 .Sh ERRORS
 In addition to specific errors noted below,
 all of the
@@ -302,6 +323,24 @@ The new device driver failed to attach.
 .El
 .Pp
 The
+.Fn devctl_clear_driver
+function may fail if:
+.Bl -tag -width Er
+.It Bq Er EBUSY
+The device is currently attached to a device driver and
+.Fa force
+is false.
+.It Bq Er EBUSY
+The current device driver for
+.Fa device
+is busy and cannot detach at this time.
+.It Bq Er EINVAL
+The device is not configured for a specific device driver name.
+.It Bq Er ENXIO
+The device driver chosen after reprobing failed to attach.
+.El
+.Pp
+The
 .Fn devctl_rescan
 function may fail if:
 .Bl -tag -width Er

Modified: projects/clang390-import/lib/libdevctl/devctl.c
==============================================================================
--- projects/clang390-import/lib/libdevctl/devctl.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/lib/libdevctl/devctl.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -124,6 +124,14 @@ devctl_set_driver(const char *device, co
 }
 
 int
+devctl_clear_driver(const char *device, bool force)
+{
+
+	return (devctl_simple_request(DEV_CLEAR_DRIVER, device, force ?
+	    DEVF_CLEAR_DRIVER_DETACH : 0));
+}
+
+int
 devctl_rescan(const char *device)
 {
 

Modified: projects/clang390-import/lib/libdevctl/devctl.h
==============================================================================
--- projects/clang390-import/lib/libdevctl/devctl.h	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/lib/libdevctl/devctl.h	Tue Aug 30 19:29:00 2016	(r305081)
@@ -38,6 +38,7 @@ int	devctl_disable(const char *device, b
 int	devctl_suspend(const char *device);
 int	devctl_resume(const char *device);
 int	devctl_set_driver(const char *device, const char *driver, bool force);
+int	devctl_clear_driver(const char *device, bool force);
 int	devctl_rescan(const char *device);
 int	devctl_delete(const char *device, bool force);
 

Modified: projects/clang390-import/sbin/newfs_msdos/mkfs_msdos.c
==============================================================================
--- projects/clang390-import/sbin/newfs_msdos/mkfs_msdos.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/sbin/newfs_msdos/mkfs_msdos.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -313,15 +313,8 @@ mkfs_msdos(const char *fname, const char
 	bpb.bpbHiddenSecs = o.hidden_sectors;
     if (!(o.floppy || (o.drive_heads && o.sectors_per_track &&
 	o.bytes_per_sector && o.size && o.hidden_sectors_set))) {
-	off_t delta;
 	getdiskinfo(fd, fname, dtype, o.hidden_sectors_set, &bpb);
 	bpb.bpbHugeSectors -= (o.offset / bpb.bpbBytesPerSec);
-	delta = bpb.bpbHugeSectors % bpb.bpbSecPerTrack;
-	if (delta != 0) {
-	    warnx("trim %d sectors to adjust to a multiple of %d",
-		(int)delta, bpb.bpbSecPerTrack);
-	    bpb.bpbHugeSectors -= delta;
-	}
 	if (bpb.bpbSecPerClust == 0) {	/* set defaults */
 	    if (bpb.bpbHugeSectors <= 6000)	/* about 3MB -> 512 bytes */
 		bpb.bpbSecPerClust = 1;
@@ -563,7 +556,7 @@ mkfs_msdos(const char *fname, const char
 	bpb.bpbMedia = !bpb.bpbHiddenSecs ? 0xf0 : 0xf8;
     if (fat == 32)
 	bpb.bpbRootClust = RESFTE;
-    if (bpb.bpbHiddenSecs + bpb.bpbHugeSectors <= MAXU16) {
+    if (bpb.bpbHugeSectors <= MAXU16) {
 	bpb.bpbSectors = bpb.bpbHugeSectors;
 	bpb.bpbHugeSectors = 0;
     }

Modified: projects/clang390-import/secure/usr.sbin/sshd/Makefile
==============================================================================
--- projects/clang390-import/secure/usr.sbin/sshd/Makefile	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/secure/usr.sbin/sshd/Makefile	Tue Aug 30 19:29:00 2016	(r305081)
@@ -40,6 +40,13 @@ CFLAGS+= -DUSE_BSM_AUDIT -DHAVE_GETAUDIT
 LIBADD+=	bsm
 .endif
 
+.if ${MK_BLACKLIST_SUPPORT} != "no"
+CFLAGS+= -DUSE_BLACKLIST -I${SRCTOP}/contrib/blacklist/include
+SRCS+=	blacklist.c
+LIBADD+= blacklist
+LDFLAGS+=-L${LIBBLACKLISTDIR}
+.endif
+
 .if ${MK_KERBEROS_SUPPORT} != "no"
 CFLAGS+= -include krb5_config.h
 SRCS+=	krb5_config.h

Modified: projects/clang390-import/secure/usr.sbin/sshd/Makefile.depend
==============================================================================
--- projects/clang390-import/secure/usr.sbin/sshd/Makefile.depend	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/secure/usr.sbin/sshd/Makefile.depend	Tue Aug 30 19:29:00 2016	(r305081)
@@ -17,6 +17,7 @@ DIRDEPS = \
 	kerberos5/lib/libroken \
 	kerberos5/lib/libwind \
 	lib/${CSU_DIR} \
+	lib/libblacklist \
 	lib/libbsm \
 	lib/libc \
 	lib/libcom_err \

Modified: projects/clang390-import/share/man/man9/mbuf.9
==============================================================================
--- projects/clang390-import/share/man/man9/mbuf.9	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/share/man/man9/mbuf.9	Tue Aug 30 19:29:00 2016	(r305081)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 29, 2016
+.Dd August 30, 2016
 .Dt MBUF 9
 .Os
 .\"
@@ -255,7 +255,7 @@ The available external buffer types are 
 #define EXT_JUMBO9	4	/* jumbo cluster 9216 bytes */
 #define EXT_JUMBO16	5	/* jumbo cluster 16184 bytes */
 #define EXT_PACKET	6	/* mbuf+cluster from packet zone */
-#define EXT_MBUF	7	/* external mbuf reference (M_IOVEC) */
+#define EXT_MBUF	7	/* external mbuf reference */
 #define EXT_NET_DRV	252	/* custom ext_buf provided by net driver(s) */
 #define EXT_MOD_TYPE	253	/* custom module's ext_buf type */
 #define EXT_DISPOSABLE	254	/* can throw this buffer away w/page flipping */

Modified: projects/clang390-import/sys/arm/allwinner/aw_wdog.c
==============================================================================
--- projects/clang390-import/sys/arm/allwinner/aw_wdog.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/sys/arm/allwinner/aw_wdog.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/watchdog.h>
+#include <sys/reboot.h>
 #include <sys/bus.h>
 #include <sys/kernel.h>
 #include <sys/lock.h>
@@ -54,6 +55,7 @@ __FBSDID("$FreeBSD$");
 #define	A10_WDOG_CTRL		0x00
 #define	A31_WDOG_CTRL		0x10
 #define	 WDOG_CTRL_RESTART	(1 << 0)
+#define	 A31_WDOG_CTRL_KEY	(0xa57 << 1)
 #define	A10_WDOG_MODE		0x04
 #define	A31_WDOG_MODE		0x18
 #define	 A10_WDOG_MODE_INTVL_SHIFT	3
@@ -92,6 +94,7 @@ struct aw_wdog_softc {
 	struct resource *	res;
 	struct mtx		mtx;
 	uint8_t			wdog_ctrl;
+	uint32_t		wdog_ctrl_key;
 	uint8_t			wdog_mode;
 	uint8_t			wdog_mode_intvl_shift;
 	uint8_t			wdog_mode_en;
@@ -108,7 +111,8 @@ static struct ofw_compat_data compat_dat
 	{NULL,             0}
 };
 
-static void aw_wdog_watchdog_fn(void *private, u_int cmd, int *error);
+static void aw_wdog_watchdog_fn(void *, u_int, int *);
+static void aw_wdog_shutdown_fn(void *, int);
 
 static int
 aw_wdog_probe(device_t dev)
@@ -160,6 +164,7 @@ aw_wdog_attach(device_t dev)
 		break;
 	case A31_WATCHDOG:
 		sc->wdog_ctrl = A31_WDOG_CTRL;
+		sc->wdog_ctrl_key = A31_WDOG_CTRL_KEY;
 		sc->wdog_mode = A31_WDOG_MODE;
 		sc->wdog_mode_intvl_shift = A31_WDOG_MODE_INTVL_SHIFT;
 		sc->wdog_mode_en = WDOG_MODE_EN;
@@ -173,6 +178,9 @@ aw_wdog_attach(device_t dev)
 
 	mtx_init(&sc->mtx, "AW Watchdog", "aw_wdog", MTX_DEF);
 	EVENTHANDLER_REGISTER(watchdog_list, aw_wdog_watchdog_fn, sc, 0);
+	EVENTHANDLER_REGISTER(shutdown_final, aw_wdog_shutdown_fn, sc,
+	    SHUTDOWN_PRI_LAST - 1);
+	
 	return (0);
 }
 
@@ -198,7 +206,8 @@ aw_wdog_watchdog_fn(void *private, u_int
 			WRITE(sc, sc->wdog_mode,
 			  (wd_intervals[i].value << sc->wdog_mode_intvl_shift) |
 			    sc->wdog_mode_en);
-			WRITE(sc, sc->wdog_ctrl, WDOG_CTRL_RESTART);
+			WRITE(sc, sc->wdog_ctrl,
+			    WDOG_CTRL_RESTART | sc->wdog_ctrl_key);
 			if (sc->wdog_config)
 				WRITE(sc, sc->wdog_config,
 				    sc->wdog_config_value);
@@ -222,6 +231,13 @@ aw_wdog_watchdog_fn(void *private, u_int
 	mtx_unlock(&sc->mtx);
 }
 
+static void
+aw_wdog_shutdown_fn(void *private, int howto)
+{
+	if ((howto & (RB_POWEROFF|RB_HALT)) == 0)
+		aw_wdog_watchdog_reset();
+}
+
 void
 aw_wdog_watchdog_reset()
 {
@@ -237,6 +253,8 @@ aw_wdog_watchdog_reset()
 	if (aw_wdog_sc->wdog_config)
 		WRITE(aw_wdog_sc, aw_wdog_sc->wdog_config,
 		      aw_wdog_sc->wdog_config_value);
+	WRITE(aw_wdog_sc, aw_wdog_sc->wdog_ctrl,
+	    WDOG_CTRL_RESTART | aw_wdog_sc->wdog_ctrl_key);
 	while(1)
 		;
 

Modified: projects/clang390-import/sys/arm/ti/ti_pruss.c
==============================================================================
--- projects/clang390-import/sys/arm/ti/ti_pruss.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/sys/arm/ti/ti_pruss.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -310,7 +310,9 @@ ti_pruss_kqfilter(struct cdev *cdev, str
 	case EVFILT_READ:
 		kn->kn_hook = sc;
 		kn->kn_fop = &ti_pruss_kq_read;
+		mtx_lock(&sc->sc_mtx);
 		knlist_add(&sc->sc_selinfo.si_note, kn, 1);
+		mtx_unlock(&sc->sc_mtx);
 		break;
 	default:
 		return (EINVAL);

Modified: projects/clang390-import/sys/arm64/arm64/pmap.c
==============================================================================
--- projects/clang390-import/sys/arm64/arm64/pmap.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/sys/arm64/arm64/pmap.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -2936,14 +2936,17 @@ validate:
 	PTE_SYNC(l3);
 	pmap_invalidate_page(pmap, va);
 
-	if ((pmap != pmap_kernel()) && (pmap == &curproc->p_vmspace->vm_pmap))
-	    cpu_icache_sync_range(va, PAGE_SIZE);
-
-	if ((mpte == NULL || mpte->wire_count == NL3PG) &&
-	    pmap_superpages_enabled() && (m->flags & PG_FICTITIOUS) == 0 &&
-	    vm_reserv_level_iffullpop(m) == 0) {
-		KASSERT(lvl == 2, ("Invalid pde level %d", lvl));
-		pmap_promote_l2(pmap, pde, va, &lock);
+	if (pmap != pmap_kernel()) {
+		if (pmap == &curproc->p_vmspace->vm_pmap)
+		    cpu_icache_sync_range(va, PAGE_SIZE);
+
+		if ((mpte == NULL || mpte->wire_count == NL3PG) &&
+		    pmap_superpages_enabled() &&
+		    (m->flags & PG_FICTITIOUS) == 0 &&
+		    vm_reserv_level_iffullpop(m) == 0) {
+			KASSERT(lvl == 2, ("Invalid pde level %d", lvl));
+			pmap_promote_l2(pmap, pde, va, &lock);
+		}
 	}
 
 	if (lock != NULL)

Modified: projects/clang390-import/sys/boot/powerpc/boot1.chrp/boot1.c
==============================================================================
--- projects/clang390-import/sys/boot/powerpc/boot1.chrp/boot1.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/sys/boot/powerpc/boot1.chrp/boot1.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -137,7 +137,9 @@ ofw_init(void *vpd, int res, int (*openf
 
 	p = bootpath;
 	while (*p != '\0') {
+		/* Truncate partition ID */
 		if (*p == ':') {
+			ofw_close(bootdev);
 			*(++p) = '\0';
 			break;
 		}
@@ -419,31 +421,40 @@ main(int ac, char **av)
 
 	memcpy(bootpath_full,bootpath,len+1);
 
-	if (bootpath_full[len-1] == ':') {
-		for (i = 0; i < 16; i++) {
-			if (i < 10) {
-				bootpath_full[len] = i + '0';
-				bootpath_full[len+1] = '\0';
-			} else {
-				bootpath_full[len] = '1';
-				bootpath_full[len+1] = i - 10 + '0';
-				bootpath_full[len+2] = '\0';
-			}
-				
-			if (domount(bootpath_full,1) >= 0)
-				break;
-
-			if (bootdev > 0)
-				ofw_close(bootdev);
+	if (bootpath_full[len-1] != ':') {
+		/* First try full volume */
+		if (domount(bootpath_full,1) == 0)
+			goto out;
+
+		/* Add a : so that we try partitions if that fails */
+		if (bootdev > 0)
+			ofw_close(bootdev);
+		bootpath_full[len] = ':';
+		len += 1;
+	}
+
+	/* Loop through first 16 partitions to find a UFS one */
+	for (i = 0; i < 16; i++) {
+		if (i < 10) {
+			bootpath_full[len] = i + '0';
+			bootpath_full[len+1] = '\0';
+		} else {
+			bootpath_full[len] = '1';
+			bootpath_full[len+1] = i - 10 + '0';
+			bootpath_full[len+2] = '\0';
 		}
+			
+		if (domount(bootpath_full,1) >= 0)
+			break;
 
-		if (i >= 16)
-			panic("domount");
-	} else {
-		if (domount(bootpath_full,0) == -1)
-			panic("domount");
+		if (bootdev > 0)
+			ofw_close(bootdev);
 	}
 
+	if (i >= 16)
+		panic("domount");
+
+out:
 	printf("   Boot volume:   %s\n",bootpath_full);
 	ofw_setprop(chosenh, "bootargs", bootpath_full, len+2);
 	load(path);

Modified: projects/clang390-import/sys/dev/cxgbe/t4_iov.c
==============================================================================
--- projects/clang390-import/sys/dev/cxgbe/t4_iov.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/sys/dev/cxgbe/t4_iov.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -209,10 +209,15 @@ static int
 t4iov_detach(device_t dev)
 {
 	struct t4iov_softc *sc;
+	int error;
 
 	sc = device_get_softc(dev);
-	if (sc->sc_attached)
-		return (t4iov_detach_child(dev));
+	if (sc->sc_attached) {
+		error = t4iov_detach_child(dev);
+		if (error)
+			return (error);
+	}
+	device_verbose(dev);
 	return (0);
 }
 

Modified: projects/clang390-import/sys/dev/hyperv/netvsc/hv_net_vsc.c
==============================================================================
--- projects/clang390-import/sys/dev/hyperv/netvsc/hv_net_vsc.c	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/sys/dev/hyperv/netvsc/hv_net_vsc.c	Tue Aug 30 19:29:00 2016	(r305081)
@@ -74,8 +74,6 @@ static void hv_nv_on_receive(struct hn_s
 static void hn_nvs_sent_none(struct hn_send_ctx *sndc,
     struct hn_softc *, struct vmbus_channel *chan,
     const void *, int);
-static void hn_nvs_sent_xact(struct hn_send_ctx *, struct hn_softc *sc,
-    struct vmbus_channel *, const void *, int);
 
 struct hn_send_ctx	hn_send_ctx_none =
     HN_SEND_CTX_INITIALIZER(hn_nvs_sent_none, NULL);
@@ -643,7 +641,7 @@ cleanup:
  * Net VSC on device remove
  */
 int
-hv_nv_on_device_remove(struct hn_softc *sc, boolean_t destroy_channel)
+hv_nv_on_device_remove(struct hn_softc *sc)
 {
 	
 	hv_nv_disconnect_from_vsp(sc);
@@ -655,7 +653,7 @@ hv_nv_on_device_remove(struct hn_softc *
 	return (0);
 }
 
-static void
+void
 hn_nvs_sent_xact(struct hn_send_ctx *sndc,
     struct hn_softc *sc __unused, struct vmbus_channel *chan __unused,
     const void *data, int dlen)

Modified: projects/clang390-import/sys/dev/hyperv/netvsc/hv_net_vsc.h
==============================================================================
--- projects/clang390-import/sys/dev/hyperv/netvsc/hv_net_vsc.h	Tue Aug 30 19:27:27 2016	(r305080)
+++ projects/clang390-import/sys/dev/hyperv/netvsc/hv_net_vsc.h	Tue Aug 30 19:29:00 2016	(r305081)
@@ -237,8 +237,8 @@ typedef void (*pfn_on_send_rx_completion
 #define TRANSPORT_TYPE_IPV6_UDP		((TYPE_IPV6 << 16) | TYPE_UDP)
 
 typedef struct {
-	uint8_t		mac_addr[6];  /* Assumption unsigned long */
-	uint8_t		link_state;
+	uint8_t		mac_addr[ETHER_ADDR_LEN];
+	uint32_t	link_state;
 } netvsc_device_info;
 
 #define HN_XACT_REQ_PGCNT		2
@@ -351,7 +351,6 @@ typedef struct hn_softc {
 	int             hn_initdone;
 	/* See hv_netvsc_drv_freebsd.c for rules on how to use */
 	int             temp_unusable;
-	struct rndis_device_ *rndis_dev;
 	struct vmbus_channel *hn_prichan;
 
 	int		hn_rx_ring_cnt;
@@ -400,8 +399,7 @@ struct hn_send_ctx;
 
 void netvsc_linkstatus_callback(struct hn_softc *sc, uint32_t status);
 int hv_nv_on_device_add(struct hn_softc *sc, struct hn_rx_ring *rxr);
-int hv_nv_on_device_remove(struct hn_softc *sc,
-    boolean_t destroy_channel);
+int hv_nv_on_device_remove(struct hn_softc *sc);
 int hv_nv_on_send(struct vmbus_channel *chan, uint32_t rndis_mtype,
 	struct hn_send_ctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt);
 void hv_nv_subchan_attach(struct vmbus_channel *chan,

Modified: projects/clang390-import/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==============================================================================
--- projects/clang390-import/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c	Tue Aug 30 19:27:27 2016	(r305080)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



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