svn commit: r358000 - in projects/clang1000-import: include lib/libfetch lib/libthr lib/libthr/thread sbin/ping6 share/man/man3 share/man/man9 share/misc sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/v...
Dimitry Andric
dim at FreeBSD.org
Sun Feb 16 13:23:59 UTC 2020
Author: dim
Date: Sun Feb 16 13:23:54 2020
New Revision: 358000
URL: https://svnweb.freebsd.org/changeset/base/358000
Log:
Merge ^/head r357966 through r357999.
Added:
projects/clang1000-import/tests/sys/net/if_bridge_test.sh
- copied unchanged from r357999, head/tests/sys/net/if_bridge_test.sh
Modified:
projects/clang1000-import/include/pthread_np.h
projects/clang1000-import/lib/libfetch/common.c
projects/clang1000-import/lib/libfetch/common.h
projects/clang1000-import/lib/libfetch/fetch.3
projects/clang1000-import/lib/libthr/pthread.map
projects/clang1000-import/lib/libthr/thread/thr_join.c
projects/clang1000-import/sbin/ping6/ping6.c
projects/clang1000-import/share/man/man3/Makefile
projects/clang1000-import/share/man/man3/pthread_join.3
projects/clang1000-import/share/man/man9/malloc.9
projects/clang1000-import/share/misc/committers-ports.dot
projects/clang1000-import/sys/amd64/vmm/amd/amdvi_hw.c
projects/clang1000-import/sys/amd64/vmm/amd/npt.c
projects/clang1000-import/sys/amd64/vmm/amd/svm.c
projects/clang1000-import/sys/amd64/vmm/intel/ept.c
projects/clang1000-import/sys/amd64/vmm/intel/vmx.c
projects/clang1000-import/sys/amd64/vmm/io/iommu.c
projects/clang1000-import/sys/amd64/vmm/io/ppt.c
projects/clang1000-import/sys/amd64/vmm/io/vrtc.c
projects/clang1000-import/sys/amd64/vmm/vmm.c
projects/clang1000-import/sys/amd64/vmm/vmm_dev.c
projects/clang1000-import/sys/amd64/vmm/x86.c
projects/clang1000-import/sys/cam/cam_periph.c
projects/clang1000-import/sys/compat/linuxkpi/common/src/linux_compat.c
projects/clang1000-import/sys/conf/files
projects/clang1000-import/sys/contrib/libsodium/src/libsodium/include/sodium/core.h
projects/clang1000-import/sys/contrib/libsodium/src/libsodium/include/sodium/export.h
projects/clang1000-import/sys/dev/iscsi/icl.c
projects/clang1000-import/sys/dev/iscsi/iscsi.c
projects/clang1000-import/sys/dev/sound/usb/uaudio.c
projects/clang1000-import/sys/dev/usb/controller/atmegadci.c
projects/clang1000-import/sys/dev/usb/controller/avr32dci.c
projects/clang1000-import/sys/dev/usb/controller/dwc_otg.c
projects/clang1000-import/sys/dev/usb/controller/ehci.c
projects/clang1000-import/sys/dev/usb/controller/musb_otg.c
projects/clang1000-import/sys/dev/usb/controller/ohci.c
projects/clang1000-import/sys/dev/usb/controller/saf1761_otg.c
projects/clang1000-import/sys/dev/usb/controller/uhci.c
projects/clang1000-import/sys/dev/usb/controller/usb_controller.c
projects/clang1000-import/sys/dev/usb/controller/uss820dci.c
projects/clang1000-import/sys/dev/usb/controller/xhci.c
projects/clang1000-import/sys/dev/usb/gadget/g_audio.c
projects/clang1000-import/sys/dev/usb/gadget/g_keyboard.c
projects/clang1000-import/sys/dev/usb/gadget/g_modem.c
projects/clang1000-import/sys/dev/usb/gadget/g_mouse.c
projects/clang1000-import/sys/dev/usb/input/atp.c
projects/clang1000-import/sys/dev/usb/input/uep.c
projects/clang1000-import/sys/dev/usb/input/uhid.c
projects/clang1000-import/sys/dev/usb/input/ukbd.c
projects/clang1000-import/sys/dev/usb/input/ums.c
projects/clang1000-import/sys/dev/usb/input/wmt.c
projects/clang1000-import/sys/dev/usb/input/wsp.c
projects/clang1000-import/sys/dev/usb/misc/udbp.c
projects/clang1000-import/sys/dev/usb/misc/ugold.c
projects/clang1000-import/sys/dev/usb/net/if_aue.c
projects/clang1000-import/sys/dev/usb/net/if_axe.c
projects/clang1000-import/sys/dev/usb/net/if_axge.c
projects/clang1000-import/sys/dev/usb/net/if_cdce.c
projects/clang1000-import/sys/dev/usb/net/if_cdceem.c
projects/clang1000-import/sys/dev/usb/net/if_cue.c
projects/clang1000-import/sys/dev/usb/net/if_ipheth.c
projects/clang1000-import/sys/dev/usb/net/if_kue.c
projects/clang1000-import/sys/dev/usb/net/if_mos.c
projects/clang1000-import/sys/dev/usb/net/if_muge.c
projects/clang1000-import/sys/dev/usb/net/if_rue.c
projects/clang1000-import/sys/dev/usb/net/if_smsc.c
projects/clang1000-import/sys/dev/usb/net/if_udav.c
projects/clang1000-import/sys/dev/usb/net/if_ure.c
projects/clang1000-import/sys/dev/usb/net/if_urndis.c
projects/clang1000-import/sys/dev/usb/net/if_usie.c
projects/clang1000-import/sys/dev/usb/net/uhso.c
projects/clang1000-import/sys/dev/usb/net/usb_ethernet.c
projects/clang1000-import/sys/dev/usb/serial/u3g.c
projects/clang1000-import/sys/dev/usb/serial/ubsa.c
projects/clang1000-import/sys/dev/usb/serial/ubser.c
projects/clang1000-import/sys/dev/usb/serial/uchcom.c
projects/clang1000-import/sys/dev/usb/serial/ufoma.c
projects/clang1000-import/sys/dev/usb/serial/uftdi.c
projects/clang1000-import/sys/dev/usb/serial/ulpt.c
projects/clang1000-import/sys/dev/usb/serial/umcs.c
projects/clang1000-import/sys/dev/usb/serial/umodem.c
projects/clang1000-import/sys/dev/usb/serial/umoscom.c
projects/clang1000-import/sys/dev/usb/serial/uplcom.c
projects/clang1000-import/sys/dev/usb/serial/usb_serial.c
projects/clang1000-import/sys/dev/usb/serial/uslcom.c
projects/clang1000-import/sys/dev/usb/serial/uvisor.c
projects/clang1000-import/sys/dev/usb/serial/uvscom.c
projects/clang1000-import/sys/dev/usb/storage/cfumass.c
projects/clang1000-import/sys/dev/usb/storage/umass.c
projects/clang1000-import/sys/dev/usb/storage/urio.c
projects/clang1000-import/sys/dev/usb/storage/ustorage_fs.c
projects/clang1000-import/sys/dev/usb/template/usb_template.c
projects/clang1000-import/sys/dev/usb/template/usb_template_audio.c
projects/clang1000-import/sys/dev/usb/template/usb_template_cdce.c
projects/clang1000-import/sys/dev/usb/template/usb_template_cdceem.c
projects/clang1000-import/sys/dev/usb/template/usb_template_kbd.c
projects/clang1000-import/sys/dev/usb/template/usb_template_midi.c
projects/clang1000-import/sys/dev/usb/template/usb_template_modem.c
projects/clang1000-import/sys/dev/usb/template/usb_template_mouse.c
projects/clang1000-import/sys/dev/usb/template/usb_template_msc.c
projects/clang1000-import/sys/dev/usb/template/usb_template_mtp.c
projects/clang1000-import/sys/dev/usb/template/usb_template_multi.c
projects/clang1000-import/sys/dev/usb/template/usb_template_phone.c
projects/clang1000-import/sys/dev/usb/template/usb_template_serialnet.c
projects/clang1000-import/sys/dev/usb/usb_debug.c
projects/clang1000-import/sys/dev/usb/usb_dev.c
projects/clang1000-import/sys/dev/usb/usb_generic.c
projects/clang1000-import/sys/dev/usb/usb_hub.c
projects/clang1000-import/sys/dev/usb/usb_hub_acpi.c
projects/clang1000-import/sys/dev/usb/usb_process.c
projects/clang1000-import/sys/dev/usb/video/udl.c
projects/clang1000-import/sys/dev/usb/wlan/if_rsu.c
projects/clang1000-import/sys/dev/usb/wlan/if_rum.c
projects/clang1000-import/sys/dev/usb/wlan/if_run.c
projects/clang1000-import/sys/dev/usb/wlan/if_uath.c
projects/clang1000-import/sys/dev/usb/wlan/if_upgt.c
projects/clang1000-import/sys/dev/usb/wlan/if_ural.c
projects/clang1000-import/sys/dev/usb/wlan/if_urtw.c
projects/clang1000-import/sys/dev/usb/wlan/if_zyd.c
projects/clang1000-import/sys/fs/autofs/autofs.c
projects/clang1000-import/sys/kern/kern_malloc.c
projects/clang1000-import/sys/kern/kern_rctl.c
projects/clang1000-import/sys/kern/sysv_sem.c
projects/clang1000-import/sys/kern/vfs_subr.c
projects/clang1000-import/sys/sys/malloc.h
projects/clang1000-import/sys/sys/refcount.h
projects/clang1000-import/sys/ufs/ffs/ffs_vnops.c
projects/clang1000-import/sys/vm/uma_core.c
projects/clang1000-import/tests/sys/common/vnet.subr
projects/clang1000-import/tests/sys/net/Makefile
projects/clang1000-import/tests/sys/net/if_clone_test.sh
projects/clang1000-import/tests/sys/net/if_lagg_test.sh
projects/clang1000-import/tests/sys/net/routing/rtsock_common.h
projects/clang1000-import/tests/sys/net/routing/rtsock_print.h
projects/clang1000-import/tests/sys/net/routing/test_rtsock_l3.c
projects/clang1000-import/usr.bin/random/random.6
projects/clang1000-import/usr.bin/random/random.c
projects/clang1000-import/usr.bin/random/randomize_fd.c
projects/clang1000-import/usr.bin/random/randomize_fd.h
Directory Properties:
projects/clang1000-import/ (props changed)
Modified: projects/clang1000-import/include/pthread_np.h
==============================================================================
--- projects/clang1000-import/include/pthread_np.h Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/include/pthread_np.h Sun Feb 16 13:23:54 2020 (r358000)
@@ -63,6 +63,7 @@ int pthread_mutex_setyieldloops_np(pthread_mutex_t *mu
int pthread_mutex_isowned_np(pthread_mutex_t *mutex);
void pthread_resume_all_np(void);
int pthread_resume_np(pthread_t);
+int pthread_peekjoin_np(pthread_t, void **);
void pthread_set_name_np(pthread_t, const char *);
int pthread_setaffinity_np(pthread_t, size_t, const cpuset_t *);
int pthread_single_np(void);
Modified: projects/clang1000-import/lib/libfetch/common.c
==============================================================================
--- projects/clang1000-import/lib/libfetch/common.c Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/lib/libfetch/common.c Sun Feb 16 13:23:54 2020 (r358000)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <netdb.h>
#include <poll.h>
#include <pwd.h>
@@ -74,6 +75,64 @@ static struct fetcherr netdb_errlist[] = {
{ -1, FETCH_UNKNOWN, "Unknown resolver error" }
};
+/*
+ * SOCKS5 error enumerations
+ */
+enum SOCKS5_ERR {
+/* Protocol errors */
+ SOCKS5_ERR_SELECTION,
+ SOCKS5_ERR_READ_METHOD,
+ SOCKS5_ERR_VER5_ONLY,
+ SOCKS5_ERR_NOMETHODS,
+ SOCKS5_ERR_NOTIMPLEMENTED,
+ SOCKS5_ERR_HOSTNAME_SIZE,
+ SOCKS5_ERR_REQUEST,
+ SOCKS5_ERR_REPLY,
+ SOCKS5_ERR_NON_VER5_RESP,
+ SOCKS5_ERR_GENERAL,
+ SOCKS5_ERR_NOT_ALLOWED,
+ SOCKS5_ERR_NET_UNREACHABLE,
+ SOCKS5_ERR_HOST_UNREACHABLE,
+ SOCKS5_ERR_CONN_REFUSED,
+ SOCKS5_ERR_TTL_EXPIRED,
+ SOCKS5_ERR_COM_UNSUPPORTED,
+ SOCKS5_ERR_ADDR_UNSUPPORTED,
+ SOCKS5_ERR_UNSPECIFIED,
+/* Configuration errors */
+ SOCKS5_ERR_BAD_HOST,
+ SOCKS5_ERR_BAD_PROXY_FORMAT,
+ SOCKS5_ERR_BAD_PORT
+};
+
+/*
+ * Error messages for SOCKS5 errors
+ */
+static struct fetcherr socks5_errlist[] = {
+/* SOCKS5 protocol errors */
+ { SOCKS5_ERR_SELECTION, FETCH_ABORT, "SOCKS5: Failed to send selection method" },
+ { SOCKS5_ERR_READ_METHOD, FETCH_ABORT, "SOCKS5: Failed to read method" },
+ { SOCKS5_ERR_VER5_ONLY, FETCH_PROTO, "SOCKS5: Only version 5 is implemented" },
+ { SOCKS5_ERR_NOMETHODS, FETCH_PROTO, "SOCKS5: No acceptable methods" },
+ { SOCKS5_ERR_NOTIMPLEMENTED, FETCH_PROTO, "SOCKS5: Method currently not implemented" },
+ { SOCKS5_ERR_HOSTNAME_SIZE, FETCH_PROTO, "SOCKS5: Hostname size is above 256 bytes" },
+ { SOCKS5_ERR_REQUEST, FETCH_PROTO, "SOCKS5: Failed to request" },
+ { SOCKS5_ERR_REPLY, FETCH_PROTO, "SOCKS5: Failed to receive reply" },
+ { SOCKS5_ERR_NON_VER5_RESP, FETCH_PROTO, "SOCKS5: Server responded with a non-version 5 response" },
+ { SOCKS5_ERR_GENERAL, FETCH_ABORT, "SOCKS5: General server failure" },
+ { SOCKS5_ERR_NOT_ALLOWED, FETCH_AUTH, "SOCKS5: Connection not allowed by ruleset" },
+ { SOCKS5_ERR_NET_UNREACHABLE, FETCH_NETWORK, "SOCKS5: Network unreachable" },
+ { SOCKS5_ERR_HOST_UNREACHABLE, FETCH_ABORT, "SOCKS5: Host unreachable" },
+ { SOCKS5_ERR_CONN_REFUSED, FETCH_ABORT, "SOCKS5: Connection refused" },
+ { SOCKS5_ERR_TTL_EXPIRED, FETCH_TIMEOUT, "SOCKS5: TTL expired" },
+ { SOCKS5_ERR_COM_UNSUPPORTED, FETCH_PROTO, "SOCKS5: Command not supported" },
+ { SOCKS5_ERR_ADDR_UNSUPPORTED, FETCH_ABORT, "SOCKS5: Address type not supported" },
+ { SOCKS5_ERR_UNSPECIFIED, FETCH_UNKNOWN, "SOCKS5: Unspecified error" },
+/* Configuration error */
+ { SOCKS5_ERR_BAD_HOST, FETCH_ABORT, "SOCKS5: Bad proxy host" },
+ { SOCKS5_ERR_BAD_PROXY_FORMAT, FETCH_ABORT, "SOCKS5: Bad proxy format" },
+ { SOCKS5_ERR_BAD_PORT, FETCH_ABORT, "SOCKS5: Bad port" }
+};
+
/* End-of-Line */
static const char ENDL[2] = "\r\n";
@@ -314,7 +373,6 @@ syserr:
}
-
/*
* Bind a socket to a specific local address
*/
@@ -337,6 +395,192 @@ fetch_bind(int sd, int af, const char *addr)
/*
+ * SOCKS5 connection initiation, based on RFC 1928
+ * Default DNS resolution over SOCKS5
+ */
+int
+fetch_socks5_init(conn_t *conn, const char *host, int port, int verbose)
+{
+ /*
+ * Size is based on largest packet prefix (4 bytes) +
+ * Largest FQDN (256) + one byte size (1) +
+ * Port (2)
+ */
+ unsigned char buf[BUFF_SIZE];
+ unsigned char *ptr;
+ int ret = 1;
+
+ if (verbose)
+ fetch_info("Initializing SOCKS5 connection: %s:%d", host, port);
+
+ /* Connection initialization */
+ ptr = buf;
+ *ptr++ = SOCKS_VERSION_5;
+ *ptr++ = SOCKS_CONNECTION;
+ *ptr++ = SOCKS_RSV;
+
+ if (fetch_write(conn, buf, 3) != 3) {
+ ret = SOCKS5_ERR_SELECTION;
+ goto fail;
+ }
+
+ /* Verify response from SOCKS5 server */
+ if (fetch_read(conn, buf, 2) != 2) {
+ ret = SOCKS5_ERR_READ_METHOD;
+ goto fail;
+ }
+
+ ptr = buf;
+ if (ptr[0] != SOCKS_VERSION_5) {
+ ret = SOCKS5_ERR_VER5_ONLY;
+ goto fail;
+ }
+ if (ptr[1] == SOCKS_NOMETHODS) {
+ ret = SOCKS5_ERR_NOMETHODS;
+ goto fail;
+ }
+ else if (ptr[1] != SOCKS5_NOTIMPLEMENTED) {
+ ret = SOCKS5_ERR_NOTIMPLEMENTED;
+ goto fail;
+ }
+
+ /* Send Request */
+ *ptr++ = SOCKS_VERSION_5;
+ *ptr++ = SOCKS_CONNECTION;
+ *ptr++ = SOCKS_RSV;
+ /* Encode all targets as a hostname to avoid DNS leaks */
+ *ptr++ = SOCKS_ATYP_DOMAINNAME;
+ if (strlen(host) > FQDN_SIZE) {
+ ret = SOCKS5_ERR_HOSTNAME_SIZE;
+ goto fail;
+ }
+ *ptr++ = strlen(host);
+ strncpy(ptr, host, strlen(host));
+ ptr = ptr + strlen(host);
+
+ port = htons(port);
+ *ptr++ = port & 0x00ff;
+ *ptr++ = (port & 0xff00) >> 8;
+
+ if (fetch_write(conn, buf, ptr - buf) != ptr - buf) {
+ ret = SOCKS5_ERR_REQUEST;
+ goto fail;
+ }
+
+ /* BND.ADDR is variable length, read the largest on non-blocking socket */
+ if (!fetch_read(conn, buf, BUFF_SIZE)) {
+ ret = SOCKS5_ERR_REPLY;
+ goto fail;
+ }
+
+ ptr = buf;
+ if (*ptr++ != SOCKS_VERSION_5) {
+ ret = SOCKS5_ERR_NON_VER5_RESP;
+ goto fail;
+ }
+
+ switch(*ptr++) {
+ case SOCKS_SUCCESS:
+ break;
+ case SOCKS_GENERAL_FAILURE:
+ ret = SOCKS5_ERR_GENERAL;
+ goto fail;
+ case SOCKS_CONNECTION_NOT_ALLOWED:
+ ret = SOCKS5_ERR_NOT_ALLOWED;
+ goto fail;
+ case SOCKS_NETWORK_UNREACHABLE:
+ ret = SOCKS5_ERR_NET_UNREACHABLE;
+ goto fail;
+ case SOCKS_HOST_UNREACHABLE:
+ ret = SOCKS5_ERR_HOST_UNREACHABLE;
+ goto fail;
+ case SOCKS_CONNECTION_REFUSED:
+ ret = SOCKS5_ERR_CONN_REFUSED;
+ goto fail;
+ case SOCKS_TTL_EXPIRED:
+ ret = SOCKS5_ERR_TTL_EXPIRED;
+ goto fail;
+ case SOCKS_COMMAND_NOT_SUPPORTED:
+ ret = SOCKS5_ERR_COM_UNSUPPORTED;
+ goto fail;
+ case SOCKS_ADDRESS_NOT_SUPPORTED:
+ ret = SOCKS5_ERR_ADDR_UNSUPPORTED;
+ goto fail;
+ default:
+ ret = SOCKS5_ERR_UNSPECIFIED;
+ goto fail;
+ }
+
+ return (ret);
+
+fail:
+ socks5_seterr(ret);
+ return (0);
+}
+
+/*
+ * Perform SOCKS5 initialization
+ */
+int
+fetch_socks5_getenv(char **host, int *port)
+{
+ char *socks5env, *endptr, *ext;
+ const char *portDelim;
+ size_t slen;
+
+ portDelim = ":";
+ if ((socks5env = getenv("SOCKS5_PROXY")) == NULL || *socks5env == '\0') {
+ *host = NULL;
+ *port = -1;
+ return (-1);
+ }
+
+ /*
+ * IPv6 addresses begin and end in brackets. Set the port delimiter
+ * accordingly and search for it so we can do appropriate validation.
+ */
+ if (socks5env[0] == '[')
+ portDelim = "]:";
+
+ slen = strlen(socks5env);
+ ext = strstr(socks5env, portDelim);
+ if (socks5env[0] == '[') {
+ if (socks5env[slen - 1] == ']') {
+ *host = strndup(socks5env, slen);
+ } else if (ext != NULL) {
+ *host = strndup(socks5env, ext - socks5env + 1);
+ } else {
+ socks5_seterr(SOCKS5_ERR_BAD_PROXY_FORMAT);
+ return (0);
+ }
+ } else {
+ *host = strndup(socks5env, ext - socks5env);
+ }
+
+ if (*host == NULL) {
+ fprintf(stderr, "Failure to allocate memory, exiting.\n");
+ return (-1);
+ }
+ if (ext == NULL) {
+ *port = 1080; /* Default port as defined in RFC1928 */
+ } else {
+ ext += strlen(portDelim);
+ errno = 0;
+ *port = strtoimax(ext, (char **)&endptr, 10);
+ if (*endptr != '\0' || errno != 0 || *port < 0 ||
+ *port > 65535) {
+ free(*host);
+ *host = NULL;
+ socks5_seterr(SOCKS5_ERR_BAD_PORT);
+ return (0);
+ }
+ }
+
+ return (2);
+}
+
+
+/*
* Establish a TCP connection to the specified port on the specified host.
*/
conn_t *
@@ -346,22 +590,46 @@ fetch_connect(const char *host, int port, int af, int
const char *bindaddr;
conn_t *conn = NULL;
int err = 0, sd = -1;
+ char *sockshost;
+ int socksport;
DEBUGF("---> %s:%d\n", host, port);
- /* resolve server address */
- if (verbose)
- fetch_info("resolving server address: %s:%d", host, port);
- if ((sais = fetch_resolve(host, port, af)) == NULL)
+ /*
+ * Check if SOCKS5_PROXY env variable is set. fetch_socks5_getenv
+ * will either set sockshost = NULL or allocate memory in all cases.
+ */
+ sockshost = NULL;
+ if (!fetch_socks5_getenv(&sockshost, &socksport))
goto fail;
- /* resolve client address */
- bindaddr = getenv("FETCH_BIND_ADDRESS");
- if (bindaddr != NULL && *bindaddr != '\0') {
+ /* Not using SOCKS5 proxy */
+ if (sockshost == NULL) {
+ /* resolve server address */
if (verbose)
- fetch_info("resolving client address: %s", bindaddr);
- if ((cais = fetch_resolve(bindaddr, 0, af)) == NULL)
+ fetch_info("resolving server address: %s:%d", host,
+ port);
+ if ((sais = fetch_resolve(host, port, af)) == NULL)
goto fail;
+
+ /* resolve client address */
+ bindaddr = getenv("FETCH_BIND_ADDRESS");
+ if (bindaddr != NULL && *bindaddr != '\0') {
+ if (verbose)
+ fetch_info("resolving client address: %s",
+ bindaddr);
+ if ((cais = fetch_resolve(bindaddr, 0, af)) == NULL)
+ goto fail;
+ }
+ } else {
+ /* resolve socks5 proxy address */
+ if (verbose)
+ fetch_info("resolving SOCKS5 server address: %s:%d",
+ sockshost, socksport);
+ if ((sais = fetch_resolve(sockshost, socksport, af)) == NULL) {
+ socks5_seterr(SOCKS5_ERR_BAD_HOST);
+ goto fail;
+ }
}
/* try each server address in turn */
@@ -389,13 +657,26 @@ fetch_connect(const char *host, int port, int af, int
sd = -1;
}
if (err != 0) {
- if (verbose)
+ if (verbose && sockshost == NULL) {
fetch_info("failed to connect to %s:%d", host, port);
+ goto syserr;
+ } else if (sockshost != NULL) {
+ if (verbose)
+ fetch_info(
+ "failed to connect to SOCKS5 server %s:%d",
+ sockshost, socksport);
+ socks5_seterr(SOCKS5_ERR_CONN_REFUSED);
+ goto fail;
+ }
goto syserr;
}
if ((conn = fetch_reopen(sd)) == NULL)
goto syserr;
+
+ if (sockshost)
+ if (!fetch_socks5_init(conn, host, port, verbose))
+ goto fail;
if (cais != NULL)
freeaddrinfo(cais);
if (sais != NULL)
@@ -403,8 +684,8 @@ fetch_connect(const char *host, int port, int af, int
return (conn);
syserr:
fetch_syserr();
- goto fail;
fail:
+ free(sockshost);
if (sd >= 0)
close(sd);
if (cais != NULL)
Modified: projects/clang1000-import/lib/libfetch/common.h
==============================================================================
--- projects/clang1000-import/lib/libfetch/common.h Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/lib/libfetch/common.h Sun Feb 16 13:23:54 2020 (r358000)
@@ -70,12 +70,47 @@ struct fetcherr {
const char *string;
};
+/* For SOCKS header size */
+#define HEAD_SIZE 4
+#define FQDN_SIZE 256
+#define PACK_SIZE 1
+#define PORT_SIZE 2
+#define BUFF_SIZE HEAD_SIZE + FQDN_SIZE + PACK_SIZE + PORT_SIZE
+
+/* SOCKS5 Request Header */
+#define SOCKS_VERSION_5 0x05
+/* SOCKS5 CMD */
+#define SOCKS_CONNECTION 0x01
+#define SOCKS_BIND 0x02
+#define SOCKS_UDP 0x03
+#define SOCKS_NOMETHODS 0xFF
+#define SOCKS5_NOTIMPLEMENTED 0x00
+/* SOCKS5 Reserved */
+#define SOCKS_RSV 0x00
+/* SOCKS5 Address Type */
+#define SOCKS_ATYP_IPV4 0x01
+#define SOCKS_ATYP_DOMAINNAME 0x03
+#define SOCKS_ATYP_IPV6 0x04
+/* SOCKS5 Reply Field */
+#define SOCKS_SUCCESS 0x00
+#define SOCKS_GENERAL_FAILURE 0x01
+#define SOCKS_CONNECTION_NOT_ALLOWED 0x02
+#define SOCKS_NETWORK_UNREACHABLE 0x03
+#define SOCKS_HOST_UNREACHABLE 0x04
+#define SOCKS_CONNECTION_REFUSED 0x05
+#define SOCKS_TTL_EXPIRED 0x06
+#define SOCKS_COMMAND_NOT_SUPPORTED 0x07
+#define SOCKS_ADDRESS_NOT_SUPPORTED 0x08
+
/* for fetch_writev */
struct iovec;
void fetch_seterr(struct fetcherr *, int);
void fetch_syserr(void);
void fetch_info(const char *, ...) __printflike(1, 2);
+int fetch_socks5_getenv(char **host, int *port);
+int fetch_socks5_init(conn_t *conn, const char *host,
+ int port, int verbose);
int fetch_default_port(const char *);
int fetch_default_proxy_port(const char *);
struct addrinfo *fetch_resolve(const char *, int, int);
@@ -102,6 +137,7 @@ int fetch_no_proxy_match(const char *);
#define http_seterr(n) fetch_seterr(http_errlist, n)
#define netdb_seterr(n) fetch_seterr(netdb_errlist, n)
#define url_seterr(n) fetch_seterr(url_errlist, n)
+#define socks5_seterr(n) fetch_seterr(socks5_errlist, n)
#ifndef NDEBUG
#define DEBUGF(...) \
Modified: projects/clang1000-import/lib/libfetch/fetch.3
==============================================================================
--- projects/clang1000-import/lib/libfetch/fetch.3 Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/lib/libfetch/fetch.3 Sun Feb 16 13:23:54 2020 (r358000)
@@ -668,6 +668,13 @@ which proxies should not be used.
Same as
.Ev NO_PROXY ,
for compatibility.
+.It Ev SOCKS5_PROXY
+Uses SOCKS version 5 to make connection.
+The format must be the IP or hostname followed by a colon for the port.
+IPv6 addresses must enclose the address in brackets.
+If no port is specified, the default is 1080.
+This setting will supercede a connection to an
+.Ev HTTP_PROXY .
.It Ev SSL_ALLOW_SSL3
Allow SSL version 3 when negotiating the connection (not recommended).
.It Ev SSL_CA_CERT_FILE
@@ -724,6 +731,21 @@ host, define
as follows:
.Bd -literal -offset indent
NO_PROXY=localhost,127.0.0.1
+.Ed
+.Pp
+To use a SOCKS5 proxy, set the
+.Ev SOCKS5_PROXY
+environment variable to a
+valid host or IP followed by an optional colon and the port.
+IPv6 addresses must be enclosed in brackets.
+The following are examples of valid settings:
+.Bd -literal -offset indent
+SOCKS5_PROXY=proxy.example.com
+SOCKS5_PROXY=proxy.example.com:1080
+SOCKS5_PROXY=192.0.2.0
+SOCKS5_PROXY=198.51.100.0:1080
+SOCKS5_PROXY=[2001:db8::1]
+SOCKS5_PROXY=[2001:db8::2]:1080
.Ed
.Pp
Access HTTPS website without any certificate verification whatsoever:
Modified: projects/clang1000-import/lib/libthr/pthread.map
==============================================================================
--- projects/clang1000-import/lib/libthr/pthread.map Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/lib/libthr/pthread.map Sun Feb 16 13:23:54 2020 (r358000)
@@ -326,3 +326,7 @@ FBSD_1.4 {
FBSD_1.5 {
pthread_get_name_np;
};
+
+FBSD_1.6 {
+ pthread_peekjoin_np;
+};
Modified: projects/clang1000-import/lib/libthr/thread/thr_join.c
==============================================================================
--- projects/clang1000-import/lib/libthr/thread/thr_join.c Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/lib/libthr/thread/thr_join.c Sun Feb 16 13:23:54 2020 (r358000)
@@ -36,13 +36,15 @@ __FBSDID("$FreeBSD$");
#include "thr_private.h"
+int _pthread_peekjoin_np(pthread_t pthread, void **thread_return);
int _pthread_timedjoin_np(pthread_t pthread, void **thread_return,
- const struct timespec *abstime);
-static int join_common(pthread_t, void **, const struct timespec *);
+ const struct timespec *abstime);
+static int join_common(pthread_t, void **, const struct timespec *, bool peek);
__weak_reference(_thr_join, pthread_join);
__weak_reference(_thr_join, _pthread_join);
__weak_reference(_pthread_timedjoin_np, pthread_timedjoin_np);
+__weak_reference(_pthread_peekjoin_np, pthread_peekjoin_np);
static void backout_join(void *arg)
{
@@ -57,7 +59,7 @@ static void backout_join(void *arg)
int
_thr_join(pthread_t pthread, void **thread_return)
{
- return (join_common(pthread, thread_return, NULL));
+ return (join_common(pthread, thread_return, NULL, false));
}
int
@@ -68,22 +70,28 @@ _pthread_timedjoin_np(pthread_t pthread, void **thread
abstime->tv_nsec >= 1000000000)
return (EINVAL);
- return (join_common(pthread, thread_return, abstime));
+ return (join_common(pthread, thread_return, abstime, false));
}
+int
+_pthread_peekjoin_np(pthread_t pthread, void **thread_return)
+{
+ return (join_common(pthread, thread_return, NULL, true));
+}
+
/*
* Cancellation behavior:
* if the thread is canceled, joinee is not recycled.
*/
static int
join_common(pthread_t pthread, void **thread_return,
- const struct timespec *abstime)
+ const struct timespec *abstime, bool peek)
{
struct pthread *curthread = _get_curthread();
struct timespec ts, ts2, *tsp;
void *tmp;
long tid;
- int ret = 0;
+ int ret;
if (pthread == NULL)
return (EINVAL);
@@ -100,10 +108,21 @@ join_common(pthread_t pthread, void **thread_return,
/* Multiple joiners are not supported. */
ret = ENOTSUP;
}
- if (ret) {
+ if (ret != 0) {
THR_THREAD_UNLOCK(curthread, pthread);
return (ret);
}
+
+ /* Only peek into status, do not gc the thread. */
+ if (peek) {
+ if (pthread->tid != TID_TERMINATED)
+ ret = EBUSY;
+ else if (thread_return != NULL)
+ *thread_return = pthread->ret;
+ THR_THREAD_UNLOCK(curthread, pthread);
+ return (ret);
+ }
+
/* Set the running thread to be the joiner: */
pthread->joiner = curthread;
Modified: projects/clang1000-import/sbin/ping6/ping6.c
==============================================================================
--- projects/clang1000-import/sbin/ping6/ping6.c Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/sbin/ping6/ping6.c Sun Feb 16 13:23:54 2020 (r358000)
@@ -238,6 +238,7 @@ static long npackets; /* max packets to transmit */
static long nreceived; /* # of packets we got back */
static long nrepeats; /* number of duplicates */
static long ntransmitted; /* sequence # for outbound packets = #sent */
+static long ntransmitfailures; /* number of transmit failures */
static int interval = 1000; /* interval between packets in ms */
static int waittime = MAXWAIT; /* timeout for each packet */
static long nrcvtimeout = 0; /* # of packets we got back after waittime */
@@ -1256,7 +1257,12 @@ main(int argc, char *argv[])
if(packet != NULL)
free(packet);
- exit(nreceived == 0 ? 2 : 0);
+ if (nreceived > 0)
+ exit(0);
+ else if (ntransmitted > ntransmitfailures)
+ exit(2);
+ else
+ exit(EX_OSERR);
}
static void
@@ -1423,8 +1429,10 @@ pinger(void)
i = sendmsg(ssend, &smsghdr, 0);
if (i < 0 || i != cc) {
- if (i < 0)
+ if (i < 0) {
+ ntransmitfailures++;
warn("sendmsg");
+ }
(void)printf("ping6: wrote %s %d chars, ret=%d\n",
hostname, cc, i);
}
Modified: projects/clang1000-import/share/man/man3/Makefile
==============================================================================
--- projects/clang1000-import/share/man/man3/Makefile Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/share/man/man3/Makefile Sun Feb 16 13:23:54 2020 (r358000)
@@ -500,7 +500,8 @@ PTHREAD_MLINKS+=pthread_spin_init.3 pthread_spin_destr
PTHREAD_MLINKS+=pthread_switch_add_np.3 pthread_switch_delete_np.3
PTHREAD_MLINKS+=pthread_testcancel.3 pthread_setcancelstate.3 \
pthread_testcancel.3 pthread_setcanceltype.3
-PTHREAD_MLINKS+=pthread_join.3 pthread_timedjoin_np.3
+PTHREAD_MLINKS+=pthread_join.3 pthread_peekjoin_np.3 \
+ pthread_join.3 pthread_timedjoin_np.3
.endif
.include <bsd.prog.mk>
Modified: projects/clang1000-import/share/man/man3/pthread_join.3
==============================================================================
--- projects/clang1000-import/share/man/man3/pthread_join.3 Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/share/man/man3/pthread_join.3 Sun Feb 16 13:23:54 2020 (r358000)
@@ -30,13 +30,14 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 3, 2018
+.Dd February 13, 2019
.Dt PTHREAD_JOIN 3
.Os
.Sh NAME
.Nm pthread_join ,
+.Nm pthread_peekjoin_np ,
.Nm pthread_timedjoin_np
-.Nd wait for thread termination
+.Nd inspect thread termination state
.Sh LIBRARY
.Lb libpthread
.Sh SYNOPSIS
@@ -45,7 +46,16 @@
.Fn pthread_join "pthread_t thread" "void **value_ptr"
.In pthread_np.h
.Ft int
-.Fn pthread_timedjoin_np "pthread_t thread" "void **value_ptr" "const struct timespec *abstime"
+.Fo pthread_peekjoin_np
+.Fa "pthread_t thread"
+.Fa "void **value_ptr"
+.Fc
+.Ft int
+.Fo pthread_timedjoin_np
+.Fa "pthread_t thread"
+.Fa "void **value_ptr"
+.Fa "const struct timespec *abstime"
+.Fc
.Sh DESCRIPTION
The
.Fn pthread_join
@@ -82,19 +92,30 @@ function except it will return
.Er ETIMEDOUT
if target thread does not exit before specified absolute time passes.
.Pp
+The
+.Fn pthread_peekjoin_np
+only peeks into the exit status of the specified thread.
+If the thread has not exited, the
+.Er EBUSY
+error is returned.
+Otherwise, zero is returned and the thread exit value is optionally stored
+into the location of
+.Fa *value_ptr .
+The target thread is left unjoined and can be used as an argument for
+the
+.Fn pthread_join
+family of functions again.
+.Pp
A thread that has exited but remains unjoined counts against
[_POSIX_THREAD_THREADS_MAX].
.Sh RETURN VALUES
-If successful, the
-.Fn pthread_join
-and
-.Fn pthread_timedjoin_np
-functions will return zero.
-Otherwise an error number will be returned to
-indicate the error.
+If successful, the described functions return zero.
+Otherwise an error number is returned to indicate the error or
+special condition.
.Sh ERRORS
The
-.Fn pthread_join
+.Fn pthread_join ,
+.Fn pthread_peekjoin_np ,
and
.Fn pthread_timedjoin_np
functions will fail if:
@@ -125,6 +146,14 @@ The specified absolute time passed while
.Fn pthread_timedjoin_np
waited for thread exit.
.El
+.Pp
+The
+.Fn pthread_peekjoin_np
+function will also fail if:
+.Bl -tag -width Er
+.It Bq Er EBUSY
+The specified thread has not yet exited.
+.El
.Sh SEE ALSO
.Xr wait 2 ,
.Xr pthread_create 3
@@ -139,3 +168,7 @@ function is a
.Fx
extension which first appeared in
.Fx 6.1 .
+Another extension, the
+.Fn pthread_peekjoin_np
+function, first appearead in
+.Fx 13.0 .
Modified: projects/clang1000-import/share/man/man9/malloc.9
==============================================================================
--- projects/clang1000-import/share/man/man9/malloc.9 Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/share/man/man9/malloc.9 Sun Feb 16 13:23:54 2020 (r358000)
@@ -49,6 +49,8 @@
.Fn mallocarray "size_t nmemb" "size_t size" "struct malloc_type *type" "int flags"
.Ft void
.Fn free "void *addr" "struct malloc_type *type"
+.Ft void
+.Fn zfree "void *addr" "struct malloc_type *type"
.Ft void *
.Fn realloc "void *addr" "size_t size" "struct malloc_type *type" "int flags"
.Ft void *
@@ -105,6 +107,19 @@ is
then
.Fn free
does nothing.
+.Pp
+Like
+.Fn free ,
+the
+.Fn zfree
+function releases memory at address
+.Fa addr
+that was previously allocated by
+.Fn malloc
+for re-use.
+However,
+.Fn zfree
+will zero the memory before it is released.
.Pp
The
.Fn realloc
Modified: projects/clang1000-import/share/misc/committers-ports.dot
==============================================================================
--- projects/clang1000-import/share/misc/committers-ports.dot Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/share/misc/committers-ports.dot Sun Feb 16 13:23:54 2020 (r358000)
@@ -155,6 +155,7 @@ jylefort [label="Jean-Yves Lefort\njylefort at FreeBSD.or
kai [label="Kai Knoblich\nkai at FreeBSD.org\n2019/02/01"]
kami [label="Dominic Fandrey\nkami at FreeBSD.org\n2014/09/09"]
kbowling [label="Kevin Bowling\nkbowling at FreeBSD.org\n2018/09/02"]
+kevans [label="Kyle Evans\nkevans at FreeBSD.org\n2020/02/14"]
kevlo [label="Kevin Lo\nkevlo at FreeBSD.org\n2003/02/21"]
kmoore [label="Kris Moore\nkmoore at FreeBSD.org\n2009/04/14"]
knu [label="Akinori Musha\nknu at FreeBSD.org\n2000/03/22"]
@@ -339,6 +340,7 @@ bapt -> ericbsd
bapt -> grembo
bapt -> jbeich
bapt -> jlaffaye
+bapt -> kevans
bapt -> manu
bapt -> marius
bapt -> marino
@@ -503,6 +505,7 @@ knu -> nork
koobs -> brnrd
koobs -> kami
+koobs -> kevans
koobs -> woodsb02
koobs -> xmj
Modified: projects/clang1000-import/sys/amd64/vmm/amd/amdvi_hw.c
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/amd/amdvi_hw.c Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/sys/amd64/vmm/amd/amdvi_hw.c Sun Feb 16 13:23:54 2020 (r358000)
@@ -58,7 +58,8 @@ __FBSDID("$FreeBSD$");
#include "amdvi_priv.h"
SYSCTL_DECL(_hw_vmm);
-SYSCTL_NODE(_hw_vmm, OID_AUTO, amdvi, CTLFLAG_RW, NULL, NULL);
+SYSCTL_NODE(_hw_vmm, OID_AUTO, amdvi, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
+ NULL);
#define MOD_INC(a, s, m) (((a) + (s)) % ((m) * (s)))
#define MOD_DEC(a, s, m) (((a) - (s)) % ((m) * (s)))
@@ -947,16 +948,16 @@ amdvi_add_sysctl(struct amdvi_softc *softc)
SYSCTL_ADD_U16(ctx, child, OID_AUTO, "end_dev_rid", CTLFLAG_RD,
&softc->end_dev_rid, 0, "End of device under this IOMMU");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "command_head",
- CTLTYPE_UINT | CTLFLAG_RD, softc, 0,
+ CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, softc, 0,
amdvi_handle_sysctl, "IU", "Command head");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "command_tail",
- CTLTYPE_UINT | CTLFLAG_RD, softc, 1,
+ CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, softc, 1,
amdvi_handle_sysctl, "IU", "Command tail");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "event_head",
- CTLTYPE_UINT | CTLFLAG_RD, softc, 2,
+ CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, softc, 2,
amdvi_handle_sysctl, "IU", "Command head");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "event_tail",
- CTLTYPE_UINT | CTLFLAG_RD, softc, 3,
+ CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, softc, 3,
amdvi_handle_sysctl, "IU", "Command tail");
}
Modified: projects/clang1000-import/sys/amd64/vmm/amd/npt.c
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/amd/npt.c Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/sys/amd64/vmm/amd/npt.c Sun Feb 16 13:23:54 2020 (r358000)
@@ -41,7 +41,8 @@ __FBSDID("$FreeBSD$");
#include "npt.h"
SYSCTL_DECL(_hw_vmm);
-SYSCTL_NODE(_hw_vmm, OID_AUTO, npt, CTLFLAG_RW, NULL, NULL);
+SYSCTL_NODE(_hw_vmm, OID_AUTO, npt, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
+ NULL);
static int npt_flags;
SYSCTL_INT(_hw_vmm_npt, OID_AUTO, pmap_flags, CTLFLAG_RD,
Modified: projects/clang1000-import/sys/amd64/vmm/amd/svm.c
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/amd/svm.c Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/sys/amd64/vmm/amd/svm.c Sun Feb 16 13:23:54 2020 (r358000)
@@ -67,7 +67,8 @@ __FBSDID("$FreeBSD$");
#include "npt.h"
SYSCTL_DECL(_hw_vmm);
-SYSCTL_NODE(_hw_vmm, OID_AUTO, svm, CTLFLAG_RW, NULL, NULL);
+SYSCTL_NODE(_hw_vmm, OID_AUTO, svm, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
+ NULL);
/*
* SVM CPUID function 0x8000_000A, edx bit decoding.
Modified: projects/clang1000-import/sys/amd64/vmm/intel/ept.c
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/intel/ept.c Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/sys/amd64/vmm/intel/ept.c Sun Feb 16 13:23:54 2020 (r358000)
@@ -68,7 +68,8 @@ __FBSDID("$FreeBSD$");
#define EPT_ENABLE_AD_BITS (1 << 6)
SYSCTL_DECL(_hw_vmm);
-SYSCTL_NODE(_hw_vmm, OID_AUTO, ept, CTLFLAG_RW, NULL, NULL);
+SYSCTL_NODE(_hw_vmm, OID_AUTO, ept, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
+ NULL);
static int ept_enable_ad_bits;
Modified: projects/clang1000-import/sys/amd64/vmm/intel/vmx.c
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/intel/vmx.c Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/sys/amd64/vmm/intel/vmx.c Sun Feb 16 13:23:54 2020 (r358000)
@@ -123,7 +123,8 @@ static MALLOC_DEFINE(M_VMX, "vmx", "vmx");
static MALLOC_DEFINE(M_VLAPIC, "vlapic", "vlapic");
SYSCTL_DECL(_hw_vmm);
-SYSCTL_NODE(_hw_vmm, OID_AUTO, vmx, CTLFLAG_RW, NULL, NULL);
+SYSCTL_NODE(_hw_vmm, OID_AUTO, vmx, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
+ NULL);
int vmxon_enabled[MAXCPU];
static char vmxon_region[MAXCPU][PAGE_SIZE] __aligned(PAGE_SIZE);
@@ -150,7 +151,9 @@ SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, initialized, CTLFLAG
/*
* Optional capabilities
*/
-static SYSCTL_NODE(_hw_vmm_vmx, OID_AUTO, cap, CTLFLAG_RW, NULL, NULL);
+static SYSCTL_NODE(_hw_vmm_vmx, OID_AUTO, cap,
+ CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
+ NULL);
static int cap_halt_exit;
SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, halt_exit, CTLFLAG_RD, &cap_halt_exit, 0,
Modified: projects/clang1000-import/sys/amd64/vmm/io/iommu.c
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/io/iommu.c Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/sys/amd64/vmm/io/iommu.c Sun Feb 16 13:23:54 2020 (r358000)
@@ -48,7 +48,8 @@ __FBSDID("$FreeBSD$");
#include "iommu.h"
SYSCTL_DECL(_hw_vmm);
-SYSCTL_NODE(_hw_vmm, OID_AUTO, iommu, CTLFLAG_RW, 0, "bhyve iommu parameters");
+SYSCTL_NODE(_hw_vmm, OID_AUTO, iommu, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
+ "bhyve iommu parameters");
static int iommu_avail;
SYSCTL_INT(_hw_vmm_iommu, OID_AUTO, initialized, CTLFLAG_RD, &iommu_avail,
Modified: projects/clang1000-import/sys/amd64/vmm/io/ppt.c
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/io/ppt.c Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/sys/amd64/vmm/io/ppt.c Sun Feb 16 13:23:54 2020 (r358000)
@@ -112,7 +112,8 @@ struct pptdev {
};
SYSCTL_DECL(_hw_vmm);
-SYSCTL_NODE(_hw_vmm, OID_AUTO, ppt, CTLFLAG_RW, 0, "bhyve passthru devices");
+SYSCTL_NODE(_hw_vmm, OID_AUTO, ppt, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
+ "bhyve passthru devices");
static int num_pptdevs;
SYSCTL_INT(_hw_vmm_ppt, OID_AUTO, devices, CTLFLAG_RD, &num_pptdevs, 0,
Modified: projects/clang1000-import/sys/amd64/vmm/io/vrtc.c
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/io/vrtc.c Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/sys/amd64/vmm/io/vrtc.c Sun Feb 16 13:23:54 2020 (r358000)
@@ -106,7 +106,8 @@ static void vrtc_set_reg_c(struct vrtc *vrtc, uint8_t
static MALLOC_DEFINE(M_VRTC, "vrtc", "bhyve virtual rtc");
SYSCTL_DECL(_hw_vmm);
-SYSCTL_NODE(_hw_vmm, OID_AUTO, vrtc, CTLFLAG_RW, NULL, NULL);
+SYSCTL_NODE(_hw_vmm, OID_AUTO, vrtc, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
+ NULL);
static int rtc_flag_broken_time = 1;
SYSCTL_INT(_hw_vmm_vrtc, OID_AUTO, flag_broken_time, CTLFLAG_RDTUN,
Modified: projects/clang1000-import/sys/amd64/vmm/vmm.c
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/vmm.c Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/sys/amd64/vmm/vmm.c Sun Feb 16 13:23:54 2020 (r358000)
@@ -215,7 +215,8 @@ static MALLOC_DEFINE(M_VM, "vm", "vm");
/* statistics */
static VMM_STAT(VCPU_TOTAL_RUNTIME, "vcpu total runtime");
-SYSCTL_NODE(_hw, OID_AUTO, vmm, CTLFLAG_RW, NULL, NULL);
+SYSCTL_NODE(_hw, OID_AUTO, vmm, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
+ NULL);
/*
* Halt the guest if all vcpus are executing a HLT instruction with
Modified: projects/clang1000-import/sys/amd64/vmm/vmm_dev.c
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/vmm_dev.c Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/sys/amd64/vmm/vmm_dev.c Sun Feb 16 13:23:54 2020 (r358000)
@@ -962,8 +962,9 @@ out:
return (error);
}
SYSCTL_PROC(_hw_vmm, OID_AUTO, destroy,
- CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON,
- NULL, 0, sysctl_vmm_destroy, "A", NULL);
+ CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE,
+ NULL, 0, sysctl_vmm_destroy, "A",
+ NULL);
static struct cdevsw vmmdevsw = {
.d_name = "vmmdev",
@@ -1045,8 +1046,9 @@ out:
return (error);
}
SYSCTL_PROC(_hw_vmm, OID_AUTO, create,
- CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON,
- NULL, 0, sysctl_vmm_create, "A", NULL);
+ CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE,
+ NULL, 0, sysctl_vmm_create, "A",
+ NULL);
void
vmmdev_init(void)
Modified: projects/clang1000-import/sys/amd64/vmm/x86.c
==============================================================================
--- projects/clang1000-import/sys/amd64/vmm/x86.c Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/sys/amd64/vmm/x86.c Sun Feb 16 13:23:54 2020 (r358000)
@@ -50,7 +50,8 @@ __FBSDID("$FreeBSD$");
#include "x86.h"
SYSCTL_DECL(_hw_vmm);
-static SYSCTL_NODE(_hw_vmm, OID_AUTO, topology, CTLFLAG_RD, 0, NULL);
+static SYSCTL_NODE(_hw_vmm, OID_AUTO, topology, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
+ NULL);
#define CPUID_VM_HIGH 0x40000000
Modified: projects/clang1000-import/sys/cam/cam_periph.c
==============================================================================
--- projects/clang1000-import/sys/cam/cam_periph.c Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/sys/cam/cam_periph.c Sun Feb 16 13:23:54 2020 (r358000)
@@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$");
#include <cam/cam_periph.h>
#include <cam/cam_debug.h>
#include <cam/cam_sim.h>
-#include <cam/cam_xpt_internal.h> /* For KASSERTs only */
#include <cam/scsi/scsi_all.h>
#include <cam/scsi/scsi_message.h>
@@ -682,10 +681,6 @@ camperiphfree(struct cam_periph *periph)
cam_periph_assert(periph, MA_OWNED);
KASSERT(periph->periph_allocating == 0, ("%s%d: freed while allocating",
periph->periph_name, periph->unit_number));
- KASSERT(periph->path->device->ccbq.dev_active == 0,
- ("%s%d: freed with %d active CCBs\n",
- periph->periph_name, periph->unit_number,
- periph->path->device->ccbq.dev_active));
for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) {
if (strcmp((*p_drv)->driver_name, periph->periph_name) == 0)
break;
Modified: projects/clang1000-import/sys/compat/linuxkpi/common/src/linux_compat.c
==============================================================================
--- projects/clang1000-import/sys/compat/linuxkpi/common/src/linux_compat.c Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/sys/compat/linuxkpi/common/src/linux_compat.c Sun Feb 16 13:23:54 2020 (r358000)
@@ -91,7 +91,8 @@ __FBSDID("$FreeBSD$");
#include <asm/smp.h>
#endif
-SYSCTL_NODE(_compat, OID_AUTO, linuxkpi, CTLFLAG_RW, 0, "LinuxKPI parameters");
+SYSCTL_NODE(_compat, OID_AUTO, linuxkpi, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
+ "LinuxKPI parameters");
int linuxkpi_debug;
SYSCTL_INT(_compat_linuxkpi, OID_AUTO, debug, CTLFLAG_RWTUN,
@@ -2441,8 +2442,8 @@ linux_compat_init(void *arg)
kobject_init(&linux_root_device.kobj, &linux_dev_ktype);
kobject_set_name(&linux_root_device.kobj, "device");
linux_root_device.kobj.oidp = SYSCTL_ADD_NODE(NULL,
- SYSCTL_CHILDREN(rootoid), OID_AUTO, "device", CTLFLAG_RD, NULL,
- "device");
+ SYSCTL_CHILDREN(rootoid), OID_AUTO, "device",
+ CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "device");
linux_root_device.bsddev = root_bus;
linux_class_misc.name = "misc";
class_register(&linux_class_misc);
Modified: projects/clang1000-import/sys/conf/files
==============================================================================
--- projects/clang1000-import/sys/conf/files Sun Feb 16 13:22:36 2020 (r357999)
+++ projects/clang1000-import/sys/conf/files Sun Feb 16 13:23:54 2020 (r358000)
@@ -4824,6 +4824,23 @@ crypto/libsodium/randombytes.c optional crypto \
compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include -I$S/crypto/libsodium"
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-projects
mailing list