From owner-svn-src-head@freebsd.org Sun Jan 20 00:45:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CA401499352; Sun, 20 Jan 2019 00:45:46 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6B1375278; Sun, 20 Jan 2019 00:45:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A132122468; Sun, 20 Jan 2019 00:45:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0K0jjaP001333; Sun, 20 Jan 2019 00:45:45 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0K0jjqB001329; Sun, 20 Jan 2019 00:45:45 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901200045.x0K0jjqB001329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 20 Jan 2019 00:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343204 - in head: sbin/ifconfig sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in head: sbin/ifconfig sys/net80211 X-SVN-Commit-Revision: 343204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C6B1375278 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.930,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 00:45:46 -0000 Author: gonzo Date: Sun Jan 20 00:45:44 2019 New Revision: 343204 URL: https://svnweb.freebsd.org/changeset/base/343204 Log: [ifconfig] Print more WPS attributes in verbose "list scan" output - Move WPS related defines to dedicated file - Add handlers for more WPS attributes PR: 217317 Submitted by: J.R. Oldroyd MFC after: 3 weeks Added: head/sys/net80211/ieee80211_wps.h (contents, props changed) Modified: head/sbin/ifconfig/ifieee80211.c head/sys/net80211/ieee80211.h Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Sat Jan 19 20:45:41 2019 (r343203) +++ head/sbin/ifconfig/ifieee80211.c Sun Jan 20 00:45:44 2019 (r343204) @@ -77,6 +77,7 @@ #include #include #include +#include #include #include @@ -3129,13 +3130,6 @@ printrsnie(const char *tag, const u_int8_t *ie, size_t } } -/* XXX move to a public include file */ -#define IEEE80211_WPS_DEV_PASS_ID 0x1012 -#define IEEE80211_WPS_SELECTED_REG 0x1041 -#define IEEE80211_WPS_SETUP_STATE 0x1044 -#define IEEE80211_WPS_UUID_E 0x1047 -#define IEEE80211_WPS_VERSION 0x104a - #define BE_READ_2(p) \ ((u_int16_t) \ ((((const u_int8_t *)(p))[1] ) | \ @@ -3157,6 +3151,7 @@ printwpsie(const char *tag, const u_int8_t *ie, size_t "R" /* Registrar-specified */ }; int n; + int f; ie +=6, len -= 4; /* NB: len is payload only */ @@ -3165,6 +3160,7 @@ printwpsie(const char *tag, const u_int8_t *ie, size_t while (len) { uint16_t tlv_type = BE_READ_2(ie); uint16_t tlv_len = BE_READ_2(ie + 2); + uint16_t cfg_mthd; /* some devices broadcast invalid WPS frames */ if (tlv_len > len) { @@ -3177,30 +3173,191 @@ printwpsie(const char *tag, const u_int8_t *ie, size_t ie += 4, len -= 4; switch (tlv_type) { - case IEEE80211_WPS_VERSION: + case IEEE80211_WPS_ATTR_VERSION: printf("v:%d.%d", *ie >> 4, *ie & 0xf); break; - case IEEE80211_WPS_SETUP_STATE: - /* Only 1 and 2 are valid */ - if (*ie == 0 || *ie >= 3) - printf(" state:B"); + case IEEE80211_WPS_ATTR_AP_SETUP_LOCKED: + printf(" ap_setup:%s", *ie ? "locked" : + "unlocked"); + break; + case IEEE80211_WPS_ATTR_CONFIG_METHODS: + case IEEE80211_WPS_ATTR_SELECTED_REGISTRAR_CONFIG_METHODS: + if (tlv_type == IEEE80211_WPS_ATTR_SELECTED_REGISTRAR_CONFIG_METHODS) + printf(" sel_reg_cfg_mthd:"); else - printf(" st:%s", *ie == 1 ? "N" : "C"); + printf(" cfg_mthd:" ); + cfg_mthd = BE_READ_2(ie); + f = 0; + for (n = 15; n >= 0; n--) { + if (f) { + printf(","); + f = 0; + } + switch (cfg_mthd & (1 << n)) { + case 0: + break; + case IEEE80211_WPS_CONFIG_USBA: + printf("usba"); + f++; + break; + case IEEE80211_WPS_CONFIG_ETHERNET: + printf("ethernet"); + f++; + break; + case IEEE80211_WPS_CONFIG_LABEL: + printf("label"); + f++; + break; + case IEEE80211_WPS_CONFIG_DISPLAY: + if (!(cfg_mthd & + (IEEE80211_WPS_CONFIG_VIRT_DISPLAY | + IEEE80211_WPS_CONFIG_PHY_DISPLAY))) + { + printf("display"); + f++; + } + break; + case IEEE80211_WPS_CONFIG_EXT_NFC_TOKEN: + printf("ext_nfc_tokenk"); + f++; + break; + case IEEE80211_WPS_CONFIG_INT_NFC_TOKEN: + printf("int_nfc_token"); + f++; + break; + case IEEE80211_WPS_CONFIG_NFC_INTERFACE: + printf("nfc_interface"); + f++; + break; + case IEEE80211_WPS_CONFIG_PUSHBUTTON: + if (!(cfg_mthd & + (IEEE80211_WPS_CONFIG_VIRT_PUSHBUTTON | + IEEE80211_WPS_CONFIG_PHY_PUSHBUTTON))) { + printf("push_button"); + f++; + } + break; + case IEEE80211_WPS_CONFIG_KEYPAD: + printf("keypad"); + f++; + break; + case IEEE80211_WPS_CONFIG_VIRT_PUSHBUTTON: + printf("virtual_push_button"); + f++; + break; + case IEEE80211_WPS_CONFIG_PHY_PUSHBUTTON: + printf("physical_push_button"); + f++; + break; + case IEEE80211_WPS_CONFIG_P2PS: + printf("p2ps"); + f++; + break; + case IEEE80211_WPS_CONFIG_VIRT_DISPLAY: + printf("virtual_display"); + f++; + break; + case IEEE80211_WPS_CONFIG_PHY_DISPLAY: + printf("physical_display"); + f++; + break; + default: + printf("unknown_wps_config<%04x>", + cfg_mthd & (1 << n)); + f++; + break; + } + } break; - case IEEE80211_WPS_SELECTED_REG: - printf(" sel:%s", *ie ? "T" : "F"); + case IEEE80211_WPS_ATTR_DEV_NAME: + printf(" device_name:<%.*s>", tlv_len, ie); break; - case IEEE80211_WPS_DEV_PASS_ID: + case IEEE80211_WPS_ATTR_DEV_PASSWORD_ID: n = LE_READ_2(ie); if (n < nitems(dev_pass_id)) printf(" dpi:%s", dev_pass_id[n]); break; - case IEEE80211_WPS_UUID_E: + case IEEE80211_WPS_ATTR_MANUFACTURER: + printf(" manufacturer:<%.*s>", tlv_len, ie); + break; + case IEEE80211_WPS_ATTR_MODEL_NAME: + printf(" model_name:<%.*s>", tlv_len, ie); + break; + case IEEE80211_WPS_ATTR_MODEL_NUMBER: + printf(" model_number:<%.*s>", tlv_len, ie); + break; + case IEEE80211_WPS_ATTR_PRIMARY_DEV_TYPE: + printf(" prim_dev:"); + for (n = 0; n < tlv_len; n++) + printf("%02x", ie[n]); + break; + case IEEE80211_WPS_ATTR_RF_BANDS: + printf(" rf:"); + f = 0; + for (n = 7; n >= 0; n--) { + if (f) { + printf(","); + f = 0; + } + switch (*ie & (1 << n)) { + case 0: + break; + case IEEE80211_WPS_RF_BAND_24GHZ: + printf("2.4Ghz"); + f++; + break; + case IEEE80211_WPS_RF_BAND_50GHZ: + printf("5Ghz"); + f++; + break; + case IEEE80211_WPS_RF_BAND_600GHZ: + printf("60Ghz"); + f++; + break; + default: + printf("unknown<%02x>", + *ie & (1 << n)); + f++; + break; + } + } + break; + case IEEE80211_WPS_ATTR_RESPONSE_TYPE: + printf(" resp_type:0x%02x", *ie); + break; + case IEEE80211_WPS_ATTR_SELECTED_REGISTRAR: + printf(" sel:%s", *ie ? "T" : "F"); + break; + case IEEE80211_WPS_ATTR_SERIAL_NUMBER: + printf(" serial_number:<%.*s>", tlv_len, ie); + break; + case IEEE80211_WPS_ATTR_UUID_E: printf(" uuid-e:"); for (n = 0; n < (tlv_len - 1); n++) printf("%02x-", ie[n]); printf("%02x", ie[n]); break; + case IEEE80211_WPS_ATTR_VENDOR_EXT: + printf(" vendor:"); + for (n = 0; n < tlv_len; n++) + printf("%02x", ie[n]); + break; + case IEEE80211_WPS_ATTR_WPS_STATE: + switch (*ie) { + case IEEE80211_WPS_STATE_NOT_CONFIGURED: + printf(" state:N"); + break; + case IEEE80211_WPS_STATE_CONFIGURED: + printf(" state:C"); + break; + default: + printf(" state:B<%02x>", *ie); + break; + } + break; + default: + printf(" unknown_wps_attr:0x%x", tlv_type); + break; } ie += tlv_len, len -= tlv_len; } @@ -3353,6 +3510,7 @@ iswpsoui(const uint8_t *frm) static const char * iename(int elemid) { + static char iename_buf[64]; switch (elemid) { case IEEE80211_ELEMID_FHPARMS: return " FHPARMS"; case IEEE80211_ELEMID_CFPARMS: return " CFPARMS"; @@ -3370,10 +3528,21 @@ iename(int elemid) case IEEE80211_ELEMID_MEASREP: return " MEASREP"; case IEEE80211_ELEMID_QUIET: return " QUIET"; case IEEE80211_ELEMID_IBSSDFS: return " IBSSDFS"; + case IEEE80211_ELEMID_RESERVED_47: + return " RESERVED_47"; + case IEEE80211_ELEMID_MOBILITY_DOMAIN: + return " MOBILITY_DOMAIN"; + case IEEE80211_ELEMID_RRM_ENACAPS: + return " RRM_ENCAPS"; + case IEEE80211_ELEMID_OVERLAP_BSS_SCAN_PARAM: + return " OVERLAP_BSS"; case IEEE80211_ELEMID_TPC: return " TPC"; case IEEE80211_ELEMID_CCKM: return " CCKM"; + case IEEE80211_ELEMID_EXTCAP: return " EXTCAP"; } - return " ???"; + snprintf(iename_buf, sizeof(iename_buf), " UNKNOWN_ELEMID_%d", + elemid); + return (const char *) iename_buf; } static void Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Sat Jan 19 20:45:41 2019 (r343203) +++ head/sys/net80211/ieee80211.h Sun Jan 20 00:45:44 2019 (r343204) @@ -951,9 +951,11 @@ enum { IEEE80211_ELEMID_ERP = 42, IEEE80211_ELEMID_HTCAP = 45, IEEE80211_ELEMID_QOS = 46, + IEEE80211_ELEMID_RESERVED_47 = 47, IEEE80211_ELEMID_RSN = 48, IEEE80211_ELEMID_XRATES = 50, IEEE80211_ELEMID_APCHANREP = 51, + IEEE80211_ELEMID_MOBILITY_DOMAIN = 54, IEEE80211_ELEMID_HTINFO = 61, IEEE80211_ELEMID_SECCHAN_OFFSET = 62, IEEE80211_ELEMID_RRM_ENACAPS = 70, Added: head/sys/net80211/ieee80211_wps.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net80211/ieee80211_wps.h Sun Jan 20 00:45:44 2019 (r343204) @@ -0,0 +1,149 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017 J.R. Oldroyd, Open Advisors Limited + * All rights reserved. + * + * 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 AUTHOR ``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 AUTHOR 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. + * + * $FreeBSD$ + */ +#ifndef _NET80211_IEEE80211_WPS_H_ +#define _NET80211_IEEE80211_WPS_H_ + +/* + * 802.11 WPS implementation definitions. + */ + +#define IEEE80211_WPS_ATTR_AP_CHANNEL 0x1001 +#define IEEE80211_WPS_ATTR_ASSOC_STATE 0x1002 +#define IEEE80211_WPS_ATTR_AUTH_TYPE 0x1003 +#define IEEE80211_WPS_ATTR_AUTH_TYPE_FLAGS 0x1004 +#define IEEE80211_WPS_ATTR_AUTHENTICATOR 0x1005 +#define IEEE80211_WPS_ATTR_CONFIG_METHODS 0x1008 +#define IEEE80211_WPS_ATTR_CONFIG_ERROR 0x1009 +#define IEEE80211_WPS_ATTR_CONFIRM_URL4 0x100a +#define IEEE80211_WPS_ATTR_CONFIRM_URL6 0x100b +#define IEEE80211_WPS_ATTR_CONN_TYPE 0x100c +#define IEEE80211_WPS_ATTR_CONN_TYPE_FLAGS 0x100d +#define IEEE80211_WPS_ATTR_CRED 0x100e +#define IEEE80211_WPS_ATTR_ENCR_TYPE 0x100f +#define IEEE80211_WPS_ATTR_ENCR_TYPE_FLAGS 0x1010 +#define IEEE80211_WPS_ATTR_DEV_NAME 0x1011 +#define IEEE80211_WPS_ATTR_DEV_PASSWORD_ID 0x1012 +#define IEEE80211_WPS_ATTR_E_HASH1 0x1014 +#define IEEE80211_WPS_ATTR_E_HASH2 0x1015 +#define IEEE80211_WPS_ATTR_E_SNONCE1 0x1016 +#define IEEE80211_WPS_ATTR_E_SNONCE2 0x1017 +#define IEEE80211_WPS_ATTR_ENCR_SETTINGS 0x1018 +#define IEEE80211_WPS_ATTR_ENROLLEE_NONCE 0x101a +#define IEEE80211_WPS_ATTR_FEATURE_ID 0x101b +#define IEEE80211_WPS_ATTR_IDENTITY 0x101c +#define IEEE80211_WPS_ATTR_IDENTITY_PROOF 0x101d +#define IEEE80211_WPS_ATTR_KEY_WRAP_AUTH 0x101e +#define IEEE80211_WPS_ATTR_KEY_ID 0x101f +#define IEEE80211_WPS_ATTR_MAC_ADDR 0x1020 +#define IEEE80211_WPS_ATTR_MANUFACTURER 0x1021 +#define IEEE80211_WPS_ATTR_MSG_TYPE 0x1022 +#define IEEE80211_WPS_ATTR_MODEL_NAME 0x1023 +#define IEEE80211_WPS_ATTR_MODEL_NUMBER 0x1024 +#define IEEE80211_WPS_ATTR_NETWORK_INDEX 0x1026 +#define IEEE80211_WPS_ATTR_NETWORK_KEY 0x1027 +#define IEEE80211_WPS_ATTR_NETWORK_KEY_INDEX 0x1028 +#define IEEE80211_WPS_ATTR_NEW_DEVICE_NAME 0x1029 +#define IEEE80211_WPS_ATTR_NEW_PASSWORD 0x102a +#define IEEE80211_WPS_ATTR_OOB_DEVICE_PASSWORD 0x102c +#define IEEE80211_WPS_ATTR_OS_VERSION 0x102d +#define IEEE80211_WPS_ATTR_POWER_LEVEL 0x102f +#define IEEE80211_WPS_ATTR_PSK_CURRENT 0x1030 +#define IEEE80211_WPS_ATTR_PSK_MAX 0x1031 +#define IEEE80211_WPS_ATTR_PUBLIC_KEY 0x1032 +#define IEEE80211_WPS_ATTR_RADIO_ENABLE 0x1033 +#define IEEE80211_WPS_ATTR_REBOOT 0x1034 +#define IEEE80211_WPS_ATTR_REGISTRAR_CURRENT 0x1035 +#define IEEE80211_WPS_ATTR_REGISTRAR_ESTBLSHD 0x1036 +#define IEEE80211_WPS_ATTR_REGISTRAR_LIST 0x1037 +#define IEEE80211_WPS_ATTR_REGISTRAR_MAX 0x1038 +#define IEEE80211_WPS_ATTR_REGISTRAR_NONCE 0x1039 +#define IEEE80211_WPS_ATTR_REQUEST_TYPE 0x103a +#define IEEE80211_WPS_ATTR_RESPONSE_TYPE 0x103b +#define IEEE80211_WPS_ATTR_RF_BANDS 0x103c +#define IEEE80211_WPS_ATTR_R_HASH1 0x103d +#define IEEE80211_WPS_ATTR_R_HASH2 0x103e +#define IEEE80211_WPS_ATTR_R_SNONCE1 0x103f +#define IEEE80211_WPS_ATTR_R_SNONCE2 0x1040 +#define IEEE80211_WPS_ATTR_SELECTED_REGISTRAR 0x1041 +#define IEEE80211_WPS_ATTR_SERIAL_NUMBER 0x1042 +#define IEEE80211_WPS_ATTR_WPS_STATE 0x1044 +#define IEEE80211_WPS_ATTR_SSID 0x1045 +#define IEEE80211_WPS_ATTR_TOTAL_NETWORKS 0x1046 +#define IEEE80211_WPS_ATTR_UUID_E 0x1047 +#define IEEE80211_WPS_ATTR_UUID_R 0x1048 +#define IEEE80211_WPS_ATTR_VENDOR_EXT 0x1049 +#define IEEE80211_WPS_ATTR_VERSION 0x104a +#define IEEE80211_WPS_ATTR_X509_CERT_REQ 0x104b +#define IEEE80211_WPS_ATTR_X509_CERT 0x104c +#define IEEE80211_WPS_ATTR_EAP_IDENTITY 0x104d +#define IEEE80211_WPS_ATTR_MSG_COUNTER 0x104e +#define IEEE80211_WPS_ATTR_PUBKEY_HASH 0x104f +#define IEEE80211_WPS_ATTR_REKEY_KEY 0x1050 +#define IEEE80211_WPS_ATTR_KEY_LIFETIME 0x1051 +#define IEEE80211_WPS_ATTR_PERMITTED_CONFIG_METHODS 0x1052 +#define IEEE80211_WPS_ATTR_SELECTED_REGISTRAR_CONFIG_METHODS 0x1053 +#define IEEE80211_WPS_ATTR_PRIMARY_DEV_TYPE 0x1054 +#define IEEE80211_WPS_ATTR_SECONDARY_DEV_TYPE_LIST 0x1055 +#define IEEE80211_WPS_ATTR_PORTABLE_DEV 0x1056 +#define IEEE80211_WPS_ATTR_AP_SETUP_LOCKED 0x1057 +#define IEEE80211_WPS_ATTR_APPLICATION_EXT 0x1058 +#define IEEE80211_WPS_ATTR_EAP_TYPE 0x1059 +#define IEEE80211_WPS_ATTR_IV 0x1060 +#define IEEE80211_WPS_ATTR_KEY_PROVIDED_AUTO 0x1061 +#define IEEE80211_WPS_ATTR_802_1X_ENABLED 0x1062 +#define IEEE80211_WPS_ATTR_AP_SESSION_KEY 0x1063 +#define IEEE80211_WPS_ATTR_WEP_TRANSMIT_KEY 0x1064 +#define IEEE80211_WPS_ATTR_REQUESTED_DEV_TYPE 0x106a +#define IEEE80211_WPS_ATTR_EXTENSIBILITY_TEST 0x10fa /* _NOT_ defined in the spec */ + +/* RF bands bitmask */ +#define IEEE80211_WPS_RF_BAND_24GHZ 0x01 +#define IEEE80211_WPS_RF_BAND_50GHZ 0x02 +#define IEEE80211_WPS_RF_BAND_600GHZ 0x04 + +/* Config methods bitmask */ +#define IEEE80211_WPS_CONFIG_USBA 0x0001 +#define IEEE80211_WPS_CONFIG_ETHERNET 0x0002 +#define IEEE80211_WPS_CONFIG_LABEL 0x0004 +#define IEEE80211_WPS_CONFIG_DISPLAY 0x0008 +#define IEEE80211_WPS_CONFIG_EXT_NFC_TOKEN 0x0010 +#define IEEE80211_WPS_CONFIG_INT_NFC_TOKEN 0x0020 +#define IEEE80211_WPS_CONFIG_NFC_INTERFACE 0x0040 +#define IEEE80211_WPS_CONFIG_PUSHBUTTON 0x0080 +#define IEEE80211_WPS_CONFIG_KEYPAD 0x0100 +#define IEEE80211_WPS_CONFIG_VIRT_PUSHBUTTON 0x0200 +#define IEEE80211_WPS_CONFIG_PHY_PUSHBUTTON 0x0400 +#define IEEE80211_WPS_CONFIG_P2PS 0x1000 +#define IEEE80211_WPS_CONFIG_VIRT_DISPLAY 0x2000 +#define IEEE80211_WPS_CONFIG_PHY_DISPLAY 0x4000 + +/* Wi-Fi Protected Setup state */ +#define IEEE80211_WPS_STATE_NOT_CONFIGURED 0x01 +#define IEEE80211_WPS_STATE_CONFIGURED 0x02 +#endif /* _NET80211_IEEE80211_WPS_H_ */ From owner-svn-src-head@freebsd.org Sun Jan 20 05:52:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC87814A695B; Sun, 20 Jan 2019 05:52:17 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54B2987E1C; Sun, 20 Jan 2019 05:52:17 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49C6525E78; Sun, 20 Jan 2019 05:52:17 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0K5qHdg062288; Sun, 20 Jan 2019 05:52:17 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0K5qHC3062287; Sun, 20 Jan 2019 05:52:17 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901200552.x0K5qHC3062287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 20 Jan 2019 05:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343209 - head/sys/fs/smbfs X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/fs/smbfs X-SVN-Commit-Revision: 343209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54B2987E1C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.914,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 05:52:17 -0000 Author: gonzo Date: Sun Jan 20 05:52:16 2019 New Revision: 343209 URL: https://svnweb.freebsd.org/changeset/base/343209 Log: [smbfs] Allow semicolon in mounts that support long names Semicolon is a legal character in long names but not in 8.3 format. Move it to respective character set. PR: 140068 Submitted by: tom@uffner.com MFC after: 3 weeks Modified: head/sys/fs/smbfs/smbfs_vnops.c Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Sun Jan 20 03:58:21 2019 (r343208) +++ head/sys/fs/smbfs/smbfs_vnops.c Sun Jan 20 05:52:16 2019 (r343209) @@ -1120,8 +1120,8 @@ smbfs_advlock(ap) static int smbfs_pathcheck(struct smbmount *smp, const char *name, int nmlen, int nameiop) { - static const char *badchars = "*/:<>;?"; - static const char *badchars83 = " +|,[]="; + static const char *badchars = "*/:<>?"; + static const char *badchars83 = " +|,[]=;"; const char *cp; int i, error; From owner-svn-src-head@freebsd.org Sun Jan 20 13:39:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 920E51490230; Sun, 20 Jan 2019 13:39:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 348CB96A02; Sun, 20 Jan 2019 13:39:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23B402E0C; Sun, 20 Jan 2019 13:39:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KDdJPf003164; Sun, 20 Jan 2019 13:39:19 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KDdICk003155; Sun, 20 Jan 2019 13:39:18 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901201339.x0KDdICk003155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 20 Jan 2019 13:39:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343213 - in head/sys: net80211 sys X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys: net80211 sys X-SVN-Commit-Revision: 343213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 348CB96A02 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.928,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 13:39:20 -0000 Author: avos Date: Sun Jan 20 13:39:18 2019 New Revision: 343213 URL: https://svnweb.freebsd.org/changeset/base/343213 Log: net80211: resolve ioctl <-> detach race for ieee80211com structure Since r287197 ieee80211com is a part of drivers softc; as a result, after detach all pointers to it (iv_ic, ni_ic) are invalid. Most possible users (tasks, interrupt handlers) are blocked / removed when device is stopped; however, ioctl handlers were not tracked and may crash if ieee80211com structure is accessed. Since ieee80211com pointer access from ieee80211vap structure is not protected by lock (constant after interface creation) and used in many other places just use reference counting for ioctl handlers; on detach set 'detached' flag and wait until reference counter goes to 0. For HEAD ieee80211vap size was changed (__FreeBSD_version bumped); however, in stable branches I'm going to split / reuse the last iv_spare field for KBI stability. Tested with: - rsu(4), SIOCSIFCAP (-rxcsum) ioctl; - rtwn_pci(4), SIOCG80211 / IEEE80211_IOC_HTPROTMODE ioctl. MFC after: 1 week Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_freebsd.h head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_var.h head/sys/sys/param.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sun Jan 20 13:16:36 2019 (r343212) +++ head/sys/net80211/ieee80211.c Sun Jan 20 13:39:18 2019 (r343213) @@ -405,8 +405,10 @@ ieee80211_ifdetach(struct ieee80211com *ic) * The VAP is responsible for setting and clearing * the VIMAGE context. */ - while ((vap = TAILQ_FIRST(&ic->ic_vaps)) != NULL) + while ((vap = TAILQ_FIRST(&ic->ic_vaps)) != NULL) { + ieee80211_com_vdetach(vap); ieee80211_vap_destroy(vap); + } ieee80211_waitfor_parent(ic); ieee80211_sysctl_detach(ic); Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Sun Jan 20 13:16:36 2019 (r343212) +++ head/sys/net80211/ieee80211_freebsd.c Sun Jan 20 13:39:18 2019 (r343213) @@ -307,6 +307,55 @@ ieee80211_sysctl_vdetach(struct ieee80211vap *vap) } } +#define MS(_v, _f) (((_v) & _f##_M) >> _f##_S) +int +ieee80211_com_vincref(struct ieee80211vap *vap) +{ + uint32_t ostate; + + ostate = atomic_fetchadd_32(&vap->iv_com_state, IEEE80211_COM_REF_ADD); + + if (ostate & IEEE80211_COM_DETACHED) { + atomic_subtract_32(&vap->iv_com_state, IEEE80211_COM_REF_ADD); + return (ENETDOWN); + } + + if (MS(ostate, IEEE80211_COM_REF) == IEEE80211_COM_REF_MAX) { + atomic_subtract_32(&vap->iv_com_state, IEEE80211_COM_REF_ADD); + return (EOVERFLOW); + } + + return (0); +} + +void +ieee80211_com_vdecref(struct ieee80211vap *vap) +{ + uint32_t ostate; + + ostate = atomic_fetchadd_32(&vap->iv_com_state, -IEEE80211_COM_REF_ADD); + + KASSERT(MS(ostate, IEEE80211_COM_REF) != 0, + ("com reference counter underflow")); + + (void) ostate; +} + +void +ieee80211_com_vdetach(struct ieee80211vap *vap) +{ + int sleep_time; + + sleep_time = msecs_to_ticks(250); + if (sleep_time == 0) + sleep_time = 1; + + atomic_set_32(&vap->iv_com_state, IEEE80211_COM_DETACHED); + while (MS(atomic_load_32(&vap->iv_com_state), IEEE80211_COM_REF) != 0) + pause("comref", sleep_time); +} +#undef MS + int ieee80211_node_dectestref(struct ieee80211_node *ni) { Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Sun Jan 20 13:16:36 2019 (r343212) +++ head/sys/net80211/ieee80211_freebsd.h Sun Jan 20 13:39:18 2019 (r343213) @@ -224,6 +224,11 @@ typedef struct mtx ieee80211_rt_lock_t; */ #include +struct ieee80211vap; +int ieee80211_com_vincref(struct ieee80211vap *); +void ieee80211_com_vdecref(struct ieee80211vap *); +void ieee80211_com_vdetach(struct ieee80211vap *); + #define ieee80211_node_initref(_ni) \ do { ((_ni)->ni_refcnt = 1); } while (0) #define ieee80211_node_incref(_ni) \ @@ -235,7 +240,6 @@ int ieee80211_node_dectestref(struct ieee80211_node *n #define ieee80211_node_refcnt(_ni) (_ni)->ni_refcnt struct ifqueue; -struct ieee80211vap; void ieee80211_drain_ifq(struct ifqueue *); void ieee80211_flush_ifq(struct ifqueue *, struct ieee80211vap *); Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Sun Jan 20 13:16:36 2019 (r343212) +++ head/sys/net80211/ieee80211_ioctl.c Sun Jan 20 13:39:18 2019 (r343213) @@ -3480,10 +3480,14 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t { struct ieee80211vap *vap = ifp->if_softc; struct ieee80211com *ic = vap->iv_ic; - int error = 0, wait = 0; + int error = 0, wait = 0, ic_used; struct ifreq *ifr; struct ifaddr *ifa; /* XXX */ + ic_used = (cmd != SIOCSIFMTU && cmd != SIOCG80211STATS); + if (ic_used && (error = ieee80211_com_vincref(vap)) != 0) + return (error); + switch (cmd) { case SIOCSIFFLAGS: IEEE80211_LOCK(ic); @@ -3620,5 +3624,9 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t error = ether_ioctl(ifp, cmd, data); break; } + + if (ic_used) + ieee80211_com_vdecref(vap); + return (error); } Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sun Jan 20 13:16:36 2019 (r343212) +++ head/sys/net80211/ieee80211_var.h Sun Jan 20 13:39:18 2019 (r343213) @@ -400,6 +400,7 @@ struct ieee80211vap { uint32_t iv_caps; /* capabilities */ uint32_t iv_htcaps; /* HT capabilities */ uint32_t iv_htextcaps; /* HT extended capabilities */ + uint32_t iv_com_state; /* com usage / detached flag */ enum ieee80211_opmode iv_opmode; /* operation mode */ enum ieee80211_state iv_state; /* state machine state */ enum ieee80211_state iv_nstate; /* pending state */ @@ -684,6 +685,12 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_FVHT_USEVHT160 0x000000010 /* CONF: Use VHT160 */ #define IEEE80211_VFHT_BITS \ "\20\1VHT\2VHT40\3VHT80\4VHT80P80\5VHT160" + +#define IEEE80211_COM_DETACHED 0x00000001 /* ieee80211_ifdetach called */ +#define IEEE80211_COM_REF_ADD 0x00000002 /* add / remove reference */ +#define IEEE80211_COM_REF_M 0xfffffffe /* reference counter bits */ +#define IEEE80211_COM_REF_S 1 +#define IEEE80211_COM_REF_MAX (IEEE80211_COM_REF_M >> IEEE80211_COM_REF_S) int ic_printf(struct ieee80211com *, const char *, ...) __printflike(2, 3); void ieee80211_ifattach(struct ieee80211com *); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Jan 20 13:16:36 2019 (r343212) +++ head/sys/sys/param.h Sun Jan 20 13:39:18 2019 (r343213) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300008 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300009 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Sun Jan 20 14:02:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FF0A1490E4C; Sun, 20 Jan 2019 14:02:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC75097809; Sun, 20 Jan 2019 14:02:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id A3847165FB; Sun, 20 Jan 2019 14:02:14 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 52D878D4A142; Sun, 20 Jan 2019 14:02:12 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 61A05D211B6; Sun, 20 Jan 2019 14:02:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 4fJ27fBLmUuv; Sun, 20 Jan 2019 14:02:09 +0000 (UTC) Received: from [192.168.2.110] (unknown [IPv6:fde9:577b:c1a9:31:2ef0:eeff:fe03:ee34]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 6D10CD1F85E; Sun, 20 Jan 2019 14:02:09 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Andriy Voskoboinyk" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343213 - in head/sys: net80211 sys Date: Sun, 20 Jan 2019 14:02:08 +0000 X-Mailer: MailMate (2.0BETAr6134) Message-ID: <64B0B511-D3A0-4034-B602-2C3956669D58@FreeBSD.org> In-Reply-To: <201901201339.x0KDdICk003155@repo.freebsd.org> References: <201901201339.x0KDdICk003155@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC75097809 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.930,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 14:02:15 -0000 On 20 Jan 2019, at 13:39, Andriy Voskoboinyk wrote: > Author: avos > Date: Sun Jan 20 13:39:18 2019 > New Revision: 343213 > URL: https://svnweb.freebsd.org/changeset/base/343213 > > Log: > net80211: resolve ioctl <-> detach race for ieee80211com structure > > Since r287197 ieee80211com is a part of drivers softc; as a result, > after detach all pointers to it (iv_ic, ni_ic) are invalid. Most > possible users (tasks, interrupt handlers) are blocked / removed > when device is stopped; however, ioctl handlers were not tracked > and may crash if ieee80211com structure is accessed. > > Since ieee80211com pointer access from ieee80211vap structure is not > protected by lock (constant after interface creation) and used in > many other places just use reference counting for ioctl handlers; > on detach set 'detached' flag and wait until reference counter goes > to 0. So how do any cloned interfaces do this (wifi or non-wifi)? Is this a more general problem or are some wifi drivers just not exactly careful with the order they take things down? On another note, why would refcount(9) not be sufficient? I didn’t really like the MC() macros and the hand crafted state machine for a refcount when scrolling through. /bz From owner-svn-src-head@freebsd.org Sun Jan 20 14:25:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B13C7149187A; Sun, 20 Jan 2019 14:25:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51F9C6852F; Sun, 20 Jan 2019 14:25:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE25A3836; Sun, 20 Jan 2019 14:25:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KEPPSa029394; Sun, 20 Jan 2019 14:25:25 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KEPPEU029393; Sun, 20 Jan 2019 14:25:25 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201901201425.x0KEPPEU029393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 20 Jan 2019 14:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343215 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 343215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 51F9C6852F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.925,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 14:25:26 -0000 Author: jilles Date: Sun Jan 20 14:25:25 2019 New Revision: 343215 URL: https://svnweb.freebsd.org/changeset/base/343215 Log: sh: Send libedit "ferr" output to fd 2 The libedit "fout" output must be sent to fd 2 since it contains prompts that POSIX says must be sent to fd 2. However, the libedit "ferr" output receives error messages such as from "bind" that make no sense to send to fd 1. Modified: head/bin/sh/histedit.c Modified: head/bin/sh/histedit.c ============================================================================== --- head/bin/sh/histedit.c Sun Jan 20 14:02:54 2019 (r343214) +++ head/bin/sh/histedit.c Sun Jan 20 14:25:25 2019 (r343215) @@ -67,7 +67,7 @@ __FBSDID("$FreeBSD$"); History *hist; /* history cookie */ EditLine *el; /* editline cookie */ int displayhist; -static FILE *el_in, *el_out, *el_err; +static FILE *el_in, *el_out; static char *fc_replace(const char *, char *, char *); static int not_fcnumber(const char *); @@ -106,18 +106,16 @@ histedit(void) INTOFF; if (el_in == NULL) el_in = fdopen(0, "r"); - if (el_err == NULL) - el_err = fdopen(1, "w"); if (el_out == NULL) el_out = fdopen(2, "w"); - if (el_in == NULL || el_err == NULL || el_out == NULL) + if (el_in == NULL || el_out == NULL) goto bad; term = lookupvar("TERM"); if (term) setenv("TERM", term, 1); else unsetenv("TERM"); - el = el_init(arg0, el_in, el_out, el_err); + el = el_init(arg0, el_in, el_out, el_out); if (el != NULL) { if (hist) el_set(el, EL_HIST, history, hist); From owner-svn-src-head@freebsd.org Sun Jan 20 15:18:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D95171495181; Sun, 20 Jan 2019 15:17:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 817956C2AE; Sun, 20 Jan 2019 15:17:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 745AF41C7; Sun, 20 Jan 2019 15:17:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KFHxoo056383; Sun, 20 Jan 2019 15:17:59 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KFHvYE056373; Sun, 20 Jan 2019 15:17:57 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901201517.x0KFHvYE056373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 20 Jan 2019 15:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343219 - in head: sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/mips/conf sys/sparc64/conf tools/tools/nanobsd/pcengines X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head: sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/mips/conf sys/sparc64/conf tools/tools/nanobsd/pcengines X-SVN-Commit-Revision: 343219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 817956C2AE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 15:18:00 -0000 Author: avos Date: Sun Jan 20 15:17:56 2019 New Revision: 343219 URL: https://svnweb.freebsd.org/changeset/base/343219 Log: Remove IEEE80211_AMPDU_AGE config option. It is noop since r297774. Modified: head/sys/amd64/conf/GENERIC head/sys/arm/conf/RK3188 head/sys/conf/NOTES head/sys/conf/config.mk head/sys/conf/options head/sys/i386/conf/GENERIC head/sys/mips/conf/ERL head/sys/mips/conf/OCTEON1 head/sys/sparc64/conf/GENERIC head/tools/tools/nanobsd/pcengines/ALIX_DSK Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/amd64/conf/GENERIC Sun Jan 20 15:17:56 2019 (r343219) @@ -284,7 +284,6 @@ device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # Wireless NIC cards device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs -options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s draft support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/arm/conf/RK3188 Sun Jan 20 15:17:56 2019 (r343219) @@ -79,7 +79,6 @@ device bpf # Wireless NIC cards options IEEE80211_DEBUG -options IEEE80211_AMPDU_AGE options IEEE80211_SUPPORT_MESH options IEEE80211_SUPPORT_TDMA device wlan # 802.11 support Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/conf/NOTES Sun Jan 20 15:17:56 2019 (r343219) @@ -843,7 +843,6 @@ device vxlan # and ath drivers and will eventually be required by all 802.11 drivers. device wlan options IEEE80211_DEBUG #enable debugging msgs -options IEEE80211_AMPDU_AGE #age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH #enable 802.11s D3.0 support options IEEE80211_SUPPORT_TDMA #enable TDMA support Modified: head/sys/conf/config.mk ============================================================================== --- head/sys/conf/config.mk Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/conf/config.mk Sun Jan 20 15:17:56 2019 (r343219) @@ -31,13 +31,12 @@ opt_scsi.h: echo "#define SCSI_DELAY 15000" > ${.TARGET} opt_wlan.h: echo "#define IEEE80211_DEBUG 1" > ${.TARGET} - echo "#define IEEE80211_AMPDU_AGE 1" >> ${.TARGET} echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET} KERN_OPTS.i386=NEW_PCIB DEV_PCI KERN_OPTS.amd64=NEW_PCIB DEV_PCI KERN_OPTS.powerpc=NEW_PCIB DEV_PCI KERN_OPTS=MROUTING IEEE80211_DEBUG \ - IEEE80211_AMPDU_AGE IEEE80211_SUPPORT_MESH DEV_BPF \ + IEEE80211_SUPPORT_MESH DEV_BPF \ ${KERN_OPTS.${MACHINE}} ${KERN_OPTS_EXTRA} .if ${MK_INET_SUPPORT} != "no" KERN_OPTS+= INET TCP_OFFLOAD Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/conf/options Sun Jan 20 15:17:56 2019 (r343219) @@ -908,7 +908,6 @@ HWPMC_MIPS_BACKTRACE opt_hwpmc_hooks.h # 802.11 support layer IEEE80211_DEBUG opt_wlan.h IEEE80211_DEBUG_REFCNT opt_wlan.h -IEEE80211_AMPDU_AGE opt_wlan.h IEEE80211_SUPPORT_MESH opt_wlan.h IEEE80211_SUPPORT_SUPERG opt_wlan.h IEEE80211_SUPPORT_TDMA opt_wlan.h Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/i386/conf/GENERIC Sun Jan 20 15:17:56 2019 (r343219) @@ -280,7 +280,6 @@ device xe # Xircom pccard Ethernet # Wireless NIC cards device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs -options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s draft support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support Modified: head/sys/mips/conf/ERL ============================================================================== --- head/sys/mips/conf/ERL Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/mips/conf/ERL Sun Jan 20 15:17:56 2019 (r343219) @@ -136,7 +136,6 @@ device octm # Wireless NIC cards device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs -options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s draft support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/mips/conf/OCTEON1 Sun Jan 20 15:17:56 2019 (r343219) @@ -169,7 +169,6 @@ device bge # Broadcom BCM570xx Gigabit Ethernet device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs -options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s draft support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Sun Jan 20 15:00:15 2019 (r343218) +++ head/sys/sparc64/conf/GENERIC Sun Jan 20 15:17:56 2019 (r343219) @@ -217,7 +217,6 @@ device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # Wireless NIC cards device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs -options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s D3.0 support device wlan_wep # 802.11 WEP support device wlan_ccmp # 802.11 CCMP support Modified: head/tools/tools/nanobsd/pcengines/ALIX_DSK ============================================================================== --- head/tools/tools/nanobsd/pcengines/ALIX_DSK Sun Jan 20 15:00:15 2019 (r343218) +++ head/tools/tools/nanobsd/pcengines/ALIX_DSK Sun Jan 20 15:17:56 2019 (r343219) @@ -54,7 +54,6 @@ device miibus device vr device wlan options IEEE80211_DEBUG -options IEEE80211_AMPDU_AGE options IEEE80211_SUPPORT_MESH device wlan_wep device wlan_ccmp From owner-svn-src-head@freebsd.org Sun Jan 20 19:55:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8332214A3424; Sun, 20 Jan 2019 19:55:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2523476E9E; Sun, 20 Jan 2019 19:55:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1840D70C6; Sun, 20 Jan 2019 19:55:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KJts7U001298; Sun, 20 Jan 2019 19:55:54 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KJtsO8001297; Sun, 20 Jan 2019 19:55:54 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901201955.x0KJtsO8001297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 20 Jan 2019 19:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343223 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 343223 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2523476E9E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 19:55:55 -0000 Author: gonzo Date: Sun Jan 20 19:55:54 2019 New Revision: 343223 URL: https://svnweb.freebsd.org/changeset/base/343223 Log: Fix inconsistency in return values introduced by r343222 Consistently return 1 or the case of missing arguments in both functions PR: 219689 MFC after: 1 week X-MFC-With: 343222 Modified: head/usr.bin/systat/devs.c Modified: head/usr.bin/systat/devs.c ============================================================================== --- head/usr.bin/systat/devs.c Sun Jan 20 19:47:33 2019 (r343222) +++ head/usr.bin/systat/devs.c Sun Jan 20 19:55:54 2019 (r343223) @@ -195,7 +195,7 @@ dsmatchselect(const char *args, devstat_select_mode se if (!args) { warnx("dsmatchselect: no arguments"); - return(0); + return(1); } /* From owner-svn-src-head@freebsd.org Sun Jan 20 14:31:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D4591491BCA; Sun, 20 Jan 2019 14:31:17 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82F5369DA2; Sun, 20 Jan 2019 14:31:16 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lj1-f170.google.com with SMTP id t18-v6so15377540ljd.4; Sun, 20 Jan 2019 06:31:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=V7NcKOyLf/SMcZ/6q4WBZC1D9+B+t4TnJ/fF4/heQmQ=; b=HujSzQ7zZXHivKXlXutuHOcUUZQnHYvEtu22SkQnLq5fnseLOSxh6RWIwNySAotmnO 9VUGMI8rdJ0b+kzFBmhqwpiz3+SurFFfZe9dQ/+iZYnfwCUeS4hjtBunAJgdRRGqNdhR ST4vCNdf0bKc+gYs53ilEr4mzOYi5wx/eLxpHwtx2G/sYzyckEz6pW9SA4aRXZV1o0u3 OTgotC0/2fKjWwm2kMjUAQ/mfnQ5byb96KRwXZnpb1B3lm2EcullLj5eVLZylpPwXkgO NQyaYi/AYTvpl+aLKawft9www5FwlZZUfS51+UBxUXwzIaOH6U8kqIklj+drYF96RmNT 2PPw== X-Gm-Message-State: AJcUukcfbdxXAH25x4/BcSjIZ5qr06rit5SBLaPuZNv7va7TTGn+V2l0 NnrT9g2fKCM+ydODBaEyNADBzdfP X-Google-Smtp-Source: ALg8bN6tw94tz9qCUmc1nmVC8lGdK2Dj1Zya4aMAnz2tNWu6SMnh7cjASZoTcQR+Oe21XfRb/+cflA== X-Received: by 2002:a2e:99d7:: with SMTP id l23-v6mr15359674ljj.165.1547994234377; Sun, 20 Jan 2019 06:23:54 -0800 (PST) Received: from localhost (46-133-20-39.dialup.umc.net.ua. [46.133.20.39]) by smtp.gmail.com with ESMTPSA id j25-v6sm1766388lji.77.2019.01.20.06.23.51 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 20 Jan 2019 06:23:53 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343213 - in head/sys: net80211 sys References: <201901201339.x0KDdICk003155@repo.freebsd.org> <64B0B511-D3A0-4034-B602-2C3956669D58@FreeBSD.org> Date: Sun, 20 Jan 2019 15:55:08 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <64B0B511-D3A0-4034-B602-2C3956669D58@FreeBSD.org> User-Agent: Opera Mail/12.15 (FreeBSD) X-Rspamd-Queue-Id: 82F5369DA2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of andriyvos@gmail.com designates 209.85.208.170 as permitted sender) smtp.mailfrom=andriyvos@gmail.com X-Spamd-Result: default: False [-2.99 / 15.00]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.13)[ipnet: 209.85.128.0/17(-3.75), asn: 15169(-1.84), country: US(-0.08)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.34)[-0.344,0]; RCVD_IN_DNSWL_NONE(0.00)[170.208.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[avos@freebsd.org,andriyvos@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_NOT_FQDN(0.50)[]; FROM_NEQ_ENVFROM(0.00)[avos@freebsd.org,andriyvos@gmail.com] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 14:31:17 -0000 Sun, 20 Jan 2019 16:02:08 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Bjoern A. Zeeb = : > On 20 Jan 2019, at 13:39, Andriy Voskoboinyk wrote: > >> Author: avos >> Date: Sun Jan 20 13:39:18 2019 >> New Revision: 343213 >> URL: https://svnweb.freebsd.org/changeset/base/343213 >> >> Log: >> net80211: resolve ioctl <-> detach race for ieee80211com structure >> >> Since r287197 ieee80211com is a part of drivers softc; as a result,= >> after detach all pointers to it (iv_ic, ni_ic) are invalid. Most >> possible users (tasks, interrupt handlers) are blocked / removed >> when device is stopped; however, ioctl handlers were not tracked >> and may crash if ieee80211com structure is accessed. >> >> Since ieee80211com pointer access from ieee80211vap structure is no= t >> protected by lock (constant after interface creation) and used in >> many other places just use reference counting for ioctl handlers; >> on detach set 'detached' flag and wait until reference counter goes= = >> to 0. > > So how do any cloned interfaces do this (wifi or non-wifi)? Is this a= = > more general problem or are some wifi drivers just not exactly careful= = > with the order they take things down? > That's for wifi only; ifp (and vap as subpart) is alive until reference counter for ifp is not 0; however, 'com' gets invalid as soon as device detach procedure is finished - and net80211 uses it in various places inside ieee80211_ioctl(). > On another note, why would refcount(9) not be sufficient? I didn=E2=80= =99t = > really like the MC() macros and the hand crafted state machine for a = > refcount when scrolling through. > Just to keep 'detached' flag and reference counter inside one variable (they both need to be atomically accessible). > /bz From owner-svn-src-head@freebsd.org Sun Jan 20 19:47:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD45B14A2EFE; Sun, 20 Jan 2019 19:47:34 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D72A7698B; Sun, 20 Jan 2019 19:47:34 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 513896F1E; Sun, 20 Jan 2019 19:47:34 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KJlY4E096276; Sun, 20 Jan 2019 19:47:34 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KJlYDa096275; Sun, 20 Jan 2019 19:47:34 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901201947.x0KJlYDa096275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 20 Jan 2019 19:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343222 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 343222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D72A7698B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 19:47:34 -0000 Author: gonzo Date: Sun Jan 20 19:47:33 2019 New Revision: 343222 URL: https://svnweb.freebsd.org/changeset/base/343222 Log: Fix crash in systat(4) when certain commands are called without arguments Add check for missing arguments to dsmatchselect and dsselect PR: 219689 Submitted by: Marko Turk MFC after: 1 week Modified: head/usr.bin/systat/devs.c Modified: head/usr.bin/systat/devs.c ============================================================================== --- head/usr.bin/systat/devs.c Sun Jan 20 18:53:32 2019 (r343221) +++ head/usr.bin/systat/devs.c Sun Jan 20 19:47:33 2019 (r343222) @@ -193,6 +193,11 @@ dsmatchselect(const char *args, devstat_select_mode se int i; int retval = 0; + if (!args) { + warnx("dsmatchselect: no arguments"); + return(0); + } + /* * Break the (pipe delimited) input string out into separate * strings. @@ -250,6 +255,11 @@ dsselect(const char *args, devstat_select_mode select_ char *cp, *tmpstr, *tmpstr1, *buffer; int i; int retval = 0; + + if (!args) { + warnx("dsselect: no argument"); + return(1); + } /* * If we've gone through this code before, free previously From owner-svn-src-head@freebsd.org Sun Jan 20 20:29:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39B1D14A4C8A; Sun, 20 Jan 2019 20:29:28 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D122C805B6; Sun, 20 Jan 2019 20:29:27 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0E1175FF; Sun, 20 Jan 2019 20:29:27 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KKTRTD017009; Sun, 20 Jan 2019 20:29:27 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KKTRBN017008; Sun, 20 Jan 2019 20:29:27 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901202029.x0KKTRBN017008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 20 Jan 2019 20:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343224 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 343224 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D122C805B6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 20:29:28 -0000 Author: gonzo Date: Sun Jan 20 20:29:26 2019 New Revision: 343224 URL: https://svnweb.freebsd.org/changeset/base/343224 Log: Add KBD_BOOTPROTO quirk for Logitech G510s USB keyboard PR: 232136 Submitted by: dgilbert@eicat.ca MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Sun Jan 20 19:55:54 2019 (r343223) +++ head/sys/dev/usb/quirk/usb_quirk.c Sun Jan 20 20:29:26 2019 (r343224) @@ -96,6 +96,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(TELEX, MIC1, 0x009, 0x009, UQ_AU_NO_FRAC), USB_QUIRK(SILICONPORTALS, YAPPHONE, 0x100, 0x100, UQ_AU_INP_ASYNC), USB_QUIRK(LOGITECH, UN53B, 0x0000, 0xffff, UQ_NO_STRINGS), + USB_QUIRK(LOGITECH, G510S, 0x0000, 0xFFFF, UQ_KBD_BOOTPROTO), USB_QUIRK(REALTEK, RTL8196EU, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(ELSA, MODEM1, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(PLANEX2, MZKUE150N, 0x0000, 0xffff, UQ_CFG_INDEX_1), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Jan 20 19:55:54 2019 (r343223) +++ head/sys/dev/usb/usbdevs Sun Jan 20 20:29:26 2019 (r343224) @@ -2842,6 +2842,7 @@ product LOGITECH UN58A 0xc030 iFeel Mouse product LOGITECH UN53B 0xc032 iFeel MouseMan product LOGITECH WMPAD 0xc208 WingMan GamePad Extreme product LOGITECH WMRPAD 0xc20a WingMan RumblePad +product LOGITECH G510S 0xc22d G510s Keyboard product LOGITECH WMJOY 0xc281 WingMan Force joystick product LOGITECH BB13 0xc401 USB-PS/2 Trackball product LOGITECH RK53 0xc501 Cordless mouse From owner-svn-src-head@freebsd.org Sun Jan 20 22:34:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFA2214AA240; Sun, 20 Jan 2019 22:34:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8189986711; Sun, 20 Jan 2019 22:34:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72DC18C03; Sun, 20 Jan 2019 22:34:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KMY4P7085203; Sun, 20 Jan 2019 22:34:04 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KMY4T5085202; Sun, 20 Jan 2019 22:34:04 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901202234.x0KMY4T5085202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 20 Jan 2019 22:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343232 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 343232 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8189986711 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 22:34:05 -0000 Author: gonzo Date: Sun Jan 20 22:34:04 2019 New Revision: 343232 URL: https://svnweb.freebsd.org/changeset/base/343232 Log: Add more profile-enabled libraries to remove when WITHOUT_PROFILE is defined PR: 230898 Submitted by: Herbert J. Skuhra MFC after: 1 week Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Jan 20 22:08:49 2019 (r343231) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Jan 20 22:34:04 2019 (r343232) @@ -7464,6 +7464,8 @@ OLD_FILES+=usr/share/man/man8/pppctl.8.gz .endif .if ${MK_PROFILE} == no +OLD_FILES+=usr/lib/lib80211_p.a +OLD_FILES+=usr/lib/libBlocksRuntime_p.a OLD_FILES+=usr/lib/libalias_cuseeme_p.a OLD_FILES+=usr/lib/libalias_dummy_p.a OLD_FILES+=usr/lib/libalias_ftp_p.a @@ -7475,40 +7477,64 @@ OLD_FILES+=usr/lib/libalias_skinny_p.a OLD_FILES+=usr/lib/libalias_smedia_p.a OLD_FILES+=usr/lib/libarchive_p.a OLD_FILES+=usr/lib/libasn1_p.a +OLD_FILES+=usr/lib/libauditd_p.a +OLD_FILES+=usr/lib/libavl_p.a +OLD_FILES+=usr/lib/libbe_p.a OLD_FILES+=usr/lib/libbegemot_p.a +OLD_FILES+=usr/lib/libblacklist_p.a OLD_FILES+=usr/lib/libbluetooth_p.a OLD_FILES+=usr/lib/libbsdxml_p.a OLD_FILES+=usr/lib/libbsm_p.a OLD_FILES+=usr/lib/libbsnmp_p.a OLD_FILES+=usr/lib/libbz2_p.a +OLD_FILES+=usr/lib/libc++_p.a OLD_FILES+=usr/lib/libc_p.a OLD_FILES+=usr/lib/libcalendar_p.a OLD_FILES+=usr/lib/libcam_p.a OLD_FILES+=usr/lib/libcom_err_p.a OLD_FILES+=usr/lib/libcompat_p.a +OLD_FILES+=usr/lib/libcompiler_rt_p.a OLD_FILES+=usr/lib/libcrypt_p.a OLD_FILES+=usr/lib/libcrypto_p.a +OLD_FILES+=usr/lib/libctf_p.a OLD_FILES+=usr/lib/libcurses_p.a OLD_FILES+=usr/lib/libcursesw_p.a +OLD_FILES+=usr/lib/libcuse_p.a +OLD_FILES+=usr/lib/libcxxrt_p.a +OLD_FILES+=usr/lib/libdevctl_p.a OLD_FILES+=usr/lib/libdevinfo_p.a OLD_FILES+=usr/lib/libdevstat_p.a OLD_FILES+=usr/lib/libdialog_p.a +OLD_FILES+=usr/lib/libdl_p.a +OLD_FILES+=usr/lib/libdpv_p.a +OLD_FILES+=usr/lib/libdtrace_p.a +OLD_FILES+=usr/lib/libdwarf_p.a OLD_FILES+=usr/lib/libedit_p.a +OLD_FILES+=usr/lib/libefivar_p.a OLD_FILES+=usr/lib/libelf_p.a +OLD_FILES+=usr/lib/libexecinfo_p.a OLD_FILES+=usr/lib/libfetch_p.a +OLD_FILES+=usr/lib/libfigpar_p.a OLD_FILES+=usr/lib/libfl_p.a OLD_FILES+=usr/lib/libform_p.a OLD_FILES+=usr/lib/libformw_p.a +OLD_FILES+=usr/lib/libgcc_eh_p.a OLD_FILES+=usr/lib/libgcc_p.a OLD_FILES+=usr/lib/libgeom_p.a OLD_FILES+=usr/lib/libgnuregex_p.a +OLD_FILES+=usr/lib/libgpio_p.a OLD_FILES+=usr/lib/libgssapi_krb5_p.a +OLD_FILES+=usr/lib/libgssapi_ntlm_p.a OLD_FILES+=usr/lib/libgssapi_p.a +OLD_FILES+=usr/lib/libgssapi_spnego_p.a OLD_FILES+=usr/lib/libhdb_p.a OLD_FILES+=usr/lib/libheimbase_p.a +OLD_FILES+=usr/lib/libheimntlm_p.a OLD_FILES+=usr/lib/libheimsqlite_p.a OLD_FILES+=usr/lib/libhistory_p.a +OLD_FILES+=usr/lib/libhx509_p.a OLD_FILES+=usr/lib/libipsec_p.a +OLD_FILES+=usr/lib/libipt_p.a OLD_FILES+=usr/lib/libjail_p.a OLD_FILES+=usr/lib/libkadm5clnt_p.a OLD_FILES+=usr/lib/libkadm5srv_p.a @@ -7519,6 +7545,7 @@ OLD_FILES+=usr/lib/libkrb5_p.a OLD_FILES+=usr/lib/libkvm_p.a OLD_FILES+=usr/lib/libl_p.a OLD_FILES+=usr/lib/libln_p.a +OLD_FILES+=usr/lib/liblzma_p.a OLD_FILES+=usr/lib/libm_p.a OLD_FILES+=usr/lib/libmagic_p.a OLD_FILES+=usr/lib/libmd_p.a @@ -7527,26 +7554,52 @@ OLD_FILES+=usr/lib/libmenu_p.a OLD_FILES+=usr/lib/libmenuw_p.a OLD_FILES+=usr/lib/libmilter_p.a OLD_FILES+=usr/lib/libmp_p.a +OLD_FILES+=usr/lib/libmt_p.a OLD_FILES+=usr/lib/libncurses_p.a OLD_FILES+=usr/lib/libncursesw_p.a OLD_FILES+=usr/lib/libnetgraph_p.a OLD_FILES+=usr/lib/libngatm_p.a +OLD_FILES+=usr/lib/libnv_p.a +OLD_FILES+=usr/lib/libnvpair_p.a +OLD_FILES+=usr/lib/libopencsd_p.a OLD_FILES+=usr/lib/libopie_p.a OLD_FILES+=usr/lib/libpanel_p.a OLD_FILES+=usr/lib/libpanelw_p.a +OLD_FILES+=usr/lib/libpathconv_p.a OLD_FILES+=usr/lib/libpcap_p.a +OLD_FILES+=usr/lib/libpjdlog_p.a OLD_FILES+=usr/lib/libpmc_p.a +OLD_FILES+=usr/lib/libprivatebsdstat_p.a +OLD_FILES+=usr/lib/libprivatedevdctl_p.a +OLD_FILES+=usr/lib/libprivateevent_p.a +OLD_FILES+=usr/lib/libprivateheimipcc_p.a +OLD_FILES+=usr/lib/libprivateheimipcs_p.a +OLD_FILES+=usr/lib/libprivateifconfig_p.a +OLD_FILES+=usr/lib/libprivateldns_p.a +OLD_FILES+=usr/lib/libprivatesqlite3_p.a +OLD_FILES+=usr/lib/libprivatessh_p.a +OLD_FILES+=usr/lib/libprivateucl_p.a +OLD_FILES+=usr/lib/libprivateunbound_p.a +OLD_FILES+=usr/lib/libprivatezstd_p.a +OLD_FILES+=usr/lib/libproc_p.a +OLD_FILES+=usr/lib/libprocstat_p.a OLD_FILES+=usr/lib/libpthread_p.a OLD_FILES+=usr/lib/libradius_p.a +OLD_FILES+=usr/lib/libregex_p.a OLD_FILES+=usr/lib/libroken_p.a OLD_FILES+=usr/lib/librpcsvc_p.a +OLD_FILES+=usr/lib/librss_p.a OLD_FILES+=usr/lib/librt_p.a +OLD_FILES+=usr/lib/librtld_db_p.a OLD_FILES+=usr/lib/libsbuf_p.a OLD_FILES+=usr/lib/libsdp_p.a OLD_FILES+=usr/lib/libsmb_p.a OLD_FILES+=usr/lib/libssl_p.a +OLD_FILES+=usr/lib/libstdbuf_p.a OLD_FILES+=usr/lib/libstdc++_p.a +OLD_FILES+=usr/lib/libstdthreads_p.a OLD_FILES+=usr/lib/libsupc++_p.a +OLD_FILES+=usr/lib/libsysdecode_p.a OLD_FILES+=usr/lib/libtacplus_p.a OLD_FILES+=usr/lib/libtermcap_p.a OLD_FILES+=usr/lib/libtermcapw_p.a @@ -7558,14 +7611,23 @@ OLD_FILES+=usr/lib/libtinfo_p.a OLD_FILES+=usr/lib/libtinfow_p.a OLD_FILES+=usr/lib/libufs_p.a OLD_FILES+=usr/lib/libugidfw_p.a +OLD_FILES+=usr/lib/libulog_p.a +OLD_FILES+=usr/lib/libumem_p.a +OLD_FILES+=usr/lib/libusb_p.a OLD_FILES+=usr/lib/libusbhid_p.a +OLD_FILES+=usr/lib/libutempter_p.a OLD_FILES+=usr/lib/libutil_p.a +OLD_FILES+=usr/lib/libuutil_p.a OLD_FILES+=usr/lib/libvgl_p.a +OLD_FILES+=usr/lib/libvmmapi_p.a OLD_FILES+=usr/lib/libwind_p.a OLD_FILES+=usr/lib/libwrap_p.a +OLD_FILES+=usr/lib/libxo_p.a OLD_FILES+=usr/lib/liby_p.a OLD_FILES+=usr/lib/libypclnt_p.a OLD_FILES+=usr/lib/libz_p.a +OLD_FILES+=usr/lib/libzfs_core_p.a +OLD_FILES+=usr/lib/libzfs_p.a OLD_FILES+=usr/lib/private/libldns_p.a OLD_FILES+=usr/lib/private/libssh_p.a .endif From owner-svn-src-head@freebsd.org Sun Jan 20 22:08:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D22314A918D; Sun, 20 Jan 2019 22:08:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3AF8854DA; Sun, 20 Jan 2019 22:08:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E528086FF; Sun, 20 Jan 2019 22:08:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KM8oc2069864; Sun, 20 Jan 2019 22:08:50 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KM8n10069859; Sun, 20 Jan 2019 22:08:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201901202208.x0KM8n10069859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 20 Jan 2019 22:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343231 - in head: bin/csh bin/sh share/skel X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: bin/csh bin/sh share/skel X-SVN-Commit-Revision: 343231 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F3AF8854DA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 22:08:51 -0000 Author: trasz Date: Sun Jan 20 22:08:49 2019 New Revision: 343231 URL: https://svnweb.freebsd.org/changeset/base/343231 Log: Don't mess with BLOCKSIZE in shell startup files - it's set by login.conf(5); there's no need to even mention it in shell rc files. Not that it's wrong; just pointless and somewhat misleading. Reviewed by: jilles MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18809 Modified: head/bin/csh/csh.login head/bin/csh/dot.cshrc head/bin/sh/profile head/share/skel/dot.cshrc head/share/skel/dot.profile Modified: head/bin/csh/csh.login ============================================================================== --- head/bin/csh/csh.login Sun Jan 20 22:03:43 2019 (r343230) +++ head/bin/csh/csh.login Sun Jan 20 22:08:49 2019 (r343231) @@ -1,9 +1,6 @@ # $FreeBSD$ # # System-wide .login file for csh(1). -# Uncomment this to give you the default 4.2 behavior, where disk -# information is shown in K-Blocks -# setenv BLOCKSIZE K # # For the setting of languages and character sets please see # login.conf(5) and in particular the charset and lang options. Modified: head/bin/csh/dot.cshrc ============================================================================== --- head/bin/csh/dot.cshrc Sun Jan 20 22:03:43 2019 (r343230) +++ head/bin/csh/dot.cshrc Sun Jan 20 22:08:49 2019 (r343231) @@ -19,7 +19,6 @@ set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/s setenv EDITOR vi setenv PAGER less -setenv BLOCKSIZE K if ($?prompt) then # An interactive shell -- set some stuff up Modified: head/bin/sh/profile ============================================================================== --- head/bin/sh/profile Sun Jan 20 22:03:43 2019 (r343230) +++ head/bin/sh/profile Sun Jan 20 22:08:49 2019 (r343231) @@ -2,10 +2,6 @@ # # System-wide .profile file for sh(1). # -# Uncomment this to give you the default 4.2 behavior, where disk -# information is shown in K-Blocks -# BLOCKSIZE=K; export BLOCKSIZE -# # For the setting of languages and character sets please see # login.conf(5) and in particular the charset and lang options. # For full locales list check /usr/share/locale/* Modified: head/share/skel/dot.cshrc ============================================================================== --- head/share/skel/dot.cshrc Sun Jan 20 22:03:43 2019 (r343230) +++ head/share/skel/dot.cshrc Sun Jan 20 22:08:49 2019 (r343231) @@ -15,7 +15,6 @@ alias ll ls -lAF # These are normally set through /etc/login.conf. You may override them here # if wanted. # set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin) -# setenv BLOCKSIZE K # A righteous umask # umask 22 Modified: head/share/skel/dot.profile ============================================================================== --- head/share/skel/dot.profile Sun Jan 20 22:03:43 2019 (r343230) +++ head/share/skel/dot.profile Sun Jan 20 22:08:49 2019 (r343231) @@ -8,7 +8,6 @@ # These are normally set through /etc/login.conf. You may override them here # if wanted. # PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin; export PATH -# BLOCKSIZE=K; export BLOCKSIZE # Setting TERM is normally done through /etc/ttys. Do only override # if you're sure that you'll never log in via telnet or xterm or a From owner-svn-src-head@freebsd.org Mon Jan 21 00:03:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ED9F14AE6B3; Mon, 21 Jan 2019 00:03:36 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1210F8B206; Mon, 21 Jan 2019 00:03:36 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00F829AED; Mon, 21 Jan 2019 00:03:36 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0L03Z3K031879; Mon, 21 Jan 2019 00:03:35 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L03Zw6031878; Mon, 21 Jan 2019 00:03:35 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901210003.x0L03Zw6031878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Jan 2019 00:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343234 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 343234 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1210F8B206 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 00:03:36 -0000 Author: avos Date: Mon Jan 21 00:03:35 2019 New Revision: 343234 URL: https://svnweb.freebsd.org/changeset/base/343234 Log: run(4): add more length checks in Rx path. - Discard frames that are bigger than MCLBYTES (to prevent buffer overrun). - Check buffer length before accessing its contents. - Fix len <-> dmalen check - the last includes Rx Wireless information structure size. - Fix out-of-bounds read during Rx node search for ACK / CTS frames (monitor mode only). While here: - Mark few suspicious places with comments. - Move common cleanup to the function end. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Sun Jan 20 23:30:16 2019 (r343233) +++ head/sys/dev/usb/wlan/if_run.c Mon Jan 21 00:03:35 2019 (r343234) @@ -2824,69 +2824,80 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uin uint8_t ant, rssi; int8_t nf; - rxwi = mtod(m, struct rt2860_rxwi *); - len = le16toh(rxwi->len) & 0xfff; rxwisize = sizeof(struct rt2860_rxwi); if (sc->mac_ver == 0x5592) rxwisize += sizeof(uint64_t); else if (sc->mac_ver == 0x3593) rxwisize += sizeof(uint32_t); - if (__predict_false(len > dmalen)) { - m_freem(m); - counter_u64_add(ic->ic_ierrors, 1); + + if (__predict_false(dmalen < + rxwisize + sizeof(struct ieee80211_frame_ack))) { RUN_DPRINTF(sc, RUN_DEBUG_RECV, + "payload is too short: dma length %u < %zu\n", + dmalen, rxwisize + sizeof(struct ieee80211_frame_ack)); + goto fail; + } + + rxwi = mtod(m, struct rt2860_rxwi *); + len = le16toh(rxwi->len) & 0xfff; + + if (__predict_false(len > dmalen - rxwisize)) { + RUN_DPRINTF(sc, RUN_DEBUG_RECV, "bad RXWI length %u > %u\n", len, dmalen); - return; + goto fail; } + /* Rx descriptor is located at the end */ rxd = (struct rt2870_rxd *)(mtod(m, caddr_t) + dmalen); flags = le32toh(rxd->flags); if (__predict_false(flags & (RT2860_RX_CRCERR | RT2860_RX_ICVERR))) { - m_freem(m); - counter_u64_add(ic->ic_ierrors, 1); RUN_DPRINTF(sc, RUN_DEBUG_RECV, "%s error.\n", (flags & RT2860_RX_CRCERR)?"CRC":"ICV"); - return; + goto fail; } + if (flags & RT2860_RX_L2PAD) { + /* + * XXX OpenBSD removes padding between header + * and payload here... + */ + RUN_DPRINTF(sc, RUN_DEBUG_RECV, + "received RT2860_RX_L2PAD frame\n"); + len += 2; + } + m->m_data += rxwisize; - m->m_pkthdr.len = m->m_len -= rxwisize; + m->m_pkthdr.len = m->m_len = len; wh = mtod(m, struct ieee80211_frame *); + /* XXX wrong for monitor mode */ if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; m->m_flags |= M_WEP; } - if (flags & RT2860_RX_L2PAD) { - RUN_DPRINTF(sc, RUN_DEBUG_RECV, - "received RT2860_RX_L2PAD frame\n"); - len += 2; - } + if (len >= sizeof(struct ieee80211_frame_min)) { + ni = ieee80211_find_rxnode(ic, + mtod(m, struct ieee80211_frame_min *)); + } else + ni = NULL; - ni = ieee80211_find_rxnode(ic, - mtod(m, struct ieee80211_frame_min *)); - if (__predict_false(flags & RT2860_RX_MICERR)) { /* report MIC failures to net80211 for TKIP */ if (ni != NULL) ieee80211_notify_michael_failure(ni->ni_vap, wh, rxwi->keyidx); - m_freem(m); - counter_u64_add(ic->ic_ierrors, 1); RUN_DPRINTF(sc, RUN_DEBUG_RECV, "MIC error. Someone is lying.\n"); - return; + goto fail; } ant = run_maxrssi_chain(sc, rxwi); rssi = rxwi->rssi[ant]; nf = run_rssi2dbm(sc, rssi, ant); - m->m_pkthdr.len = m->m_len = len; - if (__predict_false(ieee80211_radiotap_active(ic))) { struct run_rx_radiotap_header *tap = &sc->sc_rxtap; uint16_t phy; @@ -2934,6 +2945,12 @@ run_rx_frame(struct run_softc *sc, struct mbuf *m, uin } else { (void)ieee80211_input_all(ic, m, rssi, nf); } + + return; + +fail: + m_freem(m); + counter_u64_add(ic->ic_ierrors, 1); } static void @@ -2943,7 +2960,7 @@ run_bulk_rx_callback(struct usb_xfer *xfer, usb_error_ struct ieee80211com *ic = &sc->sc_ic; struct mbuf *m = NULL; struct mbuf *m0; - uint32_t dmalen; + uint32_t dmalen, mbuf_len; uint16_t rxwisize; int xferlen; @@ -3049,6 +3066,14 @@ tr_setup: break; } + mbuf_len = dmalen + sizeof(struct rt2870_rxd); + if (__predict_false(mbuf_len > MCLBYTES)) { + RUN_DPRINTF(sc, RUN_DEBUG_RECV_DESC | RUN_DEBUG_USB, + "payload is too big: mbuf_len %u\n", mbuf_len); + counter_u64_add(ic->ic_ierrors, 1); + break; + } + /* copy aggregated frames to another mbuf */ m0 = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m0 == NULL)) { @@ -3058,14 +3083,13 @@ tr_setup: break; } m_copydata(m, 4 /* skip 32-bit DMA-len header */, - dmalen + sizeof(struct rt2870_rxd), mtod(m0, caddr_t)); - m0->m_pkthdr.len = m0->m_len = - dmalen + sizeof(struct rt2870_rxd); + mbuf_len, mtod(m0, caddr_t)); + m0->m_pkthdr.len = m0->m_len = mbuf_len; run_rx_frame(sc, m0, dmalen); /* update data ptr */ - m->m_data += dmalen + 8; - m->m_pkthdr.len = m->m_len -= dmalen + 8; + m->m_data += mbuf_len + 4; + m->m_pkthdr.len = m->m_len -= mbuf_len + 4; } /* make sure we free the source buffer, if any */ From owner-svn-src-head@freebsd.org Mon Jan 21 00:09:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DA0014AEB84; Mon, 21 Jan 2019 00:09:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C49188B4E3; Mon, 21 Jan 2019 00:09:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7D119AF1; Mon, 21 Jan 2019 00:09:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0L09smo032190; Mon, 21 Jan 2019 00:09:54 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L09sLM032189; Mon, 21 Jan 2019 00:09:54 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901210009.x0L09sLM032189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Jan 2019 00:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343235 - head/sys/dev/iwn X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/iwn X-SVN-Commit-Revision: 343235 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C49188B4E3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 00:09:55 -0000 Author: avos Date: Mon Jan 21 00:09:54 2019 New Revision: 343235 URL: https://svnweb.freebsd.org/changeset/base/343235 Log: iwn(4): drop return code from iwn_*attach functions (they cannot fail) While here, add missing trace 'end' marker in iwn5000_attach(). MFC after: 1 week Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon Jan 21 00:03:35 2019 (r343234) +++ head/sys/dev/iwn/if_iwn.c Mon Jan 21 00:09:54 2019 (r343235) @@ -131,8 +131,8 @@ static const struct iwn_ident iwn_ident_table[] = { static int iwn_probe(device_t); static int iwn_attach(device_t); -static int iwn4965_attach(struct iwn_softc *, uint16_t); -static int iwn5000_attach(struct iwn_softc *, uint16_t); +static void iwn4965_attach(struct iwn_softc *, uint16_t); +static void iwn5000_attach(struct iwn_softc *, uint16_t); static int iwn_config_specific(struct iwn_softc *, uint16_t); static void iwn_radiotap_attach(struct iwn_softc *); static void iwn_sysctlattach(struct iwn_softc *); @@ -495,14 +495,9 @@ iwn_attach(device_t dev) * Let's set those up first. */ if (sc->hw_type == IWN_HW_REV_TYPE_4965) - error = iwn4965_attach(sc, pci_get_device(dev)); + iwn4965_attach(sc, pci_get_device(dev)); else - error = iwn5000_attach(sc, pci_get_device(dev)); - if (error != 0) { - device_printf(dev, "could not attach device, error %d\n", - error); - goto fail; - } + iwn5000_attach(sc, pci_get_device(dev)); /* * Next, let's setup the various parameters of each NIC. @@ -1224,12 +1219,13 @@ iwn_config_specific(struct iwn_softc *sc, uint16_t pid return 0; } -static int +static void iwn4965_attach(struct iwn_softc *sc, uint16_t pid) { struct iwn_ops *ops = &sc->ops; DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); + ops->load_firmware = iwn4965_load_firmware; ops->read_eeprom = iwn4965_read_eeprom; ops->post_alive = iwn4965_post_alive; @@ -1264,11 +1260,9 @@ iwn4965_attach(struct iwn_softc *sc, uint16_t pid) sc->sc_flags |= IWN_FLAG_BTCOEX; DPRINTF(sc, IWN_DEBUG_TRACE, "%s: end\n",__func__); - - return 0; } -static int +static void iwn5000_attach(struct iwn_softc *sc, uint16_t pid) { struct iwn_ops *ops = &sc->ops; @@ -1303,7 +1297,7 @@ iwn5000_attach(struct iwn_softc *sc, uint16_t pid) sc->reset_noise_gain = IWN5000_PHY_CALIB_RESET_NOISE_GAIN; sc->noise_gain = IWN5000_PHY_CALIB_NOISE_GAIN; - return 0; + DPRINTF(sc, IWN_DEBUG_TRACE, "%s: end\n",__func__); } /* From owner-svn-src-head@freebsd.org Sun Jan 20 21:09:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7866014A68FD; Sun, 20 Jan 2019 21:09:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D7B782AA8; Sun, 20 Jan 2019 21:09:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 028F77CEF; Sun, 20 Jan 2019 21:09:45 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KL9iZr038441; Sun, 20 Jan 2019 21:09:44 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KL9ioc038440; Sun, 20 Jan 2019 21:09:44 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901202109.x0KL9ioc038440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 20 Jan 2019 21:09:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343225 - head/stand/mips/beri/boot2 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/stand/mips/beri/boot2 X-SVN-Commit-Revision: 343225 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1D7B782AA8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 21:09:45 -0000 Author: gonzo Date: Sun Jan 20 21:09:44 2019 New Revision: 343225 URL: https://svnweb.freebsd.org/changeset/base/343225 Log: Unbreak mip64 build after r328437 Add exit and getchar functions to beri/boot2 code. They are required by panic_action functin introduced in r328437 Modified: head/stand/mips/beri/boot2/boot2.c Modified: head/stand/mips/beri/boot2/boot2.c ============================================================================== --- head/stand/mips/beri/boot2/boot2.c Sun Jan 20 20:29:26 2019 (r343224) +++ head/stand/mips/beri/boot2/boot2.c Sun Jan 20 21:09:44 2019 (r343225) @@ -651,3 +651,19 @@ xgetc(int fn) return 0; } } + +int +getchar(void) +{ + + return xgetc(0); +} + +void +exit(int code) +{ + + printf("error: loader exit\n"); + while (1); + __unreachable(); +} From owner-svn-src-head@freebsd.org Sun Jan 20 23:30:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C396D14AD59B; Sun, 20 Jan 2019 23:30:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6954E89F99; Sun, 20 Jan 2019 23:30:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D903944A; Sun, 20 Jan 2019 23:30:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0KNUHb4011468; Sun, 20 Jan 2019 23:30:17 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0KNUH0c011467; Sun, 20 Jan 2019 23:30:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201901202330.x0KNUH0c011467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 20 Jan 2019 23:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343233 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 343233 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6954E89F99 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2019 23:30:17 -0000 Author: np Date: Sun Jan 20 23:30:16 2019 New Revision: 343233 URL: https://svnweb.freebsd.org/changeset/base/343233 Log: cxgbe(4): Clear the reply-pending status of a hashfilter when the reply indicates an error. Also, do not remove it twice from the hf list in this case. Submitted by: Krishnamraju Eraparaju @ Chelsio MFC after: 1 week Sponsored by: Chelsio Communicatons Modified: head/sys/dev/cxgbe/t4_filter.c Modified: head/sys/dev/cxgbe/t4_filter.c ============================================================================== --- head/sys/dev/cxgbe/t4_filter.c Sun Jan 20 22:34:04 2019 (r343232) +++ head/sys/dev/cxgbe/t4_filter.c Sun Jan 20 23:30:16 2019 (r343233) @@ -1229,6 +1229,7 @@ t4_hashfilter_ao_rpl(struct sge_iq *iq, const struct r /* provide errno instead of tid to ioctl */ f->tid = act_open_rpl_status_to_errno(status); f->valid = 0; + f->pending = 0; if (act_open_has_tid(status)) release_tid(sc, GET_TID(cpl), &sc->sge.ctrlq[0]); free_filter_resources(f); @@ -1587,7 +1588,6 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t f->locked = 0; t->idx = f->tid; } else { - remove_hf(sc, f); rc = f->tid; free(f, M_CXGBE); } From owner-svn-src-head@freebsd.org Mon Jan 21 00:53:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C323D14B048D; Mon, 21 Jan 2019 00:53:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 601B78D12A; Mon, 21 Jan 2019 00:53:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52BBDA351; Mon, 21 Jan 2019 00:53:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0L0rduB057906; Mon, 21 Jan 2019 00:53:39 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L0rcNf057904; Mon, 21 Jan 2019 00:53:38 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901210053.x0L0rcNf057904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Jan 2019 00:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343238 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 343238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 601B78D12A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 00:53:40 -0000 Author: avos Date: Mon Jan 21 00:53:38 2019 New Revision: 343238 URL: https://svnweb.freebsd.org/changeset/base/343238 Log: urtw(4): add length checks in Rx path. - Check if buffer can contain Rx descriptor before accessing it. - Verify upper / lower bounds for frame length. - Do not pass too short frames into ieee80211_find_rxnode(). While here: - Move cleanup to the function end. - Reuse IEEE80211_IS_DATA() macro. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_urtwvar.h Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Mon Jan 21 00:32:04 2019 (r343237) +++ head/sys/dev/usb/wlan/if_urtw.c Mon Jan 21 00:53:38 2019 (r343238) @@ -3933,21 +3933,18 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); - if (actlen < (int)URTW_MIN_RXBUFSZ) { - counter_u64_add(ic->ic_ierrors, 1); - return (NULL); - } - if (sc->sc_flags & URTW_RTL8187B) { struct urtw_8187b_rxhdr *rx; + if (actlen < sizeof(*rx) + IEEE80211_ACK_LEN) + goto fail; + rx = (struct urtw_8187b_rxhdr *)(data->buf + (actlen - (sizeof(struct urtw_8187b_rxhdr)))); flen = le32toh(rx->flag) & 0xfff; - if (flen > actlen) { - counter_u64_add(ic->ic_ierrors, 1); - return (NULL); - } + if (flen > actlen - sizeof(*rx)) + goto fail; + rate = (le32toh(rx->flag) >> URTW_RX_FLAG_RXRATE_SHIFT) & 0xf; /* XXX correct? */ rssi = rx->rssi & URTW_RX_RSSI_MASK; @@ -3955,13 +3952,14 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da } else { struct urtw_8187l_rxhdr *rx; + if (actlen < sizeof(*rx) + IEEE80211_ACK_LEN) + goto fail; + rx = (struct urtw_8187l_rxhdr *)(data->buf + (actlen - (sizeof(struct urtw_8187l_rxhdr)))); flen = le32toh(rx->flag) & 0xfff; - if (flen > actlen) { - counter_u64_add(ic->ic_ierrors, 1); - return (NULL); - } + if (flen > actlen - sizeof(*rx)) + goto fail; rate = (le32toh(rx->flag) >> URTW_RX_FLAG_RXRATE_SHIFT) & 0xf; /* XXX correct? */ @@ -3969,11 +3967,12 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da noise = rx->noise; } + if (flen < IEEE80211_ACK_LEN) + goto fail; + mnew = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); - if (mnew == NULL) { - counter_u64_add(ic->ic_ierrors, 1); - return (NULL); - } + if (mnew == NULL) + goto fail; m = data->m; data->m = mnew; @@ -3992,13 +3991,17 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *da } wh = mtod(m, struct ieee80211_frame *); - if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_DATA) + if (IEEE80211_IS_DATA(wh)) sc->sc_currate = (rate > 0) ? rate : sc->sc_currate; *rssi_p = rssi; *nf_p = noise; /* XXX correct? */ return (m); + +fail: + counter_u64_add(ic->ic_ierrors, 1); + return (NULL); } static void @@ -4006,7 +4009,6 @@ urtw_bulk_rx_callback(struct usb_xfer *xfer, usb_error { struct urtw_softc *sc = usbd_xfer_softc(xfer); struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211_frame *wh; struct ieee80211_node *ni; struct mbuf *m = NULL; struct urtw_data *data; @@ -4044,9 +4046,13 @@ setup: */ URTW_UNLOCK(sc); if (m != NULL) { - wh = mtod(m, struct ieee80211_frame *); - ni = ieee80211_find_rxnode(ic, - (struct ieee80211_frame_min *)wh); + if (m->m_pkthdr.len >= + sizeof(struct ieee80211_frame_min)) { + ni = ieee80211_find_rxnode(ic, + mtod(m, struct ieee80211_frame_min *)); + } else + ni = NULL; + if (ni != NULL) { (void) ieee80211_input(ni, m, rssi, nf); /* node is no longer needed */ Modified: head/sys/dev/usb/wlan/if_urtwvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwvar.h Mon Jan 21 00:32:04 2019 (r343237) +++ head/sys/dev/usb/wlan/if_urtwvar.h Mon Jan 21 00:53:38 2019 (r343238) @@ -47,10 +47,6 @@ struct urtw_data { }; typedef STAILQ_HEAD(, urtw_data) urtw_datahead; -/* XXX not correct.. */ -#define URTW_MIN_RXBUFSZ \ - (sizeof(struct ieee80211_frame_min)) - #define URTW_RX_DATA_LIST_COUNT 4 #define URTW_TX_DATA_LIST_COUNT 16 #define URTW_RX_MAXSIZE 0x9c4 From owner-svn-src-head@freebsd.org Mon Jan 21 01:45:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E92A714B147A; Mon, 21 Jan 2019 01:45:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8ED2E8E90E; Mon, 21 Jan 2019 01:45:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AECAABA4; Mon, 21 Jan 2019 01:45:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0L1jZXV084110; Mon, 21 Jan 2019 01:45:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L1jZww084109; Mon, 21 Jan 2019 01:45:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901210145.x0L1jZww084109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 21 Jan 2019 01:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343240 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8ED2E8E90E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 01:45:36 -0000 Author: kevans Date: Mon Jan 21 01:45:35 2019 New Revision: 343240 URL: https://svnweb.freebsd.org/changeset/base/343240 Log: iwm(4): Fix possible null pointer indirection Obtained from: DragonFlyBSD (obtained from Haiku) MFC after: 1 week Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Jan 21 01:03:03 2019 (r343239) +++ head/sys/dev/iwm/if_iwm.c Mon Jan 21 01:45:35 2019 (r343240) @@ -1033,7 +1033,8 @@ iwm_reset_rx_ring(struct iwm_softc *sc, struct iwm_rx_ * The hw rx ring index in shared memory must also be cleared, * otherwise the discrepancy can cause reprocessing chaos. */ - memset(sc->rxq.stat, 0, sizeof(*sc->rxq.stat)); + if (sc->rxq.stat) + memset(sc->rxq.stat, 0, sizeof(*sc->rxq.stat)); } static void From owner-svn-src-head@freebsd.org Mon Jan 21 03:38:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B6D9148D24C; Mon, 21 Jan 2019 03:38:38 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1D2C6B513; Mon, 21 Jan 2019 03:38:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A30E8C0B9; Mon, 21 Jan 2019 03:38:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0L3cbK6041661; Mon, 21 Jan 2019 03:38:37 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L3cbxm041660; Mon, 21 Jan 2019 03:38:37 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901210338.x0L3cbxm041660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Jan 2019 03:38:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343244 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 343244 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1D2C6B513 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 03:38:38 -0000 Author: avos Date: Mon Jan 21 03:38:37 2019 New Revision: 343244 URL: https://svnweb.freebsd.org/changeset/base/343244 Log: devd.conf(5): add otus(4) into wifi-driver-regex MFC after: 5 days Modified: head/sbin/devd/devd.conf Modified: head/sbin/devd/devd.conf ============================================================================== --- head/sbin/devd/devd.conf Mon Jan 21 03:01:41 2019 (r343243) +++ head/sbin/devd/devd.conf Mon Jan 21 03:38:37 2019 (r343244) @@ -23,8 +23,8 @@ options { esp|ida|iir|ips|isp|mlx|mly|mpr|mps|mpt|sym|trm)\ [0-9]+"; set wifi-driver-regex - "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|ral|rsu|rtwn|rum|run|\ - uath|upgt|ural|urtw|wi|wpi|wtap|zyd)[0-9]+"; + "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|otus|ral|rsu|rtwn|rum|\ + run|uath|upgt|ural|urtw|wi|wpi|wtap|zyd)[0-9]+"; }; # Note that the attach/detach with the highest value wins, so that one can From owner-svn-src-head@freebsd.org Mon Jan 21 03:47:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF0C9148D567; Mon, 21 Jan 2019 03:47:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72FF36B9F2; Mon, 21 Jan 2019 03:47:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 509C0C25F; Mon, 21 Jan 2019 03:47:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0L3lLRu047116; Mon, 21 Jan 2019 03:47:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L3lLQt047115; Mon, 21 Jan 2019 03:47:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901210347.x0L3lLQt047115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Jan 2019 03:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343245 - head/usr.bin/cmp X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/cmp X-SVN-Commit-Revision: 343245 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 72FF36B9F2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 03:47:22 -0000 Author: markj Date: Mon Jan 21 03:47:20 2019 New Revision: 343245 URL: https://svnweb.freebsd.org/changeset/base/343245 Log: Revert r343117. It breaks the special mode specified by passing "-" as one of the input files. Revert for now while we discuss a fix. PR: 234885 Reported by: delphij MFC after: now Modified: head/usr.bin/cmp/cmp.c Modified: head/usr.bin/cmp/cmp.c ============================================================================== --- head/usr.bin/cmp/cmp.c Mon Jan 21 03:38:37 2019 (r343244) +++ head/usr.bin/cmp/cmp.c Mon Jan 21 03:47:20 2019 (r343245) @@ -116,16 +116,14 @@ main(int argc, char *argv[]) if (argc < 2 || argc > 4) usage(); - if (caph_limit_stdio() == -1) - err(ERR_EXIT, "failed to limit stdio"); - /* Backward compatibility -- handle "-" meaning stdin. */ special = 0; if (strcmp(file1 = argv[0], "-") == 0) { special = 1; - fd1 = STDIN_FILENO; + fd1 = 0; file1 = "stdin"; - } else if ((fd1 = open(file1, oflag, 0)) < 0 && errno != EMLINK) { + } + else if ((fd1 = open(file1, oflag, 0)) < 0 && errno != EMLINK) { if (!sflag) err(ERR_EXIT, "%s", file1); else @@ -136,9 +134,10 @@ main(int argc, char *argv[]) errx(ERR_EXIT, "standard input may only be specified once"); special = 1; - fd2 = STDIN_FILENO; + fd2 = 0; file2 = "stdin"; - } else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) { + } + else if ((fd2 = open(file2, oflag, 0)) < 0 && errno != EMLINK) { if (!sflag) err(ERR_EXIT, "%s", file2); else @@ -175,6 +174,16 @@ main(int argc, char *argv[]) err(ERR_EXIT, "unable to limit fcntls for %s", file1); if (caph_fcntls_limit(fd2, fcntls) < 0) err(ERR_EXIT, "unable to limit fcntls for %s", file2); + + if (!special) { + cap_rights_init(&rights); + if (caph_rights_limit(STDIN_FILENO, &rights) < 0) { + err(ERR_EXIT, "unable to limit stdio"); + } + } + + if (caph_limit_stdout() == -1 || caph_limit_stderr() == -1) + err(ERR_EXIT, "unable to limit stdio"); caph_cache_catpages(); From owner-svn-src-head@freebsd.org Mon Jan 21 03:57:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 273D3148DA50; Mon, 21 Jan 2019 03:57:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A766B6C0D0; Mon, 21 Jan 2019 03:57:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92477C40C; Mon, 21 Jan 2019 03:57:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0L3vnl5052454; Mon, 21 Jan 2019 03:57:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L3vnIx052453; Mon, 21 Jan 2019 03:57:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901210357.x0L3vnIx052453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Jan 2019 03:57:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343247 - head/usr.bin/cmp/tests X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/cmp/tests X-SVN-Commit-Revision: 343247 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A766B6C0D0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 03:57:50 -0000 Author: markj Date: Mon Jan 21 03:57:49 2019 New Revision: 343247 URL: https://svnweb.freebsd.org/changeset/base/343247 Log: Fix cmp(1) tests for "special" mode. Test failures don't seem to propagate up if atf_check is run in a pipeline. Thus, the tests continued to pass despite the bug reverted in r343245. MFC after: 1 week Modified: head/usr.bin/cmp/tests/cmp_test2.sh Modified: head/usr.bin/cmp/tests/cmp_test2.sh ============================================================================== --- head/usr.bin/cmp/tests/cmp_test2.sh Mon Jan 21 03:48:30 2019 (r343246) +++ head/usr.bin/cmp/tests/cmp_test2.sh Mon Jan 21 03:57:49 2019 (r343247) @@ -31,11 +31,10 @@ special_head() { special_body() { echo 0123456789abcdef > a echo 0123456789abcdeg > b - cat a | atf_check -s exit:0 cmp a - - cat a | atf_check -s exit:0 cmp - a - cat b | atf_check -s not-exit:0 cmp a - - cat b | atf_check -s not-exit:0 cmp - a - true + atf_check -s exit:0 -o empty -e empty -x "cat a | cmp a -" + atf_check -s exit:0 -o empty -e empty -x "cat a | cmp - a" + atf_check -s exit:1 -o not-empty -e empty -x "cat b | cmp a -" + atf_check -s exit:1 -o not-empty -e empty -x "cat b | cmp - a" } atf_test_case symlink From owner-svn-src-head@freebsd.org Mon Jan 21 04:10:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5C47148E03E; Mon, 21 Jan 2019 04:10:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E4916C75C; Mon, 21 Jan 2019 04:10:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x431.google.com with SMTP id g62so9462584pfd.12; Sun, 20 Jan 2019 20:10:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=Jm17GzQvlaZgn8lkvHwQmwyKXFlpNNyLcKMF0WRPuio=; b=kYi4Iz8MMAkKPd9itkpzKGrn/Z57/x0EGeGuLvahCHK8DtwmEkI8lXUGSJIZ21Qhge 5MsKB+vTs4zmAkvMD9Hz8EioQzz+7q8ne3Xvto/OS9HsNMsUV50fiZIoq/LL7dMORPLl wLJMk/hdkFtgC/HzHupOYIPldQr3BgHNjY2dNY/KX8vfHHq/wBZhtk5z6n6A6WVs1SUb fVJuL7Qmulbz64uHo0AKnsSK70Rf2MUWLW5UR9MWEZpoihc9P9G/3J15FrFi24EfiHwq q0Du4mVeLgG9OD5YrJ+4R6aSa/HNX0gofFwczvPgvMy8ckAGkptDEC9YDKxEFKq5hD8c 407g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=Jm17GzQvlaZgn8lkvHwQmwyKXFlpNNyLcKMF0WRPuio=; b=aS7qRmNUGLR5XaEVkzN0VAJScRdP8hBlHga3yasGs3842LwMXQas5neOJUnnQ0FUD+ zGXJ9hQaCgtPRcMUXIC36jY3SrnQOj2zZQaJyw3dOWIons5qfff97kIYG33y4ZHtcqaP LBObvqYQA4Lac8j06AyokpKgdxStG3S3GlrrYYcBgDa6BXt4vXt1ADD89BgRtFte+54G +hytJYOZI64ALt7RIeXfrWmzEJSyq7iRxXKUB0qH36oHaKXNz+UyRwD4cn6J0xBhb68N qogGHeDn7Da70GPsJBcmRPeyX3KNOMfNqsZEXINMuHDlrI+sOXI4o9+uk3lACsarRrLY HP4Q== X-Gm-Message-State: AJcUukcbkDWyeazW/nTy7rMOcwPaqTjxEwTG3VPZtXpikC4TDRTuTB7c vzA1/Z4XRLC0tHJXmGo4KAD0Msiz X-Google-Smtp-Source: ALg8bN5H0FEMnpXAG0p4d1+d4xPqrVUP6LQb5tBar39Memmdrk/VQ2QKodOzw0DmIr07mPYfhUoWSQ== X-Received: by 2002:a63:f65:: with SMTP id 37mr26542780pgp.238.1548043821783; Sun, 20 Jan 2019 20:10:21 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id a90sm19844561pfj.109.2019.01.20.20.10.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Jan 2019 20:10:21 -0800 (PST) From: Enji Cooper Message-Id: <6CF2AD75-F267-4E1F-8505-605BB468D5AF@gmail.com> Content-Type: multipart/signed; boundary="Apple-Mail=_A48CB0BD-336E-4594-9F9E-7CB0C0AB46B8"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343247 - head/usr.bin/cmp/tests Date: Sun, 20 Jan 2019 20:10:19 -0800 In-Reply-To: <201901210357.x0L3vnIx052453@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Mark Johnston References: <201901210357.x0L3vnIx052453@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: 0E4916C75C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 04:10:24 -0000 --Apple-Mail=_A48CB0BD-336E-4594-9F9E-7CB0C0AB46B8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 20, 2019, at 7:57 PM, Mark Johnston wrote: >=20 > Author: markj > Date: Mon Jan 21 03:57:49 2019 > New Revision: 343247 > URL: https://svnweb.freebsd.org/changeset/base/343247 >=20 > Log: > Fix cmp(1) tests for "special" mode. >=20 > Test failures don't seem to propagate up if atf_check is run in > a pipeline. Thus, the tests continued to pass despite the bug = reverted > in r343245. Hmmm=E2=80=A6 that=E2=80=99s strange=E2=80=A6 -Enji --Apple-Mail=_A48CB0BD-336E-4594-9F9E-7CB0C0AB46B8 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEtvtxN6kOllEF3nmX5JFNMZeDGN4FAlxFRisACgkQ5JFNMZeD GN74BA/+JPh4rgtJbus4A4WcOHJshBVB3VyrjZDjAKUrvk7aTxqqibVWjr0SDxcv JhtALnhaIc4Hu5EvHJzYC+AaWfFcLafsOmDdsxOlMByZ1QDZVfRRgYr3XwjX74aq iLmTqA1WqxEDoIcHkH/fxBlzTpZ1uujMwSM5NIJqemPynzOcsztwt5NTfTSYQxZA NWug6UBxSjL7bzOxIR4f9hntdB1B3DMsv3+ngUnBqClDtAll3X3g4g52WJH4jhUH ahLpHL+G4vaAD4eo4S4uW0X9a2zbtYIZ3nPXGqzAuoIfh8k+RzbA05l8F8+W5S5n 1YqJHqzBltvsQCUxr0U42NXcSxw18CBzP9iAgo1yq112bcF3cPpn0dJ1aw3UDsuH xyIlMgt4E7f9tJfxRGu08CikVEU7qk6Fn0x9f9EXOm8T8TFZdv/tM8fSDl+IgpJP Fko70sA/sNiy/qWHasfx9u+1OFh9gKGSeRBieio0QS/y+5JHKVEzTaJbNoxRA9/a HHx6xg91bSb9yHHkRwOsn4LE169tQvXITbkf+mYXOscxqKDOSnNf0rwPTs1SMXs+ QfPuhchzj8NvnyXGWaqJ2rcDUX18G0Wq3zZWu5TnQ9D4tUYmOCFXyxFcbpwexgC7 0KYmPcLOLeKwKf6eLpTB2QO+0K+keIxzkA9RLayyePjtnjNLSSk= =WYHg -----END PGP SIGNATURE----- --Apple-Mail=_A48CB0BD-336E-4594-9F9E-7CB0C0AB46B8-- From owner-svn-src-head@freebsd.org Mon Jan 21 04:11:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 904C2148E4B1; Mon, 21 Jan 2019 04:11:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AD0D6CC54; Mon, 21 Jan 2019 04:11:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x635.google.com with SMTP id 101so9123559pld.6; Sun, 20 Jan 2019 20:11:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=pdFQ9YzfuzWOPdDPzspymel/HvCgaigoHVzC1AF1NsE=; b=fXZznRS2zXF6ZzZJpeiP0u30En3nKaTV/KhESbu8oZW8uw5ixV6eOLOnzR8Oi/Pr0Z YSfsRaLaAghqhiTHXE0JdbwEUO4JO5ak3i27NEvk0nVK/h6ucbgJ5yvYgI6oEjeaTmxR SIykvMMjuTEnKx4hTL3SIw0G5ANbaswzrDaRZEfJEyEudLbBAG1iPs1lgMadgbHBqRBL mKQRCMlWXM/co7NmmVpsv5111Rhv6wDxSbCGL4xgoNXyR98kI992nWuwKYhZ9yZFZj71 4JdnUoUEHknNvb8GVYYfWKJL8RV+xnodzP9nRijktXDkLwbW1HwjjWUnabGqxEOVlbjz jsQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=pdFQ9YzfuzWOPdDPzspymel/HvCgaigoHVzC1AF1NsE=; b=blm8VsUMtM/N82uauS/O5Bx7+35joM79ueYhkvKpM5jYH70iniza3cchUxF5QmnGpC S+VsF7d3D23LWIX4j/lZzqOUIGTfoKIywMIYs4Sg+YOt1zb47GIRJYLUbwWD5AT37Kho gmFnuBgKPbpSQ5fLrgrPn0ii0mx164BqrByHPR+PnlK9POo9WaAG+mH2yD3QfqezMAtT 3G14d0bo13iKIL4BjBBVKfuwijSIOFQJ3bs3uQeTr2dsrFe6lE6JoJ+Rck3rIRRNU/Jw CjKMxBZGpDSy448rO2tVW4dWuS0dffIbHtfocYstWIxTa+pGjZ8WIf/YEXGylHMfEAmE APIQ== X-Gm-Message-State: AJcUukd2XB33Hr2uKkrp6oD+qoJVNa2+QbYq8oLKLqgGXCI6UutmTmgT aYCGwfzx+JqsPu72+XSbaG3GDxXh X-Google-Smtp-Source: ALg8bN6JyWbuC2O9Gc+VhQ3ueI+I3z+u8nBiNTGDutG3XgjMTDoaxaLFyEw1vVU7YF36f5Zb9/FTFA== X-Received: by 2002:a17:902:968d:: with SMTP id n13mr29031994plp.109.1548043881581; Sun, 20 Jan 2019 20:11:21 -0800 (PST) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id a90sm19844561pfj.109.2019.01.20.20.11.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Jan 2019 20:11:20 -0800 (PST) From: Enji Cooper Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_63B9C7E5-D8A9-4A9B-BF68-57017DB15103"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343247 - head/usr.bin/cmp/tests Date: Sun, 20 Jan 2019 20:11:20 -0800 In-Reply-To: <6CF2AD75-F267-4E1F-8505-605BB468D5AF@gmail.com> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Mark Johnston References: <201901210357.x0L3vnIx052453@repo.freebsd.org> <6CF2AD75-F267-4E1F-8505-605BB468D5AF@gmail.com> X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: 0AD0D6CC54 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 04:11:23 -0000 --Apple-Mail=_63B9C7E5-D8A9-4A9B-BF68-57017DB15103 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 20, 2019, at 8:10 PM, Enji Cooper = wrote: >=20 >=20 >> On Jan 20, 2019, at 7:57 PM, Mark Johnston wrote: >>=20 >> Author: markj >> Date: Mon Jan 21 03:57:49 2019 >> New Revision: 343247 >> URL: https://svnweb.freebsd.org/changeset/base/343247 >>=20 >> Log: >> Fix cmp(1) tests for "special" mode. >>=20 >> Test failures don't seem to propagate up if atf_check is run in >> a pipeline. Thus, the tests continued to pass despite the bug = reverted >> in r343245. >=20 > Hmmm=E2=80=A6 that=E2=80=99s strange=E2=80=A6 > -Enji There=E2=80=99s a good chance that this issue is also masked by the fact = that the CI runs have been panicking with bug 235097 as well. Cheers, -Enji --Apple-Mail=_63B9C7E5-D8A9-4A9B-BF68-57017DB15103 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEtvtxN6kOllEF3nmX5JFNMZeDGN4FAlxFRmgACgkQ5JFNMZeD GN4GSw//Zq1tEqhXUqlntSxuZ2IRa5Rt2qFCuQwBvpZwhX+9KYQINXYzMT44ih40 x2L9ed0n24Vb/jdwEuMCeOdJIs6l/MiSfg26Fj7zTW0UYqL6k/7NhIEiFM0RTYA1 j5Qucs46h8nXZk79I7GeDNouWdvCaAzWbUoU9BoqJN2cp1tc0n4DpK68icToSNtG JtPKAE+ZCF1nd188dH/znf2EItczXunOkQQyT48H3umoVO2X8mp2kprLw6Gwylkq F3LtmA2VTK8lHxfCRhCmHSZbytudBEiaz9wdd7hAf5MoWAf7NpH6dyQRMejLEq3I VCmsVDiJawkM4karMKgbTH7tfSeOIcPcEkoUtu9rspA41n/X4SglfcTgnhrXKSC5 yjXmaw9M5pzfXZQnU8n9x9Yb0pljwt71y4O85nhJ2suqb6GMkqHWKKhdbxOaSZxU d1rRl4QJCs/1RJXW5YPnv6TE7BSUZnY8QIate+5NxnoRZ0du/M2fidxTmxRnmPUf DBYU3yXIuWoqFEa2sleKYhpIr1OPmO5gL33ghH1bWzAwpPYz9K8ncIc1Rhy/Fs7H IzKLwdPqWe9pRtf764VVCpRa07oYETrWEc6gW1YHyTUC1mt8WTdGnqb7U68kFEum L/dB7UyMYCIzA10L8N+ux0eqG3Y8GlLXa5u/oSQV53iod3cANLM= =ycaO -----END PGP SIGNATURE----- --Apple-Mail=_63B9C7E5-D8A9-4A9B-BF68-57017DB15103-- From owner-svn-src-head@freebsd.org Mon Jan 21 04:13:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E05A4148E66A; Mon, 21 Jan 2019 04:13:02 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x12c.google.com (mail-it1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64E326CEF2; Mon, 21 Jan 2019 04:13:02 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x12c.google.com with SMTP id p197so13486429itp.0; Sun, 20 Jan 2019 20:13:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Dj7BYeyNUbLn+KU27VKJYtSNyFPXbQummQIJ5bA5pgs=; b=czdCTcChMbzfH0hQdoeRUfTKifkfSccBfUYkkOLQ5w0uecg2/xkwQJsn5sMtQuGolZ hs2mE1Vt9Z2ToqxfxgIcFMZqvI4RMfTNn3/ATKoq4yToABj87BtGaV1XKYPwLsQvkH17 Wti0KWphyJ/ZqkuTuh4pCCfRNfYo2E0i0JscZLZZ5Wt+cyNDCiz765SYeeSBPx6sI838 x2h0Xa2VGJPVcfZcU43RKw8aTlmaDSqw3/mk0R1ELkCKGCSmbZcD4pZKlSvarcYwSFXm Q25R5Z7nJINJqhg+1oWYi1H/1w4ORA2VthjHK4Wv9ko10VEu917hFA4WE/DrPpMrwr9+ 34ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=Dj7BYeyNUbLn+KU27VKJYtSNyFPXbQummQIJ5bA5pgs=; b=qVCUMxKslT/nyrGa5puYaJUTyfrcoeOfEWsyVkS9QnCrVByVDU3Et8X23P2wiKl+6M 5B8AWDOshy/iPp7XC9YKqi9IG1MMyPMJ48iKZpYN2grigPqCfKqzqLH+BaM2iGqossuD OylEEKIlWatqVABC6JagKNyt6bliXK1poAFCbofYIdvqBbKXYca79sLCG7evivo0lXmj Qo41BoYypdbxlhvaq09N+xOEq6I+qihYAoI8NECpCYEfctvx+rg0WUtZxa1R7hGAqWYw FfDEggFAuU6kxS1SGRi6p1YP7cVG2HkOk41OmxCIdWe7Ey2+RfVWVKiLe135pYKpIj30 QAHg== X-Gm-Message-State: AJcUukdK+2vwvZXNVkAelB7s6a0T39sdLUkqOWhFMRvAxKWjTEOf+Pj8 PKaKwNuXb8oRWgidjMMsj3sYQISO X-Google-Smtp-Source: ALg8bN77N/WNdIpUBKeuoXgzM8EI/Cx6N0G412ql6zZdLKzXwoYpc4AcbAJhKUbU+8hJ/ceqiMoixw== X-Received: by 2002:a24:7e8c:: with SMTP id h134mr15097785itc.130.1548043981683; Sun, 20 Jan 2019 20:13:01 -0800 (PST) Received: from raichu (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id p198sm5542577itb.30.2019.01.20.20.13.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jan 2019 20:13:01 -0800 (PST) Sender: Mark Johnston Date: Sun, 20 Jan 2019 23:12:59 -0500 From: Mark Johnston To: Enji Cooper Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343247 - head/usr.bin/cmp/tests Message-ID: <20190121041259.GB96979@raichu> References: <201901210357.x0L3vnIx052453@repo.freebsd.org> <6CF2AD75-F267-4E1F-8505-605BB468D5AF@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 64E326CEF2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.989,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 04:13:03 -0000 On Sun, Jan 20, 2019 at 08:11:20PM -0800, Enji Cooper wrote: > > > On Jan 20, 2019, at 8:10 PM, Enji Cooper wrote: > > > > > >> On Jan 20, 2019, at 7:57 PM, Mark Johnston wrote: > >> > >> Author: markj > >> Date: Mon Jan 21 03:57:49 2019 > >> New Revision: 343247 > >> URL: https://svnweb.freebsd.org/changeset/base/343247 > >> > >> Log: > >> Fix cmp(1) tests for "special" mode. > >> > >> Test failures don't seem to propagate up if atf_check is run in > >> a pipeline. Thus, the tests continued to pass despite the bug reverted > >> in r343245. > > > > Hmmm… that’s strange… > > -Enji > > There’s a good chance that this issue is also masked by the fact that the CI runs have been panicking with bug 235097 as well. > Cheers, > -Enji No, I ran the tests locally before committing the now-reverted diff. From owner-svn-src-head@freebsd.org Mon Jan 21 04:50:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9348148EFDA; Mon, 21 Jan 2019 04:50:56 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80A1F6DB45; Mon, 21 Jan 2019 04:50:56 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D6E6CC92; Mon, 21 Jan 2019 04:50:56 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0L4ougf079337; Mon, 21 Jan 2019 04:50:56 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0L4ouKV079336; Mon, 21 Jan 2019 04:50:56 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901210450.x0L4ouKV079336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 21 Jan 2019 04:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343249 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 343249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 80A1F6DB45 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 04:50:57 -0000 Author: avos Date: Mon Jan 21 04:50:56 2019 New Revision: 343249 URL: https://svnweb.freebsd.org/changeset/base/343249 Log: Fix duplicate wpa_supplicant(8) / hostapd(8) startup with devd(8) Do not invoke 'wlan_up' function from devd(8) on interface creation event (an example to create such event: 'ifconfig wlan0 create wlandev rtwn0'); they're typically produced during 'service netif (re)start' and result in duplicate interface initialization. From the user side if WPA option is used, this result in messages like: - /etc/rc.d/wpa_supplicant: WARNING: failed to start wpa_supplicant or - wpa_supplicant already running? (pid=xxxx). (for HOSTAP interfaces this race may result in startup failure). As a side effect, wpa_supplicant(8) / hostapd(8) will not be invoked when new wlan(4) interface is created manually and corresponding configuration for it is present in rc.conf(5). This change does not affect device attach / removal events. MFC after: 5 days Modified: head/sbin/devd/devd.conf Modified: head/sbin/devd/devd.conf ============================================================================== --- head/sbin/devd/devd.conf Mon Jan 21 04:10:45 2019 (r343248) +++ head/sbin/devd/devd.conf Mon Jan 21 04:50:56 2019 (r343249) @@ -43,7 +43,7 @@ options { # notify 0 { match "system" "IFNET"; - match "subsystem" "!usbus[0-9]+"; + match "subsystem" "(?!usbus[0-9]+|?!wlan[0-9]+)"; match "type" "ATTACH"; action "/etc/pccard_ether $subsystem start"; }; From owner-svn-src-head@freebsd.org Mon Jan 21 14:35:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50D3914AB51B; Mon, 21 Jan 2019 14:35:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEDFD8BF8B; Mon, 21 Jan 2019 14:35:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A76A61AF8F; Mon, 21 Jan 2019 14:35:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LEZaZU089228; Mon, 21 Jan 2019 14:35:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LEZaCH089227; Mon, 21 Jan 2019 14:35:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901211435.x0LEZaCH089227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 21 Jan 2019 14:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343255 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 343255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BEDFD8BF8B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 14:35:37 -0000 Author: kevans Date: Mon Jan 21 14:35:36 2019 New Revision: 343255 URL: https://svnweb.freebsd.org/changeset/base/343255 Log: awg: fix soft reset failure with no link U-Boot will leave the ephy reset de-asserted and the MAC soft reset will fail on these boards with internal PHY and no link established. Toggle reset again before proceeding to attach/init. MFC after: 1 week Modified: head/sys/arm/allwinner/if_awg.c Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Mon Jan 21 08:24:49 2019 (r343254) +++ head/sys/arm/allwinner/if_awg.c Mon Jan 21 14:35:36 2019 (r343255) @@ -1466,6 +1466,12 @@ awg_setup_extres(device_t dev) goto fail; } if (rst_ephy != NULL) { + /* + * The ephy reset is left de-asserted by U-Boot. Assert it + * here to make sure that we're in a known good state going + * into the PHY reset. + */ + hwreset_assert(rst_ephy); error = hwreset_deassert(rst_ephy); if (error != 0) { device_printf(dev, "cannot de-assert ephy reset\n"); From owner-svn-src-head@freebsd.org Mon Jan 21 15:27:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C99E114ACAF5; Mon, 21 Jan 2019 15:27:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 694808E00F; Mon, 21 Jan 2019 15:27:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 587021B7F2; Mon, 21 Jan 2019 15:27:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LFRxOi015748; Mon, 21 Jan 2019 15:27:59 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LFRxJb015747; Mon, 21 Jan 2019 15:27:59 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201901211527.x0LFRxJb015747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 21 Jan 2019 15:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343259 - head/usr.bin/units X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/usr.bin/units X-SVN-Commit-Revision: 343259 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 694808E00F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 15:28:00 -0000 Author: gjb Date: Mon Jan 21 15:27:58 2019 New Revision: 343259 URL: https://svnweb.freebsd.org/changeset/base/343259 Log: Correct a typo: was -> way. Submitted by: Larry Hynes MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/units/units.1 Modified: head/usr.bin/units/units.1 ============================================================================== --- head/usr.bin/units/units.1 Mon Jan 21 14:55:10 2019 (r343258) +++ head/usr.bin/units/units.1 Mon Jan 21 15:27:58 2019 (r343259) @@ -158,7 +158,7 @@ by careless unit definitions. Comments in the unit definition file begin with a '#' or '/' character at the beginning of a line. .Pp -Prefixes are defined in the same was as standard units, but with +Prefixes are defined in the same way as standard units, but with a trailing dash at the end of the prefix name. If a unit is not found even after removing trailing 's' or 'es', then it will be checked From owner-svn-src-head@freebsd.org Mon Jan 21 16:19:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CD4714AE168; Mon, 21 Jan 2019 16:19:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 233DF680A8; Mon, 21 Jan 2019 16:19:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10FA01C056; Mon, 21 Jan 2019 16:19:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LGJ2CZ041818; Mon, 21 Jan 2019 16:19:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LGJ2OW041817; Mon, 21 Jan 2019 16:19:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901211619.x0LGJ2OW041817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Jan 2019 16:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343260 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 343260 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 233DF680A8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 16:19:03 -0000 Author: emaste Date: Mon Jan 21 16:19:02 2019 New Revision: 343260 URL: https://svnweb.freebsd.org/changeset/base/343260 Log: linuxulator: fix stack memory disclosure in linux_ioctl_v4l admbugs: 765 Reported by: Vlad Tsyrklevich Reviewed by: andrew MFC after: 1 day Security: Kernel stack memory disclosure Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/linux/linux_ioctl.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Mon Jan 21 15:27:58 2019 (r343259) +++ head/sys/compat/linux/linux_ioctl.c Mon Jan 21 16:19:02 2019 (r343260) @@ -2843,6 +2843,8 @@ linux_to_bsd_v4l_window(struct l_video_window *lvw, st static int bsd_to_linux_v4l_window(struct video_window *vw, struct l_video_window *lvw) { + memset(lvw, 0, sizeof(*lvw)); + lvw->x = vw->x; lvw->y = vw->y; lvw->width = vw->width; From owner-svn-src-head@freebsd.org Mon Jan 21 16:21:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF85914AE33B; Mon, 21 Jan 2019 16:21:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 645D2683F8; Mon, 21 Jan 2019 16:21:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 580781C074; Mon, 21 Jan 2019 16:21:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LGL4fV044197; Mon, 21 Jan 2019 16:21:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LGL4nA044196; Mon, 21 Jan 2019 16:21:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901211621.x0LGL4nA044196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Jan 2019 16:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343261 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 343261 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 645D2683F8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 16:21:04 -0000 Author: emaste Date: Mon Jan 21 16:21:03 2019 New Revision: 343261 URL: https://svnweb.freebsd.org/changeset/base/343261 Log: linuxulator: fix stack memory disclosure in linux_ioctl_termio admbugs: 765 Reported by: Vlad Tsyrklevich Reviewed by: andrew MFC after: 1 day Security: Kernel stack memory disclosure Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/linux/linux_ioctl.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Mon Jan 21 16:19:02 2019 (r343260) +++ head/sys/compat/linux/linux_ioctl.c Mon Jan 21 16:21:03 2019 (r343261) @@ -686,6 +686,7 @@ bsd_to_linux_termio(struct termios *bios, struct linux { struct linux_termios lios; + memset(lio, 0, sizeof(*lio)); bsd_to_linux_termios(bios, &lios); lio->c_iflag = lios.c_iflag; lio->c_oflag = lios.c_oflag; From owner-svn-src-head@freebsd.org Mon Jan 21 16:25:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D22AF14AE41D; Mon, 21 Jan 2019 16:25:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7216369A93; Mon, 21 Jan 2019 16:25:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 229501C1FC; Mon, 21 Jan 2019 16:25:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LGPfaH047018; Mon, 21 Jan 2019 16:25:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LGPfBd047017; Mon, 21 Jan 2019 16:25:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901211625.x0LGPfBd047017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Jan 2019 16:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343262 - head/sys/amd64/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/amd64/linux X-SVN-Commit-Revision: 343262 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7216369A93 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 16:25:42 -0000 Author: emaste Date: Mon Jan 21 16:25:40 2019 New Revision: 343262 URL: https://svnweb.freebsd.org/changeset/base/343262 Log: linuxulator: fix stack memory disclosure in linux_sigaltstack admbugs: 765 Reported by: Vlad Tsyrklevich Reviewed by: andrew MFC after: 1 day Security: Kernel memory disclosure Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/linux/linux_machdep.c Modified: head/sys/amd64/linux/linux_machdep.c ============================================================================== --- head/sys/amd64/linux/linux_machdep.c Mon Jan 21 16:21:03 2019 (r343261) +++ head/sys/amd64/linux/linux_machdep.c Mon Jan 21 16:25:40 2019 (r343262) @@ -201,6 +201,7 @@ linux_sigaltstack(struct thread *td, struct linux_siga l_stack_t lss; int error; + memset(&lss, 0, sizeof(lss)); LINUX_CTR2(sigaltstack, "%p, %p", uap->uss, uap->uoss); if (uap->uss != NULL) { From owner-svn-src-head@freebsd.org Mon Jan 21 17:12:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8950114B05BE; Mon, 21 Jan 2019 17:12:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 314E86C52B; Mon, 21 Jan 2019 17:12:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24DE91CA5E; Mon, 21 Jan 2019 17:12:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LHCH81072653; Mon, 21 Jan 2019 17:12:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LHCHwl072652; Mon, 21 Jan 2019 17:12:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901211712.x0LHCHwl072652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Jan 2019 17:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343263 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 343263 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 314E86C52B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 17:12:17 -0000 Author: emaste Date: Mon Jan 21 17:12:16 2019 New Revision: 343263 URL: https://svnweb.freebsd.org/changeset/base/343263 Log: linuxulator: fix stack memory disclosure in linux_sigaltstack Most siginfo_to_lsiginfo callers already zeroed the l_siginfo_t before callit it, but linux_waitid did not. Instead of zeroing in the called function to address linux_waitid (as in commit 2e6ebe70), just do it in linux_waitid. admbugs: 765 Reported by: Vlad Tsyrklevich Reviewed by: Andrew MFC after: 1 day Security: Kernel stack memory disclosure Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Mon Jan 21 16:25:40 2019 (r343262) +++ head/sys/compat/linux/linux_misc.c Mon Jan 21 17:12:16 2019 (r343263) @@ -1089,9 +1089,8 @@ linux_waitid(struct thread *td, struct linux_waitid_ar } if (args->info != NULL) { p = td->td_proc; - if (td->td_retval[0] == 0) - bzero(&lsi, sizeof(lsi)); - else { + bzero(&lsi, sizeof(lsi)); + if (td->td_retval[0] != 0) { sig = bsd_to_linux_signal(siginfo.si_signo); siginfo_to_lsiginfo(&siginfo, &lsi, sig); } From owner-svn-src-head@freebsd.org Mon Jan 21 17:21:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F05C014B0861; Mon, 21 Jan 2019 17:21:08 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f180.google.com (mail-it1-f180.google.com [209.85.166.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 955D06CC55; Mon, 21 Jan 2019 17:21:08 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f180.google.com with SMTP id g85so17414516ita.3; Mon, 21 Jan 2019 09:21:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=XHYUH0JjfzDSy0ndi9KGnooiUSfSejsBa+Cumd7t5UY=; b=YP4u6G5956/o65TuBaE0PgEFbkj++aPzQotcKseq4gy3b7Hr8h0XPQ5qgQ0lQM5Q8q uRhQPJb/RpUqedUZH4qkI6z+VykTVLIU8Patv412llLqqiSaWfwHnaBWqAedK2lD0sr6 pL3sPgwy48Zn3gdjTdbzygk+wf0K+5fwewRY7LCvqFbcXGoSLa68jEbkMbBaIV3YCspO if3vN7ORFnq6dH70A4RL+0zhvmR7QQUgLdUYEp+npxjwtUvUDotEvDyfsPlAbo0eQ7MG H9joLrELSWHTJW6Tm7J7+BqZcy1WZ0jP/Xklsnc7vcuRrSpVMmzK1HEQ2y+50gY6XR4X BOgQ== X-Gm-Message-State: AHQUAubDmHb+ewI0bORcQEwyVur0NVIOASv1r+0ZAY5MBu2CZaBKBVOr crzSNHs6mQslv4oJ8sH/Ypi/giRaYv2r85fjirvVI3j8 X-Google-Smtp-Source: ALg8bN7bD/icILYkgTt9Plf+GFhQJBv1zMWvCQgCN+yccNbmQRf/+d7fFAH3rAFQQsr3cwrthFW5XBeC+2oGpQEo6Bg= X-Received: by 2002:a05:660c:84e:: with SMTP id f14mr167179itl.33.1548090927484; Mon, 21 Jan 2019 09:15:27 -0800 (PST) MIME-Version: 1.0 References: <201901211712.x0LHCHwl072652@repo.freebsd.org> In-Reply-To: <201901211712.x0LHCHwl072652@repo.freebsd.org> From: Ed Maste Date: Mon, 21 Jan 2019 12:15:13 -0500 Message-ID: Subject: Re: svn commit: r343263 - head/sys/compat/linux To: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 955D06CC55 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 17:21:09 -0000 On Mon, 21 Jan 2019 at 12:12, Ed Maste wrote: > > Author: emaste > Date: Mon Jan 21 17:12:16 2019 > New Revision: 343263 > URL: https://svnweb.freebsd.org/changeset/base/343263 > > Log: > linuxulator: fix stack memory disclosure in linux_sigaltstack > > Most siginfo_to_lsiginfo callers already zeroed the l_siginfo_t before > callit it, but linux_waitid did not. Instead of zeroing in the called > function to address linux_waitid (as in commit 2e6ebe70), just do it in > linux_waitid. Oops, I meant to edit the commit message to remove the git hash (from my WIP tree). My original change for this issue zeroed the struct in siginfo_to_lsiginfo. From owner-svn-src-head@freebsd.org Mon Jan 21 17:58:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B10D614B16CC; Mon, 21 Jan 2019 17:58:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56E666E0E0; Mon, 21 Jan 2019 17:58:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 453D41D143; Mon, 21 Jan 2019 17:58:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LHw7Qb093590; Mon, 21 Jan 2019 17:58:07 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LHw7aS093589; Mon, 21 Jan 2019 17:58:07 GMT (envelope-from np@FreeBSD.org) Message-Id: <201901211758.x0LHw7aS093589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 21 Jan 2019 17:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343264 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 343264 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 56E666E0E0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 17:58:07 -0000 Author: np Date: Mon Jan 21 17:58:06 2019 New Revision: 343264 URL: https://svnweb.freebsd.org/changeset/base/343264 Log: cxgbe(4): Use a truncated firmware header for version checks. All the version numbers are towards the begining of the header. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jan 21 17:12:16 2019 (r343263) +++ head/sys/dev/cxgbe/t4_main.c Mon Jan 21 17:58:06 2019 (r343264) @@ -3324,17 +3324,38 @@ restart: V_FW_HDR_FW_VER_BUILD(chip##FW_VERSION_BUILD)) #define FW_INTFVER(chip, intf) (chip##FW_HDR_INTFVER_##intf) +/* Just enough of fw_hdr to cover all version info. */ +struct fw_h { + __u8 ver; + __u8 chip; + __be16 len512; + __be32 fw_ver; + __be32 tp_microcode_ver; + __u8 intfver_nic; + __u8 intfver_vnic; + __u8 intfver_ofld; + __u8 intfver_ri; + __u8 intfver_iscsipdu; + __u8 intfver_iscsi; + __u8 intfver_fcoepdu; + __u8 intfver_fcoe; +}; +/* Spot check a couple of fields. */ +CTASSERT(offsetof(struct fw_h, fw_ver) == offsetof(struct fw_hdr, fw_ver)); +CTASSERT(offsetof(struct fw_h, intfver_nic) == offsetof(struct fw_hdr, intfver_nic)); +CTASSERT(offsetof(struct fw_h, intfver_fcoe) == offsetof(struct fw_hdr, intfver_fcoe)); + struct fw_info { uint8_t chip; char *kld_name; char *fw_mod_name; - struct fw_hdr fw_hdr; /* XXX: waste of space, need a sparse struct */ + struct fw_h fw_h; } fw_info[] = { { .chip = CHELSIO_T4, .kld_name = "t4fw_cfg", .fw_mod_name = "t4fw", - .fw_hdr = { + .fw_h = { .chip = FW_HDR_CHIP_T4, .fw_ver = htobe32(FW_VERSION(T4)), .intfver_nic = FW_INTFVER(T4, NIC), @@ -3350,7 +3371,7 @@ struct fw_info { .chip = CHELSIO_T5, .kld_name = "t5fw_cfg", .fw_mod_name = "t5fw", - .fw_hdr = { + .fw_h = { .chip = FW_HDR_CHIP_T5, .fw_ver = htobe32(FW_VERSION(T5)), .intfver_nic = FW_INTFVER(T5, NIC), @@ -3366,7 +3387,7 @@ struct fw_info { .chip = CHELSIO_T6, .kld_name = "t6fw_cfg", .fw_mod_name = "t6fw", - .fw_hdr = { + .fw_h = { .chip = FW_HDR_CHIP_T6, .fw_ver = htobe32(FW_VERSION(T6)), .intfver_nic = FW_INTFVER(T6, NIC), @@ -3398,7 +3419,7 @@ find_fw_info(int chip) * with? */ static int -fw_compatible(const struct fw_hdr *hdr1, const struct fw_hdr *hdr2) +fw_compatible(const struct fw_h *hdr1, const struct fw_h *hdr2) { /* short circuit if it's the exact same firmware version */ @@ -3465,8 +3486,8 @@ unload_fw_module(struct adapter *sc, const struct firm * +ve errno means a firmware install was attempted but failed. */ static int -install_kld_firmware(struct adapter *sc, struct fw_hdr *card_fw, - const struct fw_hdr *drv_fw, const char *reason, int *already) +install_kld_firmware(struct adapter *sc, struct fw_h *card_fw, + const struct fw_h *drv_fw, const char *reason, int *already) { const struct firmware *cfg, *fw; const uint32_t c = be32toh(card_fw->fw_ver); @@ -3571,7 +3592,7 @@ contact_firmware(struct adapter *sc) enum dev_state state; struct fw_info *fw_info; struct fw_hdr *card_fw; /* fw on the card */ - const struct fw_hdr *drv_fw; /* fw bundled with the driver */ + const struct fw_h *drv_fw; fw_info = find_fw_info(chip_id(sc)); if (fw_info == NULL) { @@ -3580,7 +3601,7 @@ contact_firmware(struct adapter *sc) chip_id(sc)); return (EINVAL); } - drv_fw = &fw_info->fw_hdr; + drv_fw = &fw_info->fw_h; /* Read the header of the firmware on the card */ card_fw = malloc(sizeof(*card_fw), M_CXGBE, M_ZERO | M_WAITOK); @@ -3593,7 +3614,8 @@ restart: goto done; } - rc = install_kld_firmware(sc, card_fw, drv_fw, NULL, &already); + rc = install_kld_firmware(sc, (struct fw_h *)card_fw, drv_fw, NULL, + &already); if (rc == ERESTART) goto restart; if (rc != 0) @@ -3606,7 +3628,7 @@ restart: "failed to connect to the firmware: %d, %d. " "PCIE_FW 0x%08x\n", rc, state, t4_read_reg(sc, A_PCIE_FW)); #if 0 - if (install_kld_firmware(sc, card_fw, drv_fw, + if (install_kld_firmware(sc, (struct fw_h *)card_fw, drv_fw, "not responding properly to HELLO", &already) == ERESTART) goto restart; #endif @@ -3617,7 +3639,8 @@ restart: if (rc == sc->pf) { sc->flags |= MASTER_PF; - rc = install_kld_firmware(sc, card_fw, drv_fw, NULL, &already); + rc = install_kld_firmware(sc, (struct fw_h *)card_fw, drv_fw, + NULL, &already); if (rc == ERESTART) rc = 0; else if (rc != 0) From owner-svn-src-head@freebsd.org Mon Jan 21 18:07:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38AED14B1D3D; Mon, 21 Jan 2019 18:07:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D475C6E9DE; Mon, 21 Jan 2019 18:07:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C474E1D2EB; Mon, 21 Jan 2019 18:07:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LI721g098831; Mon, 21 Jan 2019 18:07:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LI722p098830; Mon, 21 Jan 2019 18:07:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901211807.x0LI722p098830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Jan 2019 18:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343265 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 343265 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D475C6E9DE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 18:07:03 -0000 Author: markj Date: Mon Jan 21 18:07:02 2019 New Revision: 343265 URL: https://svnweb.freebsd.org/changeset/base/343265 Log: hwpmc: Plug memory disclosures from PMC_OP_{GETPMCINFO,GETCPUINFO}. admbugs: 765 Reported by: Vlad Tsyrklevich MFC after: 1 day Security: Kernel memory disclosure Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Mon Jan 21 17:58:06 2019 (r343264) +++ head/sys/dev/hwpmc/hwpmc_mod.c Mon Jan 21 18:07:02 2019 (r343265) @@ -3512,6 +3512,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_a struct pmc_classdep *pcd; int cl; + memset(&gci, 0, sizeof(gci)); gci.pm_cputype = md->pmd_cputype; gci.pm_ncpu = pmc_cpu_max(); gci.pm_npmc = md->pmd_npmc; @@ -3661,7 +3662,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_a npmc = md->pmd_npmc; pmcinfo_size = npmc * sizeof(struct pmc_info); - pmcinfo = malloc(pmcinfo_size, M_PMC, M_WAITOK); + pmcinfo = malloc(pmcinfo_size, M_PMC, M_WAITOK | M_ZERO); p = pmcinfo; From owner-svn-src-head@freebsd.org Mon Jan 21 18:41:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFBC314B309C; Mon, 21 Jan 2019 18:41:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 866AD70995; Mon, 21 Jan 2019 18:41:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AD961D96F; Mon, 21 Jan 2019 18:41:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LIfveg020292; Mon, 21 Jan 2019 18:41:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LIfvjM020291; Mon, 21 Jan 2019 18:41:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901211841.x0LIfvjM020291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Jan 2019 18:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343268 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 866AD70995 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 18:41:58 -0000 Author: emaste Date: Mon Jan 21 18:41:57 2019 New Revision: 343268 URL: https://svnweb.freebsd.org/changeset/base/343268 Log: frebsd-update: fix --currently-running after r343122 PR: 234771 Submitted by: Gerald Aryeetey Reported by: Brandon Schneider MFC with: r343122 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18896 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Mon Jan 21 18:35:39 2019 (r343267) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Mon Jan 21 18:41:57 2019 (r343268) @@ -310,6 +310,7 @@ config_SourceRelease () { if echo ${UNAME_r} | grep -qE '^[0-9.]+$'; then UNAME_r="${UNAME_r}-RELEASE" fi + export UNAME_r } # Define what happens to output of utilities From owner-svn-src-head@freebsd.org Mon Jan 21 18:42:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77DD314B30D2; Mon, 21 Jan 2019 18:42:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FA0370C0C; Mon, 21 Jan 2019 18:42:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB7D01D98A; Mon, 21 Jan 2019 18:42:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LIgG8h020362; Mon, 21 Jan 2019 18:42:16 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LIgGVB020361; Mon, 21 Jan 2019 18:42:16 GMT (envelope-from np@FreeBSD.org) Message-Id: <201901211842.x0LIgGVB020361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 21 Jan 2019 18:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343269 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 343269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1FA0370C0C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 18:42:17 -0000 Author: np Date: Mon Jan 21 18:42:16 2019 New Revision: 343269 URL: https://svnweb.freebsd.org/changeset/base/343269 Log: cxgbe(4): Allow negative values in hw.cxgbe.fw_install and take them to mean that the driver should taste the firmware in the KLD and use that firmware's version for all its fw_install checks. The driver gets firmware version information from compiled-in values by default and this change allows custom (or older/newer) firmware modules to be used with the stock driver. There is no change in default behavior. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jan 21 18:41:57 2019 (r343268) +++ head/sys/dev/cxgbe/t4_main.c Mon Jan 21 18:42:16 2019 (r343269) @@ -480,9 +480,10 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, autoneg, CTLFLAG_RDTUN /* * Firmware auto-install by driver during attach (0, 1, 2 = prohibited, allowed, - * encouraged respectively). + * encouraged respectively). '-n' is the same as 'n' except the firmware + * version used in the checks is read from the firmware bundled with the driver. */ -static unsigned int t4_fw_install = 1; +static int t4_fw_install = 1; SYSCTL_INT(_hw_cxgbe, OID_AUTO, fw_install, CTLFLAG_RDTUN, &t4_fw_install, 0, "Firmware auto-install (0 = prohibited, 1 = allowed, 2 = encouraged)"); @@ -3491,10 +3492,15 @@ install_kld_firmware(struct adapter *sc, struct fw_h * { const struct firmware *cfg, *fw; const uint32_t c = be32toh(card_fw->fw_ver); - const uint32_t d = be32toh(drv_fw->fw_ver); - uint32_t k; - int rc; + uint32_t d, k; + int rc, fw_install; + struct fw_h bundled_fw; + bool load_attempted; + cfg = fw = NULL; + load_attempted = false; + fw_install = t4_fw_install < 0 ? -t4_fw_install : t4_fw_install; + if (reason != NULL) goto install; @@ -3508,7 +3514,23 @@ install_kld_firmware(struct adapter *sc, struct fw_h * return (0); } - if (!fw_compatible(card_fw, drv_fw)) { + memcpy(&bundled_fw, drv_fw, sizeof(bundled_fw)); + if (t4_fw_install < 0) { + rc = load_fw_module(sc, &cfg, &fw); + if (rc != 0 || fw == NULL) { + device_printf(sc->dev, + "failed to load firmware module: %d. cfg %p, fw %p;" + " will use compiled-in firmware version for" + "hw.cxgbe.fw_install checks.\n", + rc, cfg, fw); + } else { + memcpy(&bundled_fw, fw->data, sizeof(bundled_fw)); + } + load_attempted = true; + } + d = be32toh(bundled_fw.fw_ver); + + if (!fw_compatible(card_fw, &bundled_fw)) { reason = "incompatible or unusable"; goto install; } @@ -3518,52 +3540,72 @@ install_kld_firmware(struct adapter *sc, struct fw_h * goto install; } - if (t4_fw_install == 2 && d != c) { + if (fw_install == 2 && d != c) { reason = "different than the version bundled with this driver"; goto install; } - return (0); + /* No reason to do anything to the firmware already on the card. */ + rc = 0; + goto done; install: + rc = 0; if ((*already)++) - return (0); + goto done; - if (t4_fw_install == 0) { + if (fw_install == 0) { device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, " "but the driver is prohibited from installing a firmware " "on the card.\n", G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason); - return (0); + goto done; } - device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, " - "installing firmware %u.%u.%u.%u on card.\n", - G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), - G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason, - G_FW_HDR_FW_VER_MAJOR(d), G_FW_HDR_FW_VER_MINOR(d), - G_FW_HDR_FW_VER_MICRO(d), G_FW_HDR_FW_VER_BUILD(d)); - - rc = load_fw_module(sc, &cfg, &fw); - if (rc != 0 || fw == NULL) { - device_printf(sc->dev, - "failed to load firmware module: %d. cfg %p, fw %p\n", rc, - cfg, fw); + /* + * We'll attempt to install a firmware. Load the module first (if it + * hasn't been loaded already). + */ + if (!load_attempted) { + rc = load_fw_module(sc, &cfg, &fw); + if (rc != 0 || fw == NULL) { + device_printf(sc->dev, + "failed to load firmware module: %d. cfg %p, fw %p\n", + rc, cfg, fw); + /* carry on */ + } + } + if (fw == NULL) { + device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, " + "but the driver cannot take corrective action because it " + "is unable to load the firmware module.\n", + G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), + G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason); rc = sc->flags & FW_OK ? 0 : ENOENT; goto done; } k = be32toh(((const struct fw_hdr *)fw->data)->fw_ver); if (k != d) { + MPASS(t4_fw_install > 0); device_printf(sc->dev, "firmware in KLD (%u.%u.%u.%u) is not what the driver was " - "compiled with and will not be used.\n", + "expecting (%u.%u.%u.%u) and will not be used.\n", G_FW_HDR_FW_VER_MAJOR(k), G_FW_HDR_FW_VER_MINOR(k), - G_FW_HDR_FW_VER_MICRO(k), G_FW_HDR_FW_VER_BUILD(k)); + G_FW_HDR_FW_VER_MICRO(k), G_FW_HDR_FW_VER_BUILD(k), + G_FW_HDR_FW_VER_MAJOR(d), G_FW_HDR_FW_VER_MINOR(d), + G_FW_HDR_FW_VER_MICRO(d), G_FW_HDR_FW_VER_BUILD(d)); rc = sc->flags & FW_OK ? 0 : EINVAL; goto done; } + + device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, " + "installing firmware %u.%u.%u.%u on card.\n", + G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), + G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason, + G_FW_HDR_FW_VER_MAJOR(d), G_FW_HDR_FW_VER_MINOR(d), + G_FW_HDR_FW_VER_MICRO(d), G_FW_HDR_FW_VER_BUILD(d)); rc = -t4_fw_upgrade(sc, sc->mbox, fw->data, fw->datasize, 0); if (rc != 0) { From owner-svn-src-head@freebsd.org Mon Jan 21 19:02:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B754414B3E0D; Mon, 21 Jan 2019 19:02:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 18E5072172; Mon, 21 Jan 2019 19:02:28 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id leq0gAn158uQmleq1gaK7v; Mon, 21 Jan 2019 12:02:26 -0700 X-Authority-Analysis: v=2.3 cv=XKpOtjpE c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=IkcTkHD0fZMA:10 a=3JhidrIBZZsA:10 a=6I5d2MoRAAAA:8 a=hinadew-AAAA:8 a=YxBL1-UpAAAA:8 a=x7BMxHKl1PyEs5WXwGYA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 a=LikKuh5RR83Sn2yGlEXi:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from android-68f84e02b5988183.esitwifi.local (S0106788a207e2972.gv.shawcable.net [70.66.154.233]) by spqr.komquats.com (Postfix) with ESMTPSA id 49214D9A; Mon, 21 Jan 2019 11:02:50 -0800 (PST) Date: Mon, 21 Jan 2019 09:27:46 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <201901211625.x0LGPfBd047017@repo.freebsd.org> References: <201901211625.x0LGPfBd047017@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r343262 - head/sys/amd64/linux To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: X-CMAE-Envelope: MS4wfJfVXiNw0WZoLheo4CU7ZhoI2SyJA9fzUaU5KRuyXAQEyuq1G7g7i20sT6zIh1lRAob/O/6Cc0JcjMGHKHLIYdKVwU2pyPSxe5j4Q0VmbcR4MI/hg1Il hYBc91sQuzFW6BZ6hjlzKk5ksLIul1bzCW5TLpWLfEtlWKxBlmPYcBQNS2OmC0j2zlqgfblJEIeUsZAC8x1xxJ/yTmyXdqoZOsq+mxLynl495G+co+6dMOxV elsI5QzMM9vX03KH7roiKoQ/VXmlcrjaXXfiUsxJw7fO4p3YZcK56IeTpFVVg7nO X-Rspamd-Queue-Id: 18E5072172 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-1.00)[-0.996,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 19:02:29 -0000 On January 21, 2019 8:25:41 AM PST, Ed Maste wrote: >Author: emaste >Date: Mon Jan 21 16:25:40 2019 >New Revision: 343262 >URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/343262 > >Log: > linuxulator: fix stack memory disclosure in linux_sigaltstack > =20 > admbugs: 765 > Reported by: Vlad Tsyrklevich > Reviewed by: andrew > MFC after: 1 day > Security: Kernel memory disclosure > Sponsored by: The FreeBSD Foundation > >Modified: > head/sys/amd64/linux/linux_machdep=2Ec > >Modified: head/sys/amd64/linux/linux_machdep=2Ec >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >--- head/sys/amd64/linux/linux_machdep=2Ec Mon Jan 21 16:21:03 >2019 (r343261) >+++ head/sys/amd64/linux/linux_machdep=2Ec Mon Jan 21 16:25:40 >2019 (r343262) >@@ -201,6 +201,7 @@ linux_sigaltstack(struct thread *td, struct >linux_siga > l_stack_t lss; > int error; >=20 >+ memset(&lss, 0, sizeof(lss)); > LINUX_CTR2(sigaltstack, "%p, %p", uap->uss, uap->uoss); >=20 > if (uap->uss !=3D NULL) { Do we have a CVE for this? --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-head@freebsd.org Mon Jan 21 19:04:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E72414B3F64; Mon, 21 Jan 2019 19:04:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 233DD72508; Mon, 21 Jan 2019 19:04:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 109071DD12; Mon, 21 Jan 2019 19:04:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LJ4bLV031198; Mon, 21 Jan 2019 19:04:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LJ4b2g031197; Mon, 21 Jan 2019 19:04:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901211904.x0LJ4b2g031197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Jan 2019 19:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343270 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 233DD72508 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 19:04:38 -0000 Author: emaste Date: Mon Jan 21 19:04:37 2019 New Revision: 343270 URL: https://svnweb.freebsd.org/changeset/base/343270 Log: freebsd-update: Update /etc/passwd after password db changes Add -p to pwd_mkdb in order to ensure password db changes are also included in /etc/passwd. PR: 165954, 232921, 229487 Submitted by: Gerald Aryeetey Reviewed by: jilles MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18827 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Mon Jan 21 18:42:16 2019 (r343269) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Mon Jan 21 19:04:37 2019 (r343270) @@ -2918,10 +2918,11 @@ Kernel updates have been installed. Please reboot and install_from_index INDEX-NEW || return 1 install_delete INDEX-OLD INDEX-NEW || return 1 - # Rebuild /etc/spwd.db and /etc/pwd.db if necessary. + # Rebuild generated pwd files. if [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/spwd.db ] || - [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/pwd.db ]; then - pwd_mkdb -d ${BASEDIR}/etc ${BASEDIR}/etc/master.passwd + [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/pwd.db ] || + [ ${BASEDIR}/etc/master.passwd -nt ${BASEDIR}/etc/passwd ]; then + pwd_mkdb -d ${BASEDIR}/etc -p ${BASEDIR}/etc/master.passwd fi # Rebuild /etc/login.conf.db if necessary. From owner-svn-src-head@freebsd.org Mon Jan 21 19:21:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F036914B49BA; Mon, 21 Jan 2019 19:21:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D82373277; Mon, 21 Jan 2019 19:21:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 814A91DFF7; Mon, 21 Jan 2019 19:21:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LJLBUO038336; Mon, 21 Jan 2019 19:21:11 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LJLB14038335; Mon, 21 Jan 2019 19:21:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901211921.x0LJLB14038335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 21 Jan 2019 19:21:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343271 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343271 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8D82373277 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 19:21:12 -0000 Author: emaste Date: Mon Jan 21 19:21:11 2019 New Revision: 343271 URL: https://svnweb.freebsd.org/changeset/base/343271 Log: freebsd-update: Allow upgrade from pre-release builds Update r343122 to include -ALPHA, -BETA and -RC releases as upgrade-able via freebsd-update. PR: 234771 Submitted by: Gerald Aryeetey Reported by: delphij, des Reviewed by: delphij MFC with: r343122 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18881 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Mon Jan 21 19:04:37 2019 (r343270) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Mon Jan 21 19:21:11 2019 (r343271) @@ -668,17 +668,23 @@ fetchupgrade_check_params () { FETCHDIR=${RELNUM}/${ARCH} PATCHDIR=${RELNUM}/${ARCH}/bp - # Disallow upgrade from a version that is not `-RELEASE` - if ! echo "${RELNUM}" | grep -qE -- "-RELEASE$"; then - echo -n "`basename $0`: " - cat <<- EOF - Cannot upgrade from a version that is not a '-RELEASE' using `basename $0`. - Instead, FreeBSD can be directly upgraded by source or upgraded to a - RELEASE/RELENG version prior to running `basename $0`. - EOF - echo "System version: ${RELNUM}" - exit 1 - fi + # Disallow upgrade from a version that is not a release + case ${RELNUM} in + *-RELEASE | *-ALPHA* | *-BETA* | *-RC*) + ;; + *) + echo -n "`basename $0`: " + cat <<- EOF + Cannot upgrade from a version that is not a release + (including alpha, beta and release candidates) + using `basename $0`. Instead, FreeBSD can be directly + upgraded by source or upgraded to a RELEASE/RELENG version + prior to running `basename $0`. + Currently running: ${RELNUM} + EOF + exit 1 + ;; + esac # Figure out what directory contains the running kernel BOOTFILE=`sysctl -n kern.bootfile` From owner-svn-src-head@freebsd.org Mon Jan 21 19:37:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 576A714B561F; Mon, 21 Jan 2019 19:37:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0D42749F1; Mon, 21 Jan 2019 19:37:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C68C31E221; Mon, 21 Jan 2019 19:37:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LJbCMD047061; Mon, 21 Jan 2019 19:37:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LJbCLa047060; Mon, 21 Jan 2019 19:37:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901211937.x0LJbCLa047060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Jan 2019 19:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343274 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 343274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F0D42749F1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 19:37:13 -0000 Author: markj Date: Mon Jan 21 19:37:12 2019 New Revision: 343274 URL: https://svnweb.freebsd.org/changeset/base/343274 Log: Deduplicate common code in copyin()/copyout() with a macro. No functional change intended. Submitted by: Mitchell Horne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18850 Modified: head/sys/riscv/riscv/copyinout.S Modified: head/sys/riscv/riscv/copyinout.S ============================================================================== --- head/sys/riscv/riscv/copyinout.S Mon Jan 21 19:33:05 2019 (r343273) +++ head/sys/riscv/riscv/copyinout.S Mon Jan 21 19:37:12 2019 (r343274) @@ -52,60 +52,61 @@ copyio_fault_nopcb: END(copyio_fault) /* - * Copies from a kernel to user address + * copycommon - common copy routine * - * int copyout(const void *kaddr, void *udaddr, size_t len) + * a0 - Source address + * a1 - Destination address + * a2 - Size of copy */ -ENTRY(copyout) - beqz a2, 2f /* If len == 0 then skip loop */ - add a3, a1, a2 - li a4, VM_MAXUSER_ADDRESS - bgt a3, a4, copyio_fault_nopcb - + .macro copycommon la a6, copyio_fault /* Get the handler address */ SET_FAULT_HANDLER(a6, a7) /* Set the handler */ ENTER_USER_ACCESS(a7) -1: lb a4, 0(a0) /* Load from kaddr */ +1: lb a4, 0(a0) /* Load from src */ addi a0, a0, 1 - sb a4, 0(a1) /* Store in uaddr */ + sb a4, 0(a1) /* Store in dest */ addi a1, a1, 1 addi a2, a2, -1 /* len-- */ bnez a2, 1b EXIT_USER_ACCESS(a7) SET_FAULT_HANDLER(x0, a7) /* Clear the handler */ + .endm -2: li a0, 0 /* return 0 */ +/* + * Copies from a kernel to user address + * + * int copyout(const void *kaddr, void *udaddr, size_t len) + */ +ENTRY(copyout) + beqz a2, copyout_end /* If len == 0 then skip loop */ + add a3, a1, a2 + li a4, VM_MAXUSER_ADDRESS + bgt a3, a4, copyio_fault_nopcb + + copycommon + +copyout_end: + li a0, 0 /* return 0 */ ret END(copyout) /* * Copies from a user to kernel address * - * int copyin(const void *uaddr, void *kdaddr, size_t len) + * int copyin(const void *uaddr, void *kaddr, size_t len) */ ENTRY(copyin) - beqz a2, 2f /* If len == 0 then skip loop */ + beqz a2, copyin_end /* If len == 0 then skip loop */ add a3, a0, a2 li a4, VM_MAXUSER_ADDRESS bgt a3, a4, copyio_fault_nopcb - la a6, copyio_fault /* Get the handler address */ - SET_FAULT_HANDLER(a6, a7) /* Set the handler */ - ENTER_USER_ACCESS(a7) + copycommon -1: lb a4, 0(a0) /* Load from uaddr */ - addi a0, a0, 1 - sb a4, 0(a1) /* Store in kaddr */ - addi a1, a1, 1 - addi a2, a2, -1 /* len-- */ - bnez a2, 1b - - EXIT_USER_ACCESS(a7) - SET_FAULT_HANDLER(x0, a7) /* Clear the handler */ - -2: li a0, 0 /* return 0 */ +copyin_end: + li a0, 0 /* return 0 */ ret END(copyin) From owner-svn-src-head@freebsd.org Mon Jan 21 19:38:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA24A14B572E; Mon, 21 Jan 2019 19:38:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51A2674BCE; Mon, 21 Jan 2019 19:38:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4702D1E223; Mon, 21 Jan 2019 19:38:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LJcsPe047181; Mon, 21 Jan 2019 19:38:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LJcrXg047179; Mon, 21 Jan 2019 19:38:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901211938.x0LJcrXg047179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Jan 2019 19:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343275 - in head/sys/riscv: include riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/riscv: include riscv X-SVN-Commit-Revision: 343275 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 51A2674BCE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 19:38:54 -0000 Author: markj Date: Mon Jan 21 19:38:53 2019 New Revision: 343275 URL: https://svnweb.freebsd.org/changeset/base/343275 Log: Optimize RISC-V copyin(9)/copyout(9) routines. The existing copyin(9) and copyout(9) routines on RISC-V perform only a simple byte-by-byte copy. Improve their performance by performing word-sized copies where possible. Submitted by: Mitchell Horne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18851 Modified: head/sys/riscv/include/riscvreg.h head/sys/riscv/riscv/copyinout.S Modified: head/sys/riscv/include/riscvreg.h ============================================================================== --- head/sys/riscv/include/riscvreg.h Mon Jan 21 19:37:12 2019 (r343274) +++ head/sys/riscv/include/riscvreg.h Mon Jan 21 19:38:53 2019 (r343275) @@ -155,7 +155,8 @@ #define SATP_MODE_SV39 (8ULL << SATP_MODE_S) #define SATP_MODE_SV48 (9ULL << SATP_MODE_S) -#define XLEN 8 +#define XLEN __riscv_xlen +#define XLEN_BYTES (XLEN / 8) #define INSN_SIZE 4 #define INSN_C_SIZE 2 Modified: head/sys/riscv/riscv/copyinout.S ============================================================================== --- head/sys/riscv/riscv/copyinout.S Mon Jan 21 19:37:12 2019 (r343274) +++ head/sys/riscv/riscv/copyinout.S Mon Jan 21 19:38:53 2019 (r343275) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2015-2018 Ruslan Bukin + * Copyright (c) 2019 Mitchell Horne * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -59,19 +60,52 @@ END(copyio_fault) * a2 - Size of copy */ .macro copycommon - la a6, copyio_fault /* Get the handler address */ - SET_FAULT_HANDLER(a6, a7) /* Set the handler */ + la a6, copyio_fault /* Get the handler address */ + SET_FAULT_HANDLER(a6, a7) /* Set the handler */ ENTER_USER_ACCESS(a7) -1: lb a4, 0(a0) /* Load from src */ + li t2, XLEN_BYTES + blt a2, t2, 3f /* Byte-copy if len < XLEN_BYTES */ + + /* + * Compare lower bits of src and dest. + * If they are aligned with each other, we can do word copy. + */ + andi t0, a0, (XLEN_BYTES-1) /* Low bits of src */ + andi t1, a1, (XLEN_BYTES-1) /* Low bits of dest */ + bne t0, t1, 3f /* Misaligned. Go to byte copy */ + beqz t0, 2f /* Already word-aligned, skip ahead */ + + /* Byte copy until the first word-aligned address */ +1: lb a4, 0(a0) /* Load byte from src */ addi a0, a0, 1 - sb a4, 0(a1) /* Store in dest */ + sb a4, 0(a1) /* Store byte in dest */ addi a1, a1, 1 - addi a2, a2, -1 /* len-- */ - bnez a2, 1b + addi a2, a2, -1 /* len-- */ + andi t0, a0, (XLEN_BYTES-1) + bnez t0, 1b - EXIT_USER_ACCESS(a7) - SET_FAULT_HANDLER(x0, a7) /* Clear the handler */ + /* Copy words */ +2: ld a4, 0(a0) /* Load word from src */ + addi a0, a0, XLEN_BYTES + sd a4, 0(a1) /* Store word in dest */ + addi a1, a1, XLEN_BYTES + addi a2, a2, -XLEN_BYTES /* len -= XLEN_BYTES */ + bgeu a2, t2, 2b /* Again if len >= XLEN_BYTES */ + + /* Check if we're finished */ + beqz a2, 4f + + /* Copy any remaining bytes */ +3: lb a4, 0(a0) /* Load byte from src */ + addi a0, a0, 1 + sb a4, 0(a1) /* Store byte in dest */ + addi a1, a1, 1 + addi a2, a2, -1 /* len-- */ + bnez a2, 3b + +4: EXIT_USER_ACCESS(a7) + SET_FAULT_HANDLER(x0, a7) /* Clear the handler */ .endm /* From owner-svn-src-head@freebsd.org Mon Jan 21 20:35:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 296C214B74BD; Mon, 21 Jan 2019 20:35:19 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD0E8807CE; Mon, 21 Jan 2019 20:35:18 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id D8B1227000ED; Mon, 21 Jan 2019 15:35:11 -0500 (EST) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu D8B1227000ED DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1548102912; bh=xKF5dTojImrFHnXYW/BbxG5ttGdpoKbOduSLtkCq9gc=; h=Subject:To:From:Date:From; b=rSGwdzYnugmWYS7+KdVKNJst76gERomUzD1fh3hC3drVJMmHj9oXRrFwkr1OS8tYm Hx9Cu7D1ZFnY1/tROLP+tSSxZpvOWUNYlCoYfvhmsHl5d6IO8gYICIeZhYWvLF8E4u nEVH2J2qgfSbwFxkRg2jmLIikNraVkNUjuBPYw0bEfl54bOL3RSARfrvRCkQu/DmMV Mi+2Kn3hZkNvEhpT9dyiEFRBoZEFF1o4gZ4IJQagB2rrgIIaJ3L5zbsllWqjCy0brP 9Aa+lx5v6iS57IuD4QffgETIAJyruLFig0u25Bbtt4ElkbPWopVdWyu5D/3xnolMeP sxB5BDOqtMk8w== Subject: Re: svn commit: r343269 - head/sys/dev/cxgbe To: Navdeep Parhar , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901211842.x0LIgGVB020361@repo.freebsd.org> From: Andrew Gallatin Message-ID: Date: Mon, 21 Jan 2019 15:35:11 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <201901211842.x0LIgGVB020361@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: BD0E8807CE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 20:35:19 -0000 On 1/21/19 1:42 PM, Navdeep Parhar wrote: > Log: > cxgbe(4): Allow negative values in hw.cxgbe.fw_install and take them to Thank you! Drew From owner-svn-src-head@freebsd.org Mon Jan 21 20:56:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0790414B822F; Mon, 21 Jan 2019 20:56:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A232281BEB; Mon, 21 Jan 2019 20:56:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9176A1EF94; Mon, 21 Jan 2019 20:56:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LKuTfX091061; Mon, 21 Jan 2019 20:56:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LKuTIm091060; Mon, 21 Jan 2019 20:56:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901212056.x0LKuTIm091060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Jan 2019 20:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343284 - head/lib/libcapsicum X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libcapsicum X-SVN-Commit-Revision: 343284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A232281BEB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 20:56:30 -0000 Author: markj Date: Mon Jan 21 20:56:29 2019 New Revision: 343284 URL: https://svnweb.freebsd.org/changeset/base/343284 Log: List caph_limit_stream() in the synopsis. Fix typos while here. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/lib/libcapsicum/capsicum_helpers.3 Modified: head/lib/libcapsicum/capsicum_helpers.3 ============================================================================== --- head/lib/libcapsicum/capsicum_helpers.3 Mon Jan 21 20:25:08 2019 (r343283) +++ head/lib/libcapsicum/capsicum_helpers.3 Mon Jan 21 20:56:29 2019 (r343284) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2018 +.Dd January 21, 2019 .Dt CAPSICUM_HELPERS 3 .Os .Sh NAME @@ -50,11 +50,13 @@ .Ft int .Fn caph_enter_casper "void" .Ft int -.Fn caph_rights_limit "inf fd" "const cap_righst_t *rights" +.Fn caph_rights_limit "int fd" "const cap_righst_t *rights" .Ft int -.Fn caph_ioctls_limit "inf fd" "const unsigned long *cmds" "size_t ncmds" +.Fn caph_ioctls_limit "int fd" "const unsigned long *cmds" "size_t ncmds" .Ft int -.Fn caph_fcntls_limit "inf fd" "uint32_t fcntlrights" +.Fn caph_fcntls_limit "int fd" "uint32_t fcntlrights" +.Ft int +.Fn caph_limit_stream "int fd" "int flags" .Ft int .Fn caph_limit_stdin "void" .Ft int From owner-svn-src-head@freebsd.org Mon Jan 21 23:54:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86301148DF79; Mon, 21 Jan 2019 23:54:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27D61880FF; Mon, 21 Jan 2019 23:54:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1906820DC9; Mon, 21 Jan 2019 23:54:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0LNsXqW085293; Mon, 21 Jan 2019 23:54:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0LNsXw7085292; Mon, 21 Jan 2019 23:54:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901212354.x0LNsXw7085292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 21 Jan 2019 23:54:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343286 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 343286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 27D61880FF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 23:54:34 -0000 Author: markj Date: Mon Jan 21 23:54:33 2019 New Revision: 343286 URL: https://svnweb.freebsd.org/changeset/base/343286 Log: nfs: Zero the buffers exported by NFSSVC_DUMPCLIENTS and DUMPLOCKS. Note that these interfaces are available only to root. admbugs: 765 Reported by: Vlad Tsyrklevich Reviewed by: rmacklem MFC after: 1 day Security: Kernel memory disclosure Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 21 20:58:33 2019 (r343285) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 21 23:54:33 2019 (r343286) @@ -3614,8 +3614,7 @@ nfssvc_srvcall(struct thread *p, struct nfssvc_args *u error = EPERM; if (!error) { len = sizeof (struct nfsd_dumpclients) * dumplist.ndl_size; - dumpclients = (struct nfsd_dumpclients *)malloc(len, - M_TEMP, M_WAITOK); + dumpclients = malloc(len, M_TEMP, M_WAITOK | M_ZERO); nfsrv_dumpclients(dumpclients, dumplist.ndl_size); error = copyout(dumpclients, CAST_USER_ADDR_T(dumplist.ndl_list), len); @@ -3633,8 +3632,7 @@ nfssvc_srvcall(struct thread *p, struct nfssvc_args *u if (!error) { len = sizeof (struct nfsd_dumplocks) * dumplocklist.ndllck_size; - dumplocks = (struct nfsd_dumplocks *)malloc(len, - M_TEMP, M_WAITOK); + dumplocks = malloc(len, M_TEMP, M_WAITOK | M_ZERO); nfsrv_dumplocks(nd.ni_vp, dumplocks, dumplocklist.ndllck_size, p); vput(nd.ni_vp); From owner-svn-src-head@freebsd.org Tue Jan 22 00:50:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8AEC149085C; Tue, 22 Jan 2019 00:50:25 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487788A927; Tue, 22 Jan 2019 00:50:25 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 355B921662; Tue, 22 Jan 2019 00:50:25 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0M0oPTr012757; Tue, 22 Jan 2019 00:50:25 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M0oOB1012753; Tue, 22 Jan 2019 00:50:24 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201901220050.x0M0oOB1012753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Tue, 22 Jan 2019 00:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343287 - head/sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/sbin/pfctl X-SVN-Commit-Revision: 343287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 487788A927 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 00:50:26 -0000 Author: pkelsey Date: Tue Jan 22 00:50:24 2019 New Revision: 343287 URL: https://svnweb.freebsd.org/changeset/base/343287 Log: Reduce pf.conf parsing cost for configs that define N queues from O(N^2) to O(N) The number of syscalls made during parsing of any config that defines tables is also reduced, and incorrect warnings that HFSC parent queue bandwidths were smaller than the sum of their child bandwidths have been fixed. Reviewed by: kp MFC after: 1 week Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D18759 Modified: head/sbin/pfctl/pfctl.h head/sbin/pfctl/pfctl_altq.c head/sbin/pfctl/pfctl_parser.c head/sbin/pfctl/pfctl_parser.h Modified: head/sbin/pfctl/pfctl.h ============================================================================== --- head/sbin/pfctl/pfctl.h Mon Jan 21 23:54:33 2019 (r343286) +++ head/sbin/pfctl/pfctl.h Tue Jan 22 00:50:24 2019 (r343287) @@ -114,7 +114,6 @@ extern int loadopt; int check_commit_altq(int, int); void pfaltq_store(struct pf_altq *); -struct pf_altq *pfaltq_lookup(const char *); char *rate2str(double); void print_addr(struct pf_addr_wrap *, sa_family_t, int); Modified: head/sbin/pfctl/pfctl_altq.c ============================================================================== --- head/sbin/pfctl/pfctl_altq.c Mon Jan 21 23:54:33 2019 (r343286) +++ head/sbin/pfctl/pfctl_altq.c Tue Jan 22 00:50:24 2019 (r343287) @@ -24,6 +24,7 @@ __FBSDID("$FreeBSD$"); #define PFIOC_USE_LATEST #include +#include #include #include @@ -36,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -53,33 +55,40 @@ __FBSDID("$FreeBSD$"); #define is_sc_null(sc) (((sc) == NULL) || ((sc)->m1 == 0 && (sc)->m2 == 0)) -static TAILQ_HEAD(altqs, pf_altq) altqs = TAILQ_HEAD_INITIALIZER(altqs); -static LIST_HEAD(gen_sc, segment) rtsc, lssc; +static STAILQ_HEAD(interfaces, pfctl_altq) interfaces = STAILQ_HEAD_INITIALIZER(interfaces); +static struct hsearch_data queue_map; +static struct hsearch_data if_map; +static struct hsearch_data qid_map; -struct pf_altq *qname_to_pfaltq(const char *, const char *); -u_int32_t qname_to_qid(const char *); +static struct pfctl_altq *pfaltq_lookup(char *ifname); +static struct pfctl_altq *qname_to_pfaltq(const char *, const char *); +static u_int32_t qname_to_qid(char *); -static int eval_pfqueue_cbq(struct pfctl *, struct pf_altq *); +static int eval_pfqueue_cbq(struct pfctl *, struct pf_altq *, + struct pfctl_altq *); static int cbq_compute_idletime(struct pfctl *, struct pf_altq *); -static int check_commit_cbq(int, int, struct pf_altq *); +static int check_commit_cbq(int, int, struct pfctl_altq *); static int print_cbq_opts(const struct pf_altq *); static int print_codel_opts(const struct pf_altq *, const struct node_queue_opt *); -static int eval_pfqueue_priq(struct pfctl *, struct pf_altq *); -static int check_commit_priq(int, int, struct pf_altq *); +static int eval_pfqueue_priq(struct pfctl *, struct pf_altq *, + struct pfctl_altq *); +static int check_commit_priq(int, int, struct pfctl_altq *); static int print_priq_opts(const struct pf_altq *); -static int eval_pfqueue_hfsc(struct pfctl *, struct pf_altq *); -static int check_commit_hfsc(int, int, struct pf_altq *); +static int eval_pfqueue_hfsc(struct pfctl *, struct pf_altq *, + struct pfctl_altq *, struct pfctl_altq *); +static int check_commit_hfsc(int, int, struct pfctl_altq *); static int print_hfsc_opts(const struct pf_altq *, const struct node_queue_opt *); -static int eval_pfqueue_fairq(struct pfctl *, struct pf_altq *); +static int eval_pfqueue_fairq(struct pfctl *, struct pf_altq *, + struct pfctl_altq *, struct pfctl_altq *); static int print_fairq_opts(const struct pf_altq *, const struct node_queue_opt *); -static int check_commit_fairq(int, int, struct pf_altq *); +static int check_commit_fairq(int, int, struct pfctl_altq *); static void gsc_add_sc(struct gen_sc *, struct service_curve *); static int is_gsc_under_sc(struct gen_sc *, @@ -104,59 +113,101 @@ void print_hfsc_sc(const char *, u_int, u_int, u_int void print_fairq_sc(const char *, u_int, u_int, u_int, const struct node_fairq_sc *); +static __attribute__((constructor)) void +pfctl_altq_init(void) +{ + /* + * As hdestroy() will never be called on these tables, it will be + * safe to use references into the stored data as keys. + */ + if (hcreate_r(0, &queue_map) == 0) + err(1, "Failed to create altq queue map"); + if (hcreate_r(0, &if_map) == 0) + err(1, "Failed to create altq interface map"); + if (hcreate_r(0, &qid_map) == 0) + err(1, "Failed to create altq queue id map"); +} + void pfaltq_store(struct pf_altq *a) { - struct pf_altq *altq; - + struct pfctl_altq *altq; + ENTRY item; + ENTRY *ret_item; + size_t key_size; + if ((altq = malloc(sizeof(*altq))) == NULL) - err(1, "malloc"); - memcpy(altq, a, sizeof(struct pf_altq)); - TAILQ_INSERT_TAIL(&altqs, altq, entries); + err(1, "queue malloc"); + memcpy(&altq->pa, a, sizeof(struct pf_altq)); + memset(&altq->meta, 0, sizeof(altq->meta)); + + if (a->qname[0] == 0) { + item.key = altq->pa.ifname; + item.data = altq; + if (hsearch_r(item, ENTER, &ret_item, &if_map) == 0) + err(1, "interface map insert"); + STAILQ_INSERT_TAIL(&interfaces, altq, meta.link); + } else { + key_size = sizeof(a->ifname) + sizeof(a->qname); + if ((item.key = malloc(key_size)) == NULL) + err(1, "queue map key malloc"); + snprintf(item.key, key_size, "%s:%s", a->ifname, a->qname); + item.data = altq; + if (hsearch_r(item, ENTER, &ret_item, &queue_map) == 0) + err(1, "queue map insert"); + + item.key = altq->pa.qname; + item.data = &altq->pa.qid; + if (hsearch_r(item, ENTER, &ret_item, &qid_map) == 0) + err(1, "qid map insert"); + } } -struct pf_altq * -pfaltq_lookup(const char *ifname) +static struct pfctl_altq * +pfaltq_lookup(char *ifname) { - struct pf_altq *altq; + ENTRY item; + ENTRY *ret_item; - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(ifname, altq->ifname, IFNAMSIZ) == 0 && - altq->qname[0] == 0) - return (altq); - } - return (NULL); + item.key = ifname; + if (hsearch_r(item, FIND, &ret_item, &if_map) == 0) + return (NULL); + + return (ret_item->data); } -struct pf_altq * +static struct pfctl_altq * qname_to_pfaltq(const char *qname, const char *ifname) { - struct pf_altq *altq; + ENTRY item; + ENTRY *ret_item; + char key[IFNAMSIZ + PF_QNAME_SIZE]; - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(ifname, altq->ifname, IFNAMSIZ) == 0 && - strncmp(qname, altq->qname, PF_QNAME_SIZE) == 0) - return (altq); - } - return (NULL); + item.key = key; + snprintf(item.key, sizeof(key), "%s:%s", ifname, qname); + if (hsearch_r(item, FIND, &ret_item, &queue_map) == 0) + return (NULL); + + return (ret_item->data); } -u_int32_t -qname_to_qid(const char *qname) +static u_int32_t +qname_to_qid(char *qname) { - struct pf_altq *altq; - + ENTRY item; + ENTRY *ret_item; + uint32_t qid; + /* * We guarantee that same named queues on different interfaces - * have the same qid, so we do NOT need to limit matching on - * one interface! + * have the same qid. */ + item.key = qname; + if (hsearch_r(item, FIND, &ret_item, &qid_map) == 0) + return (0); - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(qname, altq->qname, PF_QNAME_SIZE) == 0) - return (altq->qid); - } - return (0); + qid = *(uint32_t *)ret_item->data; + return (qid); } void @@ -315,28 +366,26 @@ eval_pfaltq(struct pfctl *pf, struct pf_altq *pa, stru int check_commit_altq(int dev, int opts) { - struct pf_altq *altq; - int error = 0; + struct pfctl_altq *if_ppa; + int error = 0; /* call the discipline check for each interface. */ - TAILQ_FOREACH(altq, &altqs, entries) { - if (altq->qname[0] == 0) { - switch (altq->scheduler) { - case ALTQT_CBQ: - error = check_commit_cbq(dev, opts, altq); - break; - case ALTQT_PRIQ: - error = check_commit_priq(dev, opts, altq); - break; - case ALTQT_HFSC: - error = check_commit_hfsc(dev, opts, altq); - break; - case ALTQT_FAIRQ: - error = check_commit_fairq(dev, opts, altq); - break; - default: - break; - } + STAILQ_FOREACH(if_ppa, &interfaces, meta.link) { + switch (if_ppa->pa.scheduler) { + case ALTQT_CBQ: + error = check_commit_cbq(dev, opts, if_ppa); + break; + case ALTQT_PRIQ: + error = check_commit_priq(dev, opts, if_ppa); + break; + case ALTQT_HFSC: + error = check_commit_hfsc(dev, opts, if_ppa); + break; + case ALTQT_FAIRQ: + error = check_commit_fairq(dev, opts, if_ppa); + break; + default: + break; } } return (error); @@ -350,17 +399,16 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, str struct node_queue_opt *opts) { /* should be merged with expand_queue */ - struct pf_altq *if_pa, *parent, *altq; - u_int64_t bwsum; - int error = 0; + struct pfctl_altq *if_ppa, *parent; + int error = 0; /* find the corresponding interface and copy fields used by queues */ - if ((if_pa = pfaltq_lookup(pa->ifname)) == NULL) { + if ((if_ppa = pfaltq_lookup(pa->ifname)) == NULL) { fprintf(stderr, "altq not defined on %s\n", pa->ifname); return (1); } - pa->scheduler = if_pa->scheduler; - pa->ifbandwidth = if_pa->ifbandwidth; + pa->scheduler = if_ppa->pa.scheduler; + pa->ifbandwidth = if_ppa->pa.ifbandwidth; if (qname_to_pfaltq(pa->qname, pa->ifname) != NULL) { fprintf(stderr, "queue %s already exists on interface %s\n", @@ -377,16 +425,32 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, str pa->parent, pa->qname); return (1); } - pa->parent_qid = parent->qid; + pa->parent_qid = parent->pa.qid; } if (pa->qlimit == 0) pa->qlimit = DEFAULT_QLIMIT; + if (eval_queue_opts(pa, opts, + parent == NULL ? pa->ifbandwidth : parent->pa.bandwidth)) + return (1); + if (pa->scheduler == ALTQT_CBQ || pa->scheduler == ALTQT_HFSC || pa->scheduler == ALTQT_FAIRQ) { pa->bandwidth = eval_bwspec(bw, - parent == NULL ? pa->ifbandwidth : parent->bandwidth); + parent == NULL ? pa->ifbandwidth : parent->pa.bandwidth); + /* + * For HFSC, if the linkshare service curve m2 parameter is + * set, it overrides the provided queue bandwidth parameter, + * so adjust the queue bandwidth parameter accordingly here + * to avoid false positives in the total child bandwidth + * check below. + */ + if ((pa->scheduler == ALTQT_HFSC) && + (pa->pq_u.hfsc_opts.lssc_m2 != 0)) { + pa->bandwidth = pa->pq_u.hfsc_opts.lssc_m2; + } + if (pa->bandwidth > pa->ifbandwidth) { fprintf(stderr, "bandwidth for %s higher than " "interface\n", pa->qname); @@ -394,44 +458,36 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, str } /* check the sum of the child bandwidth is under parent's */ if (parent != NULL) { - if (pa->bandwidth > parent->bandwidth) { + if (pa->bandwidth > parent->pa.bandwidth) { warnx("bandwidth for %s higher than parent", pa->qname); return (1); } - bwsum = 0; - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, - IFNAMSIZ) == 0 && - altq->qname[0] != 0 && - strncmp(altq->parent, pa->parent, - PF_QNAME_SIZE) == 0) - bwsum += altq->bandwidth; + parent->meta.bwsum += pa->bandwidth; + if (parent->meta.bwsum > parent->pa.bandwidth) { + warnx("the sum of the child bandwidth (%" PRIu64 + ") higher than parent \"%s\" (%" PRIu64 ")", + parent->meta.bwsum, parent->pa.qname, + parent->pa.bandwidth); } - bwsum += pa->bandwidth; - if (bwsum > parent->bandwidth) { - warnx("the sum of the child bandwidth higher" - " than parent \"%s\"", parent->qname); - } } } - if (eval_queue_opts(pa, opts, - parent == NULL ? pa->ifbandwidth : parent->bandwidth)) - return (1); - + if (parent != NULL) + parent->meta.children++; + switch (pa->scheduler) { case ALTQT_CBQ: - error = eval_pfqueue_cbq(pf, pa); + error = eval_pfqueue_cbq(pf, pa, if_ppa); break; case ALTQT_PRIQ: - error = eval_pfqueue_priq(pf, pa); + error = eval_pfqueue_priq(pf, pa, if_ppa); break; case ALTQT_HFSC: - error = eval_pfqueue_hfsc(pf, pa); + error = eval_pfqueue_hfsc(pf, pa, if_ppa, parent); break; case ALTQT_FAIRQ: - error = eval_pfqueue_fairq(pf, pa); + error = eval_pfqueue_fairq(pf, pa, if_ppa, parent); break; default: break; @@ -446,7 +502,7 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, str #define RM_NS_PER_SEC (1000000000) static int -eval_pfqueue_cbq(struct pfctl *pf, struct pf_altq *pa) +eval_pfqueue_cbq(struct pfctl *pf, struct pf_altq *pa, struct pfctl_altq *if_ppa) { struct cbq_opts *opts; u_int ifmtu; @@ -476,6 +532,11 @@ eval_pfqueue_cbq(struct pfctl *pf, struct pf_altq *pa) if (pa->parent[0] == 0) opts->flags |= (CBQCLF_ROOTCLASS | CBQCLF_WRR); + if (pa->pq_u.cbq_opts.flags & CBQCLF_ROOTCLASS) + if_ppa->meta.root_classes++; + if (pa->pq_u.cbq_opts.flags & CBQCLF_DEFCLASS) + if_ppa->meta.default_classes++; + cbq_compute_idletime(pf, pa); return (0); } @@ -568,33 +629,20 @@ cbq_compute_idletime(struct pfctl *pf, struct pf_altq } static int -check_commit_cbq(int dev, int opts, struct pf_altq *pa) +check_commit_cbq(int dev, int opts, struct pfctl_altq *if_ppa) { - struct pf_altq *altq; - int root_class, default_class; - int error = 0; + int error = 0; /* * check if cbq has one root queue and one default queue * for this interface */ - root_class = default_class = 0; - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) - continue; - if (altq->qname[0] == 0) /* this is for interface */ - continue; - if (altq->pq_u.cbq_opts.flags & CBQCLF_ROOTCLASS) - root_class++; - if (altq->pq_u.cbq_opts.flags & CBQCLF_DEFCLASS) - default_class++; - } - if (root_class != 1) { - warnx("should have one root queue on %s", pa->ifname); + if (if_ppa->meta.root_classes != 1) { + warnx("should have one root queue on %s", if_ppa->pa.ifname); error++; } - if (default_class != 1) { - warnx("should have one default queue on %s", pa->ifname); + if (if_ppa->meta.default_classes != 1) { + warnx("should have one default queue on %s", if_ppa->pa.ifname); error++; } return (error); @@ -641,51 +689,37 @@ print_cbq_opts(const struct pf_altq *a) * PRIQ support functions */ static int -eval_pfqueue_priq(struct pfctl *pf, struct pf_altq *pa) +eval_pfqueue_priq(struct pfctl *pf, struct pf_altq *pa, struct pfctl_altq *if_ppa) { - struct pf_altq *altq; if (pa->priority >= PRIQ_MAXPRI) { warnx("priority out of range: max %d", PRIQ_MAXPRI - 1); return (-1); } - /* the priority should be unique for the interface */ - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) == 0 && - altq->qname[0] != 0 && altq->priority == pa->priority) { - warnx("%s and %s have the same priority", - altq->qname, pa->qname); - return (-1); - } - } + if (BIT_ISSET(QPRI_BITSET_SIZE, pa->priority, &if_ppa->meta.qpris)) { + warnx("%s does not have a unique priority on interface %s", + pa->qname, pa->ifname); + return (-1); + } else + BIT_SET(QPRI_BITSET_SIZE, pa->priority, &if_ppa->meta.qpris); + if (pa->pq_u.priq_opts.flags & PRCF_DEFAULTCLASS) + if_ppa->meta.default_classes++; return (0); } static int -check_commit_priq(int dev, int opts, struct pf_altq *pa) +check_commit_priq(int dev, int opts, struct pfctl_altq *if_ppa) { - struct pf_altq *altq; - int default_class; - int error = 0; /* * check if priq has one default class for this interface */ - default_class = 0; - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) - continue; - if (altq->qname[0] == 0) /* this is for interface */ - continue; - if (altq->pq_u.priq_opts.flags & PRCF_DEFAULTCLASS) - default_class++; + if (if_ppa->meta.default_classes != 1) { + warnx("should have one default queue on %s", if_ppa->pa.ifname); + return (1); } - if (default_class != 1) { - warnx("should have one default queue on %s", pa->ifname); - error++; - } - return (error); + return (0); } static int @@ -720,15 +754,15 @@ print_priq_opts(const struct pf_altq *a) * HFSC support functions */ static int -eval_pfqueue_hfsc(struct pfctl *pf, struct pf_altq *pa) +eval_pfqueue_hfsc(struct pfctl *pf, struct pf_altq *pa, struct pfctl_altq *if_ppa, + struct pfctl_altq *parent) { - struct pf_altq *altq, *parent; struct hfsc_opts_v1 *opts; struct service_curve sc; opts = &pa->pq_u.hfsc_opts; - if (pa->parent[0] == 0) { + if (parent == NULL) { /* root queue */ opts->lssc_m1 = pa->ifbandwidth; opts->lssc_m2 = pa->ifbandwidth; @@ -736,9 +770,21 @@ eval_pfqueue_hfsc(struct pfctl *pf, struct pf_altq *pa return (0); } - LIST_INIT(&rtsc); - LIST_INIT(&lssc); + /* First child initializes the parent's service curve accumulators. */ + if (parent->meta.children == 1) { + LIST_INIT(&parent->meta.rtsc); + LIST_INIT(&parent->meta.lssc); + } + if (parent->pa.pq_u.hfsc_opts.flags & HFCF_DEFAULTCLASS) { + warnx("adding %s would make default queue %s not a leaf", + pa->qname, pa->parent); + return (-1); + } + + if (pa->pq_u.hfsc_opts.flags & HFCF_DEFAULTCLASS) + if_ppa->meta.default_classes++; + /* if link_share is not specified, use bandwidth */ if (opts->lssc_m2 == 0) opts->lssc_m2 = pa->bandwidth; @@ -768,51 +814,22 @@ eval_pfqueue_hfsc(struct pfctl *pf, struct pf_altq *pa * be smaller than the interface bandwidth, and the upper-limit should * be larger than the real-time service curve when both are defined. */ - parent = qname_to_pfaltq(pa->parent, pa->ifname); - if (parent == NULL) - errx(1, "parent %s not found for %s", pa->parent, pa->qname); - - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) - continue; - if (altq->qname[0] == 0) /* this is for interface */ - continue; - - /* if the class has a real-time service curve, add it. */ - if (opts->rtsc_m2 != 0 && altq->pq_u.hfsc_opts.rtsc_m2 != 0) { - sc.m1 = altq->pq_u.hfsc_opts.rtsc_m1; - sc.d = altq->pq_u.hfsc_opts.rtsc_d; - sc.m2 = altq->pq_u.hfsc_opts.rtsc_m2; - gsc_add_sc(&rtsc, &sc); - } - - if (strncmp(altq->parent, pa->parent, PF_QNAME_SIZE) != 0) - continue; - - /* if the class has a linkshare service curve, add it. */ - if (opts->lssc_m2 != 0 && altq->pq_u.hfsc_opts.lssc_m2 != 0) { - sc.m1 = altq->pq_u.hfsc_opts.lssc_m1; - sc.d = altq->pq_u.hfsc_opts.lssc_d; - sc.m2 = altq->pq_u.hfsc_opts.lssc_m2; - gsc_add_sc(&lssc, &sc); - } - } - + /* check the real-time service curve. reserve 20% of interface bw */ if (opts->rtsc_m2 != 0) { /* add this queue to the sum */ sc.m1 = opts->rtsc_m1; sc.d = opts->rtsc_d; sc.m2 = opts->rtsc_m2; - gsc_add_sc(&rtsc, &sc); + gsc_add_sc(&parent->meta.rtsc, &sc); /* compare the sum with 80% of the interface */ sc.m1 = 0; sc.d = 0; sc.m2 = pa->ifbandwidth / 100 * 80; - if (!is_gsc_under_sc(&rtsc, &sc)) { + if (!is_gsc_under_sc(&parent->meta.rtsc, &sc)) { warnx("real-time sc exceeds 80%% of the interface " "bandwidth (%s)", rate2str((double)sc.m2)); - goto err_ret; + return (-1); } } @@ -822,14 +839,14 @@ eval_pfqueue_hfsc(struct pfctl *pf, struct pf_altq *pa sc.m1 = opts->lssc_m1; sc.d = opts->lssc_d; sc.m2 = opts->lssc_m2; - gsc_add_sc(&lssc, &sc); + gsc_add_sc(&parent->meta.lssc, &sc); /* compare the sum of the children with parent's sc */ - sc.m1 = parent->pq_u.hfsc_opts.lssc_m1; - sc.d = parent->pq_u.hfsc_opts.lssc_d; - sc.m2 = parent->pq_u.hfsc_opts.lssc_m2; - if (!is_gsc_under_sc(&lssc, &sc)) { + sc.m1 = parent->pa.pq_u.hfsc_opts.lssc_m1; + sc.d = parent->pa.pq_u.hfsc_opts.lssc_d; + sc.m2 = parent->pa.pq_u.hfsc_opts.lssc_m2; + if (!is_gsc_under_sc(&parent->meta.lssc, &sc)) { warnx("linkshare sc exceeds parent's sc"); - goto err_ret; + return (-1); } } @@ -838,38 +855,30 @@ eval_pfqueue_hfsc(struct pfctl *pf, struct pf_altq *pa if (opts->ulsc_m1 > pa->ifbandwidth || opts->ulsc_m2 > pa->ifbandwidth) { warnx("upper-limit larger than interface bandwidth"); - goto err_ret; + return (-1); } if (opts->rtsc_m2 != 0 && opts->rtsc_m2 > opts->ulsc_m2) { warnx("upper-limit sc smaller than real-time sc"); - goto err_ret; + return (-1); } } - gsc_destroy(&rtsc); - gsc_destroy(&lssc); - return (0); - -err_ret: - gsc_destroy(&rtsc); - gsc_destroy(&lssc); - return (-1); } /* * FAIRQ support functions */ static int -eval_pfqueue_fairq(struct pfctl *pf __unused, struct pf_altq *pa) +eval_pfqueue_fairq(struct pfctl *pf __unused, struct pf_altq *pa, + struct pfctl_altq *if_ppa, struct pfctl_altq *parent) { - struct pf_altq *altq, *parent; struct fairq_opts *opts; struct service_curve sc; opts = &pa->pq_u.fairq_opts; - if (pa->parent[0] == 0) { + if (pa->parent == NULL) { /* root queue */ opts->lssc_m1 = pa->ifbandwidth; opts->lssc_m2 = pa->ifbandwidth; @@ -877,8 +886,19 @@ eval_pfqueue_fairq(struct pfctl *pf __unused, struct p return (0); } - LIST_INIT(&lssc); + /* First child initializes the parent's service curve accumulator. */ + if (parent->meta.children == 1) + LIST_INIT(&parent->meta.lssc); + if (parent->pa.pq_u.fairq_opts.flags & FARF_DEFAULTCLASS) { + warnx("adding %s would make default queue %s not a leaf", + pa->qname, pa->parent); + return (-1); + } + + if (pa->pq_u.fairq_opts.flags & FARF_DEFAULTCLASS) + if_ppa->meta.default_classes++; + /* if link_share is not specified, use bandwidth */ if (opts->lssc_m2 == 0) opts->lssc_m2 = pa->bandwidth; @@ -894,122 +914,49 @@ eval_pfqueue_fairq(struct pfctl *pf __unused, struct p * be smaller than the interface bandwidth, and the upper-limit should * be larger than the real-time service curve when both are defined. */ - parent = qname_to_pfaltq(pa->parent, pa->ifname); - if (parent == NULL) - errx(1, "parent %s not found for %s", pa->parent, pa->qname); - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) - continue; - if (altq->qname[0] == 0) /* this is for interface */ - continue; - - if (strncmp(altq->parent, pa->parent, PF_QNAME_SIZE) != 0) - continue; - - /* if the class has a link-sharing service curve, add it. */ - if (opts->lssc_m2 != 0 && altq->pq_u.fairq_opts.lssc_m2 != 0) { - sc.m1 = altq->pq_u.fairq_opts.lssc_m1; - sc.d = altq->pq_u.fairq_opts.lssc_d; - sc.m2 = altq->pq_u.fairq_opts.lssc_m2; - gsc_add_sc(&lssc, &sc); - } - } - - /* check the link-sharing service curve. */ + /* check the linkshare service curve. */ if (opts->lssc_m2 != 0) { - sc.m1 = parent->pq_u.fairq_opts.lssc_m1; - sc.d = parent->pq_u.fairq_opts.lssc_d; - sc.m2 = parent->pq_u.fairq_opts.lssc_m2; - if (!is_gsc_under_sc(&lssc, &sc)) { + /* add this queue to the child sum */ + sc.m1 = opts->lssc_m1; + sc.d = opts->lssc_d; + sc.m2 = opts->lssc_m2; + gsc_add_sc(&parent->meta.lssc, &sc); + /* compare the sum of the children with parent's sc */ + sc.m1 = parent->pa.pq_u.fairq_opts.lssc_m1; + sc.d = parent->pa.pq_u.fairq_opts.lssc_d; + sc.m2 = parent->pa.pq_u.fairq_opts.lssc_m2; + if (!is_gsc_under_sc(&parent->meta.lssc, &sc)) { warnx("link-sharing sc exceeds parent's sc"); - goto err_ret; + return (-1); } } - gsc_destroy(&lssc); - return (0); - -err_ret: - gsc_destroy(&lssc); - return (-1); } static int -check_commit_hfsc(int dev, int opts, struct pf_altq *pa) +check_commit_hfsc(int dev, int opts, struct pfctl_altq *if_ppa) { - struct pf_altq *altq, *def = NULL; - int default_class; - int error = 0; /* check if hfsc has one default queue for this interface */ - default_class = 0; - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) - continue; - if (altq->qname[0] == 0) /* this is for interface */ - continue; - if (altq->parent[0] == 0) /* dummy root */ - continue; - if (altq->pq_u.hfsc_opts.flags & HFCF_DEFAULTCLASS) { - default_class++; - def = altq; - } - } - if (default_class != 1) { - warnx("should have one default queue on %s", pa->ifname); + if (if_ppa->meta.default_classes != 1) { + warnx("should have one default queue on %s", if_ppa->pa.ifname); return (1); } - /* make sure the default queue is a leaf */ - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) - continue; - if (altq->qname[0] == 0) /* this is for interface */ - continue; - if (strncmp(altq->parent, def->qname, PF_QNAME_SIZE) == 0) { - warnx("default queue is not a leaf"); - error++; - } - } - return (error); + return (0); } static int -check_commit_fairq(int dev __unused, int opts __unused, struct pf_altq *pa) +check_commit_fairq(int dev __unused, int opts __unused, struct pfctl_altq *if_ppa) { - struct pf_altq *altq, *def = NULL; - int default_class; - int error = 0; /* check if fairq has one default queue for this interface */ - default_class = 0; - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) - continue; - if (altq->qname[0] == 0) /* this is for interface */ - continue; - if (altq->pq_u.fairq_opts.flags & FARF_DEFAULTCLASS) { - default_class++; - def = altq; - } - } - if (default_class != 1) { - warnx("should have one default queue on %s", pa->ifname); + if (if_ppa->meta.default_classes != 1) { + warnx("should have one default queue on %s", if_ppa->pa.ifname); return (1); } - /* make sure the default queue is a leaf */ - TAILQ_FOREACH(altq, &altqs, entries) { - if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0) - continue; - if (altq->qname[0] == 0) /* this is for interface */ - continue; - if (strncmp(altq->parent, def->qname, PF_QNAME_SIZE) == 0) { - warnx("default queue is not a leaf"); - error++; - } - } - return (error); + return (0); } static int @@ -1351,8 +1298,7 @@ getifspeed(char *ifname) struct ifreq ifr; struct if_data ifrdat; - if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0)) < 0) - err(1, "socket"); + s = get_query_socket(); bzero(&ifr, sizeof(ifr)); if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >= sizeof(ifr.ifr_name)) @@ -1360,8 +1306,6 @@ getifspeed(char *ifname) ifr.ifr_data = (caddr_t)&ifrdat; if (ioctl(s, SIOCGIFDATA, (caddr_t)&ifr) == -1) err(1, "SIOCGIFDATA"); - if (close(s)) - err(1, "close"); return ((u_int32_t)ifrdat.ifi_baudrate); } #endif @@ -1372,8 +1316,7 @@ getifmtu(char *ifname) int s; struct ifreq ifr; - if ((s = socket(get_socket_domain(), SOCK_DGRAM, 0)) < 0) - err(1, "socket"); + s = get_query_socket(); bzero(&ifr, sizeof(ifr)); if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >= sizeof(ifr.ifr_name)) @@ -1384,8 +1327,6 @@ getifmtu(char *ifname) #else err(1, "SIOCGIFMTU"); #endif - if (close(s)) - err(1, "close"); if (ifr.ifr_mtu > 0) return (ifr.ifr_mtu); else { Modified: head/sbin/pfctl/pfctl_parser.c ============================================================================== --- head/sbin/pfctl/pfctl_parser.c Mon Jan 21 23:54:33 2019 (r343286) +++ head/sbin/pfctl/pfctl_parser.c Tue Jan 22 00:50:24 2019 (r343287) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -72,7 +73,6 @@ void print_fromto(struct pf_rule_addr *, pf_osfp_t, struct pf_rule_addr *, u_int8_t, u_int8_t, int, int); int ifa_skip_if(const char *filter, struct node_host *p); -struct node_host *ifa_grouplookup(const char *, int); struct node_host *host_if(const char *, int); struct node_host *host_v4(const char *, int); struct node_host *host_v6(const char *, int); @@ -209,6 +209,19 @@ const struct pf_timeout pf_timeouts[] = { { NULL, 0 } }; +static struct hsearch_data isgroup_map; + +static __attribute__((constructor)) void +pfctl_parser_init(void) +{ + /* + * As hdestroy() will never be called on these tables, it will be + * safe to use references into the stored data as keys. + */ + if (hcreate_r(0, &isgroup_map) == 0) + err(1, "Failed to create interface group query response map"); +} + const struct icmptypeent * geticmptypebynumber(u_int8_t type, sa_family_t af) { @@ -1153,6 +1166,71 @@ check_netmask(struct node_host *h, sa_family_t af) static struct node_host *iftab; +/* + * Retrieve the list of groups this interface is a member of and make sure + * each group is in the group map. + */ +static void +ifa_add_groups_to_map(char *ifa_name) +{ + int s, len; + struct ifgroupreq ifgr; + struct ifg_req *ifg; + + s = get_query_socket(); + + /* Get size of group list for this interface */ + memset(&ifgr, 0, sizeof(ifgr)); + strlcpy(ifgr.ifgr_name, ifa_name, IFNAMSIZ); + if (ioctl(s, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) + err(1, "SIOCGIFGROUP"); + + /* Retrieve group list for this interface */ + len = ifgr.ifgr_len; + ifgr.ifgr_groups = + (struct ifg_req *)calloc(len / sizeof(struct ifg_req), + sizeof(struct ifg_req)); + if (ifgr.ifgr_groups == NULL) + err(1, "calloc"); + if (ioctl(s, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) + err(1, "SIOCGIFGROUP"); + + ifg = ifgr.ifgr_groups; + for (; ifg && len >= sizeof(struct ifg_req); ifg++) { + len -= sizeof(struct ifg_req); + if (strcmp(ifg->ifgrq_group, "all")) { + ENTRY item; + ENTRY *ret_item; + int *answer; + + item.key = ifg->ifgrq_group; + if (hsearch_r(item, FIND, &ret_item, &isgroup_map) == 0) { + struct ifgroupreq ifgr2; + + /* Don't know the answer yet */ + if ((answer = malloc(sizeof(int))) == NULL) + err(1, "malloc"); + + bzero(&ifgr2, sizeof(ifgr2)); + strlcpy(ifgr2.ifgr_name, ifg->ifgrq_group, + sizeof(ifgr2.ifgr_name)); + if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr2) == 0) + *answer = ifgr2.ifgr_len; + else + *answer = 0; + + item.key = strdup(ifg->ifgrq_group); + item.data = answer; + if (hsearch_r(item, ENTER, &ret_item, + &isgroup_map) == 0) + err(1, "interface group query response" + " map insert"); + } + } + } + free(ifgr.ifgr_groups); +} + void ifa_load(void) { @@ -1220,6 +1298,8 @@ ifa_load(void) sizeof(struct in6_addr)); n->ifindex = ((struct sockaddr_in6 *) ifa->ifa_addr)->sin6_scope_id; + } else if (n->af == AF_LINK) { + ifa_add_groups_to_map(ifa->ifa_name); } if ((n->ifname = strdup(ifa->ifa_name)) == NULL) err(1, "ifa_load: strdup"); @@ -1237,7 +1317,7 @@ ifa_load(void) freeifaddrs(ifap); } -int +static int get_socket_domain(void) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jan 22 00:56:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93A201490C03; Tue, 22 Jan 2019 00:56:45 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 382BA8AE4C; Tue, 22 Jan 2019 00:56:45 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C8A721807; Tue, 22 Jan 2019 00:56:45 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0M0ujER017680; Tue, 22 Jan 2019 00:56:45 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M0ujpf017679; Tue, 22 Jan 2019 00:56:45 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201901220056.x0M0ujpf017679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Tue, 22 Jan 2019 00:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343288 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 343288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 382BA8AE4C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 00:56:45 -0000 Author: pkelsey Date: Tue Jan 22 00:56:44 2019 New Revision: 343288 URL: https://svnweb.freebsd.org/changeset/base/343288 Log: Fix various resource leaks that can occur in the error paths of iflib_device_register() and iflib_pseudo_register(). Reviewed by: shurd MFC after: 1 week Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D18760 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Jan 22 00:50:24 2019 (r343287) +++ head/sys/net/iflib.c Tue Jan 22 00:56:44 2019 (r343288) @@ -4368,11 +4368,8 @@ iflib_device_register(device_t dev, void *sc, if_share ctx->ifc_softc = sc; if ((err = iflib_register(ctx)) != 0) { - if (ctx->ifc_flags & IFC_SC_ALLOCATED) - free(sc, M_IFLIB); - free(ctx, M_IFLIB); device_printf(dev, "iflib_register failed %d\n", err); - return (err); + goto fail_ctx_free; } iflib_add_device_sysctl_pre(ctx); @@ -4382,9 +4379,8 @@ iflib_device_register(device_t dev, void *sc, if_share iflib_reset_qvalues(ctx); CTX_LOCK(ctx); if ((err = IFDI_ATTACH_PRE(ctx)) != 0) { - CTX_UNLOCK(ctx); device_printf(dev, "IFDI_ATTACH_PRE failed %d\n", err); - return (err); + goto fail_unlock; } _iflib_pre_assert(scctx); ctx->ifc_txrx = *scctx->isc_txrx; @@ -4414,7 +4410,7 @@ iflib_device_register(device_t dev, void *sc, if_share /* round down instead? */ device_printf(dev, "# rx descriptors must be a power of 2\n"); err = EINVAL; - goto fail; + goto fail_iflib_detach; } } for (i = 0; i < sctx->isc_ntxqs; i++) { @@ -4422,7 +4418,7 @@ iflib_device_register(device_t dev, void *sc, if_share device_printf(dev, "# tx descriptors must be a power of 2"); err = EINVAL; - goto fail; + goto fail_iflib_detach; } } @@ -4492,7 +4488,7 @@ iflib_device_register(device_t dev, void *sc, if_share /* Get memory for the station queues */ if ((err = iflib_queues_alloc(ctx))) { device_printf(dev, "Unable to allocate queue memory\n"); - goto fail; + goto fail_intr_free; } if ((err = iflib_qset_structures_setup(ctx))) @@ -4511,7 +4507,7 @@ iflib_device_register(device_t dev, void *sc, if_share IFDI_INTR_DISABLE(ctx); if (msix > 1 && (err = IFDI_MSIX_INTR_ASSIGN(ctx, msix)) != 0) { device_printf(dev, "IFDI_MSIX_INTR_ASSIGN failed %d\n", err); - goto fail_intr_free; + goto fail_queues; } if (msix <= 1) { rid = 0; @@ -4521,7 +4517,7 @@ iflib_device_register(device_t dev, void *sc, if_share } if ((err = iflib_legacy_setup(ctx, ctx->isc_legacy_intr, ctx->ifc_softc, &rid, "irq0")) != 0) { device_printf(dev, "iflib_legacy_setup failed %d\n", err); - goto fail_intr_free; + goto fail_queues; } } @@ -4557,14 +4553,18 @@ iflib_device_register(device_t dev, void *sc, if_share fail_detach: ether_ifdetach(ctx->ifc_ifp); fail_intr_free: + iflib_free_intr_mem(ctx); fail_queues: iflib_tx_structures_free(ctx); iflib_rx_structures_free(ctx); -fail: - iflib_free_intr_mem(ctx); +fail_iflib_detach: IFDI_DETACH(ctx); +fail_unlock: CTX_UNLOCK(ctx); - +fail_ctx_free: + if (ctx->ifc_flags & IFC_SC_ALLOCATED) + free(ctx->ifc_softc, M_IFLIB); + free(ctx, M_IFLIB); return (err); } @@ -4593,9 +4593,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc if ((err = iflib_register(ctx)) != 0) { device_printf(dev, "%s: iflib_register failed %d\n", __func__, err); - free(sc, M_IFLIB); - free(ctx, M_IFLIB); - return (err); + goto fail_ctx_free; } iflib_add_device_sysctl_pre(ctx); @@ -4609,14 +4607,14 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc if ((err = IFDI_ATTACH_PRE(ctx)) != 0) { device_printf(dev, "IFDI_ATTACH_PRE failed %d\n", err); - return (err); + goto fail_ctx_free; } if (sctx->isc_flags & IFLIB_GEN_MAC) iflib_gen_mac(ctx); if ((err = IFDI_CLONEATTACH(ctx, clctx->cc_ifc, clctx->cc_name, clctx->cc_params)) != 0) { device_printf(dev, "IFDI_CLONEATTACH failed %d\n", err); - return (err); + goto fail_ctx_free; } ifmedia_add(&ctx->ifc_media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); ifmedia_add(&ctx->ifc_media, IFM_ETHER | IFM_AUTO, 0, NULL); @@ -4674,7 +4672,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc /* round down instead? */ device_printf(dev, "# rx descriptors must be a power of 2\n"); err = EINVAL; - goto fail; + goto fail_iflib_detach; } } for (i = 0; i < sctx->isc_ntxqs; i++) { @@ -4682,7 +4680,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc device_printf(dev, "# tx descriptors must be a power of 2"); err = EINVAL; - goto fail; + goto fail_iflib_detach; } } @@ -4728,7 +4726,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc /* Get memory for the station queues */ if ((err = iflib_queues_alloc(ctx))) { device_printf(dev, "Unable to allocate queue memory\n"); - goto fail; + goto fail_iflib_detach; } if ((err = iflib_qset_structures_setup(ctx))) { @@ -4768,8 +4766,11 @@ fail_detach: fail_queues: iflib_tx_structures_free(ctx); iflib_rx_structures_free(ctx); -fail: +fail_iflib_detach: IFDI_DETACH(ctx); +fail_ctx_free: + free(ctx->ifc_softc, M_IFLIB); + free(ctx, M_IFLIB); return (err); } From owner-svn-src-head@freebsd.org Tue Jan 22 01:11:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DC4D1491BF8; Tue, 22 Jan 2019 01:11:18 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22B118BC75; Tue, 22 Jan 2019 01:11:18 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 161D221A96; Tue, 22 Jan 2019 01:11:18 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0M1BHvD025065; Tue, 22 Jan 2019 01:11:17 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M1BHS1025063; Tue, 22 Jan 2019 01:11:17 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201901220111.x0M1BHS1025063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Tue, 22 Jan 2019 01:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343291 - in head/sys: dev/vmware/vmxnet3 net X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: in head/sys: dev/vmware/vmxnet3 net X-SVN-Commit-Revision: 343291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22B118BC75 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 01:11:19 -0000 Author: pkelsey Date: Tue Jan 22 01:11:17 2019 New Revision: 343291 URL: https://svnweb.freebsd.org/changeset/base/343291 Log: onvert vmx(4) to being an iflib driver. Also, expose IFLIB_MAX_RX_SEGS to iflib drivers and add iflib_dma_alloc_align() to the iflib API. Performance is generally better with the tunable/sysctl dev.vmx..iflib.tx_abdicate=1. Reviewed by: shurd MFC after: 1 week Relnotes: yes Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D18761 Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/dev/vmware/vmxnet3/if_vmxvar.h head/sys/net/iflib.c head/sys/net/iflib.h Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Tue Jan 22 01:07:20 2019 (r343290) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Tue Jan 22 01:11:17 2019 (r343291) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2013 Tsubai Masanari * Copyright (c) 2013 Bryan Venteicher + * Copyright (c) 2018 Patrick Kelsey * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -24,7 +25,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -46,9 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include -#include - #include #include #include @@ -57,8 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include @@ -67,139 +63,95 @@ __FBSDID("$FreeBSD$"); #include #include +#include "ifdi_if.h" + #include "if_vmxreg.h" #include "if_vmxvar.h" #include "opt_inet.h" #include "opt_inet6.h" -#ifdef VMXNET3_FAILPOINTS -#include -static SYSCTL_NODE(DEBUG_FP, OID_AUTO, vmxnet3, CTLFLAG_RW, 0, - "vmxnet3 fail points"); -#define VMXNET3_FP _debug_fail_point_vmxnet3 -#endif -static int vmxnet3_probe(device_t); -static int vmxnet3_attach(device_t); -static int vmxnet3_detach(device_t); -static int vmxnet3_shutdown(device_t); +#define VMXNET3_VMWARE_VENDOR_ID 0x15AD +#define VMXNET3_VMWARE_DEVICE_ID 0x07B0 +static pci_vendor_info_t vmxnet3_vendor_info_array[] = +{ + PVID(VMXNET3_VMWARE_VENDOR_ID, VMXNET3_VMWARE_DEVICE_ID, "VMware VMXNET3 Ethernet Adapter"), + /* required last entry */ + PVID_END +}; + +static void *vmxnet3_register(device_t); +static int vmxnet3_attach_pre(if_ctx_t); +static int vmxnet3_msix_intr_assign(if_ctx_t, int); +static void vmxnet3_free_irqs(struct vmxnet3_softc *); +static int vmxnet3_attach_post(if_ctx_t); +static int vmxnet3_detach(if_ctx_t); +static int vmxnet3_shutdown(if_ctx_t); +static int vmxnet3_suspend(if_ctx_t); +static int vmxnet3_resume(if_ctx_t); + static int vmxnet3_alloc_resources(struct vmxnet3_softc *); static void vmxnet3_free_resources(struct vmxnet3_softc *); static int vmxnet3_check_version(struct vmxnet3_softc *); -static void vmxnet3_initial_config(struct vmxnet3_softc *); -static void vmxnet3_check_multiqueue(struct vmxnet3_softc *); +static void vmxnet3_set_interrupt_idx(struct vmxnet3_softc *); -static int vmxnet3_alloc_msix_interrupts(struct vmxnet3_softc *); -static int vmxnet3_alloc_msi_interrupts(struct vmxnet3_softc *); -static int vmxnet3_alloc_legacy_interrupts(struct vmxnet3_softc *); -static int vmxnet3_alloc_interrupt(struct vmxnet3_softc *, int, int, - struct vmxnet3_interrupt *); -static int vmxnet3_alloc_intr_resources(struct vmxnet3_softc *); -static int vmxnet3_setup_msix_interrupts(struct vmxnet3_softc *); -static int vmxnet3_setup_legacy_interrupt(struct vmxnet3_softc *); -static int vmxnet3_setup_interrupts(struct vmxnet3_softc *); -static int vmxnet3_alloc_interrupts(struct vmxnet3_softc *); +static int vmxnet3_queues_shared_alloc(struct vmxnet3_softc *); +static void vmxnet3_init_txq(struct vmxnet3_softc *, int); +static int vmxnet3_tx_queues_alloc(if_ctx_t, caddr_t *, uint64_t *, int, int); +static void vmxnet3_init_rxq(struct vmxnet3_softc *, int, int); +static int vmxnet3_rx_queues_alloc(if_ctx_t, caddr_t *, uint64_t *, int, int); +static void vmxnet3_queues_free(if_ctx_t); -static void vmxnet3_free_interrupt(struct vmxnet3_softc *, - struct vmxnet3_interrupt *); -static void vmxnet3_free_interrupts(struct vmxnet3_softc *); - -#ifndef VMXNET3_LEGACY_TX -static int vmxnet3_alloc_taskqueue(struct vmxnet3_softc *); -static void vmxnet3_start_taskqueue(struct vmxnet3_softc *); -static void vmxnet3_drain_taskqueue(struct vmxnet3_softc *); -static void vmxnet3_free_taskqueue(struct vmxnet3_softc *); -#endif - -static int vmxnet3_init_rxq(struct vmxnet3_softc *, int); -static int vmxnet3_init_txq(struct vmxnet3_softc *, int); -static int vmxnet3_alloc_rxtx_queues(struct vmxnet3_softc *); -static void vmxnet3_destroy_rxq(struct vmxnet3_rxqueue *); -static void vmxnet3_destroy_txq(struct vmxnet3_txqueue *); -static void vmxnet3_free_rxtx_queues(struct vmxnet3_softc *); - static int vmxnet3_alloc_shared_data(struct vmxnet3_softc *); static void vmxnet3_free_shared_data(struct vmxnet3_softc *); -static int vmxnet3_alloc_txq_data(struct vmxnet3_softc *); -static void vmxnet3_free_txq_data(struct vmxnet3_softc *); -static int vmxnet3_alloc_rxq_data(struct vmxnet3_softc *); -static void vmxnet3_free_rxq_data(struct vmxnet3_softc *); -static int vmxnet3_alloc_queue_data(struct vmxnet3_softc *); -static void vmxnet3_free_queue_data(struct vmxnet3_softc *); static int vmxnet3_alloc_mcast_table(struct vmxnet3_softc *); +static void vmxnet3_free_mcast_table(struct vmxnet3_softc *); static void vmxnet3_init_shared_data(struct vmxnet3_softc *); -static void vmxnet3_init_hwassist(struct vmxnet3_softc *); -static void vmxnet3_reinit_interface(struct vmxnet3_softc *); static void vmxnet3_reinit_rss_shared_data(struct vmxnet3_softc *); static void vmxnet3_reinit_shared_data(struct vmxnet3_softc *); static int vmxnet3_alloc_data(struct vmxnet3_softc *); static void vmxnet3_free_data(struct vmxnet3_softc *); -static int vmxnet3_setup_interface(struct vmxnet3_softc *); static void vmxnet3_evintr(struct vmxnet3_softc *); -static void vmxnet3_txq_eof(struct vmxnet3_txqueue *); -static void vmxnet3_rx_csum(struct vmxnet3_rxcompdesc *, struct mbuf *); -static int vmxnet3_newbuf(struct vmxnet3_softc *, struct vmxnet3_rxring *); -static void vmxnet3_rxq_eof_discard(struct vmxnet3_rxqueue *, - struct vmxnet3_rxring *, int); -static void vmxnet3_rxq_eof(struct vmxnet3_rxqueue *); -static void vmxnet3_legacy_intr(void *); -static void vmxnet3_txq_intr(void *); -static void vmxnet3_rxq_intr(void *); -static void vmxnet3_event_intr(void *); +static int vmxnet3_isc_txd_encap(void *, if_pkt_info_t); +static void vmxnet3_isc_txd_flush(void *, uint16_t, qidx_t); +static int vmxnet3_isc_txd_credits_update(void *, uint16_t, bool); +static int vmxnet3_isc_rxd_available(void *, uint16_t, qidx_t, qidx_t); +static int vmxnet3_isc_rxd_pkt_get(void *, if_rxd_info_t); +static void vmxnet3_isc_rxd_refill(void *, if_rxd_update_t); +static void vmxnet3_isc_rxd_flush(void *, uint16_t, uint8_t, qidx_t); +static int vmxnet3_legacy_intr(void *); +static int vmxnet3_rxq_intr(void *); +static int vmxnet3_event_intr(void *); -static void vmxnet3_txstop(struct vmxnet3_softc *, struct vmxnet3_txqueue *); -static void vmxnet3_rxstop(struct vmxnet3_softc *, struct vmxnet3_rxqueue *); -static void vmxnet3_stop(struct vmxnet3_softc *); +static void vmxnet3_stop(if_ctx_t); static void vmxnet3_txinit(struct vmxnet3_softc *, struct vmxnet3_txqueue *); -static int vmxnet3_rxinit(struct vmxnet3_softc *, struct vmxnet3_rxqueue *); -static int vmxnet3_reinit_queues(struct vmxnet3_softc *); +static void vmxnet3_rxinit(struct vmxnet3_softc *, struct vmxnet3_rxqueue *); +static void vmxnet3_reinit_queues(struct vmxnet3_softc *); static int vmxnet3_enable_device(struct vmxnet3_softc *); static void vmxnet3_reinit_rxfilters(struct vmxnet3_softc *); -static int vmxnet3_reinit(struct vmxnet3_softc *); -static void vmxnet3_init_locked(struct vmxnet3_softc *); -static void vmxnet3_init(void *); +static void vmxnet3_init(if_ctx_t); +static void vmxnet3_multi_set(if_ctx_t); +static int vmxnet3_mtu_set(if_ctx_t, uint32_t); +static void vmxnet3_media_status(if_ctx_t, struct ifmediareq *); +static int vmxnet3_media_change(if_ctx_t); +static int vmxnet3_promisc_set(if_ctx_t, int); +static uint64_t vmxnet3_get_counter(if_ctx_t, ift_counter); +static void vmxnet3_update_admin_status(if_ctx_t); +static void vmxnet3_txq_timer(if_ctx_t, uint16_t); -static int vmxnet3_txq_offload_ctx(struct vmxnet3_txqueue *,struct mbuf *, - int *, int *, int *); -static int vmxnet3_txq_load_mbuf(struct vmxnet3_txqueue *, struct mbuf **, - bus_dmamap_t, bus_dma_segment_t [], int *); -static void vmxnet3_txq_unload_mbuf(struct vmxnet3_txqueue *, bus_dmamap_t); -static int vmxnet3_txq_encap(struct vmxnet3_txqueue *, struct mbuf **); -#ifdef VMXNET3_LEGACY_TX -static void vmxnet3_start_locked(struct ifnet *); -static void vmxnet3_start(struct ifnet *); -#else -static int vmxnet3_txq_mq_start_locked(struct vmxnet3_txqueue *, - struct mbuf *); -static int vmxnet3_txq_mq_start(struct ifnet *, struct mbuf *); -static void vmxnet3_txq_tq_deferred(void *, int); -#endif -static void vmxnet3_txq_start(struct vmxnet3_txqueue *); -static void vmxnet3_tx_start_all(struct vmxnet3_softc *); - static void vmxnet3_update_vlan_filter(struct vmxnet3_softc *, int, uint16_t); -static void vmxnet3_register_vlan(void *, struct ifnet *, uint16_t); -static void vmxnet3_unregister_vlan(void *, struct ifnet *, uint16_t); -static void vmxnet3_set_rxfilter(struct vmxnet3_softc *); -static int vmxnet3_change_mtu(struct vmxnet3_softc *, int); -static int vmxnet3_ioctl(struct ifnet *, u_long, caddr_t); -static uint64_t vmxnet3_get_counter(struct ifnet *, ift_counter); +static void vmxnet3_vlan_register(if_ctx_t, uint16_t); +static void vmxnet3_vlan_unregister(if_ctx_t, uint16_t); +static void vmxnet3_set_rxfilter(struct vmxnet3_softc *, int); -#ifndef VMXNET3_LEGACY_TX -static void vmxnet3_qflush(struct ifnet *); -#endif - -static int vmxnet3_watchdog(struct vmxnet3_txqueue *); static void vmxnet3_refresh_host_stats(struct vmxnet3_softc *); -static void vmxnet3_tick(void *); +static int vmxnet3_link_is_up(struct vmxnet3_softc *); static void vmxnet3_link_status(struct vmxnet3_softc *); -static void vmxnet3_media_status(struct ifnet *, struct ifmediareq *); -static int vmxnet3_media_change(struct ifnet *); static void vmxnet3_set_lladdr(struct vmxnet3_softc *); static void vmxnet3_get_lladdr(struct vmxnet3_softc *); @@ -219,18 +171,14 @@ static void vmxnet3_write_bar1(struct vmxnet3_softc *, static void vmxnet3_write_cmd(struct vmxnet3_softc *, uint32_t); static uint32_t vmxnet3_read_cmd(struct vmxnet3_softc *, uint32_t); +static int vmxnet3_tx_queue_intr_enable(if_ctx_t, uint16_t); +static int vmxnet3_rx_queue_intr_enable(if_ctx_t, uint16_t); +static void vmxnet3_link_intr_enable(if_ctx_t); static void vmxnet3_enable_intr(struct vmxnet3_softc *, int); static void vmxnet3_disable_intr(struct vmxnet3_softc *, int); -static void vmxnet3_enable_all_intrs(struct vmxnet3_softc *); -static void vmxnet3_disable_all_intrs(struct vmxnet3_softc *); +static void vmxnet3_intr_enable_all(if_ctx_t); +static void vmxnet3_intr_disable_all(if_ctx_t); -static int vmxnet3_dma_malloc(struct vmxnet3_softc *, bus_size_t, - bus_size_t, struct vmxnet3_dma_alloc *); -static void vmxnet3_dma_free(struct vmxnet3_softc *, - struct vmxnet3_dma_alloc *); -static int vmxnet3_tunable_int(struct vmxnet3_softc *, - const char *, int); - typedef enum { VMXNET3_BARRIER_RD, VMXNET3_BARRIER_WR, @@ -239,25 +187,16 @@ typedef enum { static void vmxnet3_barrier(struct vmxnet3_softc *, vmxnet3_barrier_t); -/* Tunables. */ -static int vmxnet3_mq_disable = 0; -TUNABLE_INT("hw.vmx.mq_disable", &vmxnet3_mq_disable); -static int vmxnet3_default_txnqueue = VMXNET3_DEF_TX_QUEUES; -TUNABLE_INT("hw.vmx.txnqueue", &vmxnet3_default_txnqueue); -static int vmxnet3_default_rxnqueue = VMXNET3_DEF_RX_QUEUES; -TUNABLE_INT("hw.vmx.rxnqueue", &vmxnet3_default_rxnqueue); -static int vmxnet3_default_txndesc = VMXNET3_DEF_TX_NDESC; -TUNABLE_INT("hw.vmx.txndesc", &vmxnet3_default_txndesc); -static int vmxnet3_default_rxndesc = VMXNET3_DEF_RX_NDESC; -TUNABLE_INT("hw.vmx.rxndesc", &vmxnet3_default_rxndesc); static device_method_t vmxnet3_methods[] = { - /* Device interface. */ - DEVMETHOD(device_probe, vmxnet3_probe), - DEVMETHOD(device_attach, vmxnet3_attach), - DEVMETHOD(device_detach, vmxnet3_detach), - DEVMETHOD(device_shutdown, vmxnet3_shutdown), - + /* Device interface */ + DEVMETHOD(device_register, vmxnet3_register), + DEVMETHOD(device_probe, iflib_device_probe), + DEVMETHOD(device_attach, iflib_device_attach), + DEVMETHOD(device_detach, iflib_device_detach), + DEVMETHOD(device_shutdown, iflib_device_shutdown), + DEVMETHOD(device_suspend, iflib_device_suspend), + DEVMETHOD(device_resume, iflib_device_resume), DEVMETHOD_END }; @@ -267,153 +206,382 @@ static driver_t vmxnet3_driver = { static devclass_t vmxnet3_devclass; DRIVER_MODULE(vmx, pci, vmxnet3_driver, vmxnet3_devclass, 0, 0); +IFLIB_PNP_INFO(pci, vmx, vmxnet3_vendor_info_array); +MODULE_VERSION(vmx, 2); MODULE_DEPEND(vmx, pci, 1, 1, 1); MODULE_DEPEND(vmx, ether, 1, 1, 1); +MODULE_DEPEND(vmx, iflib, 1, 1, 1); -#define VMXNET3_VMWARE_VENDOR_ID 0x15AD -#define VMXNET3_VMWARE_DEVICE_ID 0x07B0 +static device_method_t vmxnet3_iflib_methods[] = { + DEVMETHOD(ifdi_tx_queues_alloc, vmxnet3_tx_queues_alloc), + DEVMETHOD(ifdi_rx_queues_alloc, vmxnet3_rx_queues_alloc), + DEVMETHOD(ifdi_queues_free, vmxnet3_queues_free), -static int -vmxnet3_probe(device_t dev) -{ + DEVMETHOD(ifdi_attach_pre, vmxnet3_attach_pre), + DEVMETHOD(ifdi_attach_post, vmxnet3_attach_post), + DEVMETHOD(ifdi_detach, vmxnet3_detach), - if (pci_get_vendor(dev) == VMXNET3_VMWARE_VENDOR_ID && - pci_get_device(dev) == VMXNET3_VMWARE_DEVICE_ID) { - device_set_desc(dev, "VMware VMXNET3 Ethernet Adapter"); - return (BUS_PROBE_DEFAULT); - } + DEVMETHOD(ifdi_init, vmxnet3_init), + DEVMETHOD(ifdi_stop, vmxnet3_stop), + DEVMETHOD(ifdi_multi_set, vmxnet3_multi_set), + DEVMETHOD(ifdi_mtu_set, vmxnet3_mtu_set), + DEVMETHOD(ifdi_media_status, vmxnet3_media_status), + DEVMETHOD(ifdi_media_change, vmxnet3_media_change), + DEVMETHOD(ifdi_promisc_set, vmxnet3_promisc_set), + DEVMETHOD(ifdi_get_counter, vmxnet3_get_counter), + DEVMETHOD(ifdi_update_admin_status, vmxnet3_update_admin_status), + DEVMETHOD(ifdi_timer, vmxnet3_txq_timer), - return (ENXIO); + DEVMETHOD(ifdi_tx_queue_intr_enable, vmxnet3_tx_queue_intr_enable), + DEVMETHOD(ifdi_rx_queue_intr_enable, vmxnet3_rx_queue_intr_enable), + DEVMETHOD(ifdi_link_intr_enable, vmxnet3_link_intr_enable), + DEVMETHOD(ifdi_intr_enable, vmxnet3_intr_enable_all), + DEVMETHOD(ifdi_intr_disable, vmxnet3_intr_disable_all), + DEVMETHOD(ifdi_msix_intr_assign, vmxnet3_msix_intr_assign), + + DEVMETHOD(ifdi_vlan_register, vmxnet3_vlan_register), + DEVMETHOD(ifdi_vlan_unregister, vmxnet3_vlan_unregister), + + DEVMETHOD(ifdi_shutdown, vmxnet3_shutdown), + DEVMETHOD(ifdi_suspend, vmxnet3_suspend), + DEVMETHOD(ifdi_resume, vmxnet3_resume), + + DEVMETHOD_END +}; + +static driver_t vmxnet3_iflib_driver = { + "vmx", vmxnet3_iflib_methods, sizeof(struct vmxnet3_softc) +}; + +struct if_txrx vmxnet3_txrx = { + .ift_txd_encap = vmxnet3_isc_txd_encap, + .ift_txd_flush = vmxnet3_isc_txd_flush, + .ift_txd_credits_update = vmxnet3_isc_txd_credits_update, + .ift_rxd_available = vmxnet3_isc_rxd_available, + .ift_rxd_pkt_get = vmxnet3_isc_rxd_pkt_get, + .ift_rxd_refill = vmxnet3_isc_rxd_refill, + .ift_rxd_flush = vmxnet3_isc_rxd_flush, + .ift_legacy_intr = vmxnet3_legacy_intr +}; + +static struct if_shared_ctx vmxnet3_sctx_init = { + .isc_magic = IFLIB_MAGIC, + .isc_q_align = 512, + + .isc_tx_maxsize = VMXNET3_TX_MAXSIZE, + .isc_tx_maxsegsize = VMXNET3_TX_MAXSEGSIZE, + .isc_tso_maxsize = VMXNET3_TSO_MAXSIZE + sizeof(struct ether_vlan_header), + .isc_tso_maxsegsize = VMXNET3_TX_MAXSEGSIZE, + + /* + * These values are used to configure the busdma tag used for + * receive descriptors. Each receive descriptor only points to one + * buffer. + */ + .isc_rx_maxsize = VMXNET3_RX_MAXSEGSIZE, /* One buf per descriptor */ + .isc_rx_nsegments = 1, /* One mapping per descriptor */ + .isc_rx_maxsegsize = VMXNET3_RX_MAXSEGSIZE, + + .isc_admin_intrcnt = 1, + .isc_vendor_info = vmxnet3_vendor_info_array, + .isc_driver_version = "2", + .isc_driver = &vmxnet3_iflib_driver, + .isc_flags = IFLIB_HAS_RXCQ | IFLIB_HAS_TXCQ, + + /* + * Number of receive queues per receive queue set, with associated + * descriptor settings for each. + */ + .isc_nrxqs = 3, + .isc_nfl = 2, /* one free list for each receive command queue */ + .isc_nrxd_min = {VMXNET3_MIN_RX_NDESC, VMXNET3_MIN_RX_NDESC, VMXNET3_MIN_RX_NDESC}, + .isc_nrxd_max = {VMXNET3_MAX_RX_NDESC, VMXNET3_MAX_RX_NDESC, VMXNET3_MAX_RX_NDESC}, + .isc_nrxd_default = {VMXNET3_DEF_RX_NDESC, VMXNET3_DEF_RX_NDESC, VMXNET3_DEF_RX_NDESC}, + + /* + * Number of transmit queues per transmit queue set, with associated + * descriptor settings for each. + */ + .isc_ntxqs = 2, + .isc_ntxd_min = {VMXNET3_MIN_TX_NDESC, VMXNET3_MIN_TX_NDESC}, + .isc_ntxd_max = {VMXNET3_MAX_TX_NDESC, VMXNET3_MAX_TX_NDESC}, + .isc_ntxd_default = {VMXNET3_DEF_TX_NDESC, VMXNET3_DEF_TX_NDESC}, +}; + +static void * +vmxnet3_register(device_t dev) +{ + return (&vmxnet3_sctx_init); } static int -vmxnet3_attach(device_t dev) +vmxnet3_attach_pre(if_ctx_t ctx) { + device_t dev; + if_softc_ctx_t scctx; struct vmxnet3_softc *sc; + uint32_t intr_config; int error; - sc = device_get_softc(dev); + dev = iflib_get_dev(ctx); + sc = iflib_get_softc(ctx); sc->vmx_dev = dev; + sc->vmx_ctx = ctx; + sc->vmx_sctx = iflib_get_sctx(ctx); + sc->vmx_scctx = iflib_get_softc_ctx(ctx); + sc->vmx_ifp = iflib_get_ifp(ctx); + sc->vmx_media = iflib_get_media(ctx); + scctx = sc->vmx_scctx; - pci_enable_busmaster(dev); + scctx->isc_tx_nsegments = VMXNET3_TX_MAXSEGS; + scctx->isc_tx_tso_segments_max = VMXNET3_TX_MAXSEGS; + /* isc_tx_tso_size_max doesn't include possible vlan header */ + scctx->isc_tx_tso_size_max = VMXNET3_TSO_MAXSIZE; + scctx->isc_tx_tso_segsize_max = VMXNET3_TX_MAXSEGSIZE; + scctx->isc_txrx = &vmxnet3_txrx; - VMXNET3_CORE_LOCK_INIT(sc, device_get_nameunit(dev)); - callout_init_mtx(&sc->vmx_tick, &sc->vmx_mtx, 0); + /* If 0, the iflib tunable was not set, so set to the default */ + if (scctx->isc_nrxqsets == 0) + scctx->isc_nrxqsets = VMXNET3_DEF_RX_QUEUES; + scctx->isc_nrxqsets_max = min(VMXNET3_MAX_RX_QUEUES, mp_ncpus); - vmxnet3_initial_config(sc); + /* If 0, the iflib tunable was not set, so set to the default */ + if (scctx->isc_ntxqsets == 0) + scctx->isc_ntxqsets = VMXNET3_DEF_TX_QUEUES; + scctx->isc_ntxqsets_max = min(VMXNET3_MAX_TX_QUEUES, mp_ncpus); - error = vmxnet3_alloc_resources(sc); - if (error) - goto fail; + /* + * Enforce that the transmit completion queue descriptor count is + * the same as the transmit command queue descriptor count. + */ + scctx->isc_ntxd[0] = scctx->isc_ntxd[1]; + scctx->isc_txqsizes[0] = + sizeof(struct vmxnet3_txcompdesc) * scctx->isc_ntxd[0]; + scctx->isc_txqsizes[1] = + sizeof(struct vmxnet3_txdesc) * scctx->isc_ntxd[1]; - error = vmxnet3_check_version(sc); - if (error) - goto fail; + /* + * Enforce that the receive completion queue descriptor count is the + * sum of the receive command queue descriptor counts, and that the + * second receive command queue descriptor count is the same as the + * first one. + */ + scctx->isc_nrxd[2] = scctx->isc_nrxd[1]; + scctx->isc_nrxd[0] = scctx->isc_nrxd[1] + scctx->isc_nrxd[2]; + scctx->isc_rxqsizes[0] = + sizeof(struct vmxnet3_rxcompdesc) * scctx->isc_nrxd[0]; + scctx->isc_rxqsizes[1] = + sizeof(struct vmxnet3_rxdesc) * scctx->isc_nrxd[1]; + scctx->isc_rxqsizes[2] = + sizeof(struct vmxnet3_rxdesc) * scctx->isc_nrxd[2]; - error = vmxnet3_alloc_rxtx_queues(sc); - if (error) - goto fail; + scctx->isc_rss_table_size = UPT1_RSS_MAX_IND_TABLE_SIZE; -#ifndef VMXNET3_LEGACY_TX - error = vmxnet3_alloc_taskqueue(sc); + /* Map PCI BARs */ + error = vmxnet3_alloc_resources(sc); if (error) goto fail; -#endif - error = vmxnet3_alloc_interrupts(sc); + /* Check device versions */ + error = vmxnet3_check_version(sc); if (error) goto fail; - vmxnet3_check_multiqueue(sc); + /* + * The interrupt mode can be set in the hypervisor configuration via + * the parameter ethernet.intrMode. + */ + intr_config = vmxnet3_read_cmd(sc, VMXNET3_CMD_GET_INTRCFG); + sc->vmx_intr_mask_mode = (intr_config >> 2) & 0x03; - error = vmxnet3_alloc_data(sc); - if (error) - goto fail; + /* + * Configure the softc context to attempt to configure the interrupt + * mode now indicated by intr_config. iflib will follow the usual + * fallback path MSIX -> MSI -> LEGACY, starting at the configured + * starting mode. + */ + switch (intr_config & 0x03) { + case VMXNET3_IT_AUTO: + case VMXNET3_IT_MSIX: + scctx->isc_msix_bar = pci_msix_table_bar(dev); + break; + case VMXNET3_IT_MSI: + scctx->isc_msix_bar = -1; + scctx->isc_disable_msix = 1; + break; + case VMXNET3_IT_LEGACY: + scctx->isc_msix_bar = 0; + break; + } - error = vmxnet3_setup_interface(sc); - if (error) - goto fail; + scctx->isc_tx_csum_flags = VMXNET3_CSUM_ALL_OFFLOAD; + scctx->isc_capabilities = scctx->isc_capenable = + IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6 | + IFCAP_TSO4 | IFCAP_TSO6 | + IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | + IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | + IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO | + IFCAP_JUMBO_MTU; - error = vmxnet3_setup_interrupts(sc); - if (error) { - ether_ifdetach(sc->vmx_ifp); - device_printf(dev, "could not set up interrupt\n"); - goto fail; - } + /* These capabilities are not enabled by default. */ + scctx->isc_capabilities |= IFCAP_LRO | IFCAP_VLAN_HWFILTER; - vmxnet3_setup_sysctl(sc); -#ifndef VMXNET3_LEGACY_TX - vmxnet3_start_taskqueue(sc); -#endif + vmxnet3_get_lladdr(sc); + iflib_set_mac(ctx, sc->vmx_lladdr); + return (0); fail: - if (error) - vmxnet3_detach(dev); + /* + * We must completely clean up anything allocated above as iflib + * will not invoke any other driver entry points as a result of this + * failure. + */ + vmxnet3_free_resources(sc); return (error); } static int -vmxnet3_detach(device_t dev) +vmxnet3_msix_intr_assign(if_ctx_t ctx, int msix) { struct vmxnet3_softc *sc; - struct ifnet *ifp; + if_softc_ctx_t scctx; + struct vmxnet3_rxqueue *rxq; + int error; + int i; + char irq_name[16]; - sc = device_get_softc(dev); - ifp = sc->vmx_ifp; + sc = iflib_get_softc(ctx); + scctx = sc->vmx_scctx; + + for (i = 0; i < scctx->isc_nrxqsets; i++) { + snprintf(irq_name, sizeof(irq_name), "rxq%d", i); - if (device_is_attached(dev)) { - VMXNET3_CORE_LOCK(sc); - vmxnet3_stop(sc); - VMXNET3_CORE_UNLOCK(sc); + rxq = &sc->vmx_rxq[i]; + error = iflib_irq_alloc_generic(ctx, &rxq->vxrxq_irq, i + 1, + IFLIB_INTR_RX, vmxnet3_rxq_intr, rxq, i, irq_name); + if (error) { + device_printf(iflib_get_dev(ctx), + "Failed to register rxq %d interrupt handler\n", i); + return (error); + } + } - callout_drain(&sc->vmx_tick); -#ifndef VMXNET3_LEGACY_TX - vmxnet3_drain_taskqueue(sc); -#endif + for (i = 0; i < scctx->isc_ntxqsets; i++) { + snprintf(irq_name, sizeof(irq_name), "txq%d", i); - ether_ifdetach(ifp); + /* + * Don't provide the corresponding rxq irq for reference - + * we want the transmit task to be attached to a task queue + * that is different from the one used by the corresponding + * rxq irq. That is because the TX doorbell writes are very + * expensive as virtualized MMIO operations, so we want to + * be able to defer them to another core when possible so + * that they don't steal receive processing cycles during + * stack turnarounds like TCP ACK generation. The other + * piece to this approach is enabling the iflib abdicate + * option (currently via an interface-specific + * tunable/sysctl). + */ + iflib_softirq_alloc_generic(ctx, NULL, IFLIB_INTR_TX, NULL, i, + irq_name); } - if (sc->vmx_vlan_attach != NULL) { - EVENTHANDLER_DEREGISTER(vlan_config, sc->vmx_vlan_attach); - sc->vmx_vlan_attach = NULL; + error = iflib_irq_alloc_generic(ctx, &sc->vmx_event_intr_irq, + scctx->isc_nrxqsets + 1, IFLIB_INTR_ADMIN, vmxnet3_event_intr, sc, 0, + "event"); + if (error) { + device_printf(iflib_get_dev(ctx), + "Failed to register event interrupt handler\n"); + return (error); } - if (sc->vmx_vlan_detach != NULL) { - EVENTHANDLER_DEREGISTER(vlan_config, sc->vmx_vlan_detach); - sc->vmx_vlan_detach = NULL; - } -#ifndef VMXNET3_LEGACY_TX - vmxnet3_free_taskqueue(sc); -#endif - vmxnet3_free_interrupts(sc); + return (0); +} - if (ifp != NULL) { - if_free(ifp); - sc->vmx_ifp = NULL; +static void +vmxnet3_free_irqs(struct vmxnet3_softc *sc) +{ + if_softc_ctx_t scctx; + struct vmxnet3_rxqueue *rxq; + int i; + + scctx = sc->vmx_scctx; + + for (i = 0; i < scctx->isc_nrxqsets; i++) { + rxq = &sc->vmx_rxq[i]; + iflib_irq_free(sc->vmx_ctx, &rxq->vxrxq_irq); } - ifmedia_removeall(&sc->vmx_media); + iflib_irq_free(sc->vmx_ctx, &sc->vmx_event_intr_irq); +} +static int +vmxnet3_attach_post(if_ctx_t ctx) +{ + device_t dev; + if_softc_ctx_t scctx; + struct vmxnet3_softc *sc; + int error; + + dev = iflib_get_dev(ctx); + scctx = iflib_get_softc_ctx(ctx); + sc = iflib_get_softc(ctx); + + if (scctx->isc_nrxqsets > 1) + sc->vmx_flags |= VMXNET3_FLAG_RSS; + + error = vmxnet3_alloc_data(sc); + if (error) + goto fail; + + vmxnet3_set_interrupt_idx(sc); + vmxnet3_setup_sysctl(sc); + + ifmedia_add(sc->vmx_media, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_set(sc->vmx_media, IFM_ETHER | IFM_AUTO); + +fail: + return (error); +} + +static int +vmxnet3_detach(if_ctx_t ctx) +{ + struct vmxnet3_softc *sc; + + sc = iflib_get_softc(ctx); + + vmxnet3_free_irqs(sc); vmxnet3_free_data(sc); vmxnet3_free_resources(sc); - vmxnet3_free_rxtx_queues(sc); - VMXNET3_CORE_LOCK_DESTROY(sc); + return (0); +} +static int +vmxnet3_shutdown(if_ctx_t ctx) +{ + return (0); } static int -vmxnet3_shutdown(device_t dev) +vmxnet3_suspend(if_ctx_t ctx) { return (0); } static int +vmxnet3_resume(if_ctx_t ctx) +{ + + return (0); +} + +static int vmxnet3_alloc_resources(struct vmxnet3_softc *sc) { device_t dev; @@ -445,15 +613,6 @@ vmxnet3_alloc_resources(struct vmxnet3_softc *sc) sc->vmx_iot1 = rman_get_bustag(sc->vmx_res1); sc->vmx_ioh1 = rman_get_bushandle(sc->vmx_res1); - if (pci_find_cap(dev, PCIY_MSIX, NULL) == 0) { - rid = PCIR_BAR(2); - sc->vmx_msix_res = bus_alloc_resource_any(dev, - SYS_RES_MEMORY, &rid, RF_ACTIVE); - } - - if (sc->vmx_msix_res == NULL) - sc->vmx_flags |= VMXNET3_FLAG_NO_MSIX; - return (0); } @@ -476,13 +635,6 @@ vmxnet3_free_resources(struct vmxnet3_softc *sc) bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->vmx_res1); sc->vmx_res1 = NULL; } - - if (sc->vmx_msix_res != NULL) { - rid = PCIR_BAR(2); - bus_release_resource(dev, SYS_RES_MEMORY, rid, - sc->vmx_msix_res); - sc->vmx_msix_res = NULL; - } } static int @@ -511,603 +663,282 @@ vmxnet3_check_version(struct vmxnet3_softc *sc) return (0); } -static int -trunc_powerof2(int val) -{ - - return (1U << (fls(val) - 1)); -} - static void -vmxnet3_initial_config(struct vmxnet3_softc *sc) -{ - int nqueue, ndesc; - - nqueue = vmxnet3_tunable_int(sc, "txnqueue", vmxnet3_default_txnqueue); - if (nqueue > VMXNET3_MAX_TX_QUEUES || nqueue < 1) - nqueue = VMXNET3_DEF_TX_QUEUES; - if (nqueue > mp_ncpus) - nqueue = mp_ncpus; - sc->vmx_max_ntxqueues = trunc_powerof2(nqueue); - - nqueue = vmxnet3_tunable_int(sc, "rxnqueue", vmxnet3_default_rxnqueue); - if (nqueue > VMXNET3_MAX_RX_QUEUES || nqueue < 1) - nqueue = VMXNET3_DEF_RX_QUEUES; - if (nqueue > mp_ncpus) - nqueue = mp_ncpus; - sc->vmx_max_nrxqueues = trunc_powerof2(nqueue); - - if (vmxnet3_tunable_int(sc, "mq_disable", vmxnet3_mq_disable)) { - sc->vmx_max_nrxqueues = 1; - sc->vmx_max_ntxqueues = 1; - } - - ndesc = vmxnet3_tunable_int(sc, "txd", vmxnet3_default_txndesc); - if (ndesc > VMXNET3_MAX_TX_NDESC || ndesc < VMXNET3_MIN_TX_NDESC) - ndesc = VMXNET3_DEF_TX_NDESC; - if (ndesc & VMXNET3_MASK_TX_NDESC) - ndesc &= ~VMXNET3_MASK_TX_NDESC; - sc->vmx_ntxdescs = ndesc; - - ndesc = vmxnet3_tunable_int(sc, "rxd", vmxnet3_default_rxndesc); - if (ndesc > VMXNET3_MAX_RX_NDESC || ndesc < VMXNET3_MIN_RX_NDESC) - ndesc = VMXNET3_DEF_RX_NDESC; - if (ndesc & VMXNET3_MASK_RX_NDESC) - ndesc &= ~VMXNET3_MASK_RX_NDESC; - sc->vmx_nrxdescs = ndesc; - sc->vmx_max_rxsegs = VMXNET3_MAX_RX_SEGS; -} - -static void -vmxnet3_check_multiqueue(struct vmxnet3_softc *sc) -{ - - if (sc->vmx_intr_type != VMXNET3_IT_MSIX) - goto out; - - /* BMV: Just use the maximum configured for now. */ - sc->vmx_nrxqueues = sc->vmx_max_nrxqueues; - sc->vmx_ntxqueues = sc->vmx_max_ntxqueues; - - if (sc->vmx_nrxqueues > 1) - sc->vmx_flags |= VMXNET3_FLAG_RSS; - - return; - -out: - sc->vmx_ntxqueues = 1; - sc->vmx_nrxqueues = 1; -} - -static int -vmxnet3_alloc_msix_interrupts(struct vmxnet3_softc *sc) -{ - device_t dev; - int nmsix, cnt, required; - - dev = sc->vmx_dev; - - if (sc->vmx_flags & VMXNET3_FLAG_NO_MSIX) - return (1); - - /* Allocate an additional vector for the events interrupt. */ - required = sc->vmx_max_nrxqueues + sc->vmx_max_ntxqueues + 1; - - nmsix = pci_msix_count(dev); - if (nmsix < required) - return (1); - - cnt = required; - if (pci_alloc_msix(dev, &cnt) == 0 && cnt >= required) { - sc->vmx_nintrs = required; - return (0); - } else - pci_release_msi(dev); - - /* BMV TODO Fallback to sharing MSIX vectors if possible. */ - - return (1); -} - -static int -vmxnet3_alloc_msi_interrupts(struct vmxnet3_softc *sc) -{ - device_t dev; - int nmsi, cnt, required; - - dev = sc->vmx_dev; - required = 1; - - nmsi = pci_msi_count(dev); - if (nmsi < required) - return (1); - - cnt = required; - if (pci_alloc_msi(dev, &cnt) == 0 && cnt >= required) { - sc->vmx_nintrs = 1; - return (0); - } else - pci_release_msi(dev); - - return (1); -} - -static int -vmxnet3_alloc_legacy_interrupts(struct vmxnet3_softc *sc) -{ - - sc->vmx_nintrs = 1; - return (0); -} - -static int -vmxnet3_alloc_interrupt(struct vmxnet3_softc *sc, int rid, int flags, - struct vmxnet3_interrupt *intr) -{ - struct resource *irq; - - irq = bus_alloc_resource_any(sc->vmx_dev, SYS_RES_IRQ, &rid, flags); - if (irq == NULL) - return (ENXIO); - - intr->vmxi_irq = irq; - intr->vmxi_rid = rid; - - return (0); -} - -static int -vmxnet3_alloc_intr_resources(struct vmxnet3_softc *sc) -{ - int i, rid, flags, error; - - rid = 0; - flags = RF_ACTIVE; - - if (sc->vmx_intr_type == VMXNET3_IT_LEGACY) - flags |= RF_SHAREABLE; - else - rid = 1; - - for (i = 0; i < sc->vmx_nintrs; i++, rid++) { - error = vmxnet3_alloc_interrupt(sc, rid, flags, - &sc->vmx_intrs[i]); - if (error) - return (error); - } - - return (0); -} - -static int -vmxnet3_setup_msix_interrupts(struct vmxnet3_softc *sc) -{ - device_t dev; - struct vmxnet3_txqueue *txq; - struct vmxnet3_rxqueue *rxq; - struct vmxnet3_interrupt *intr; - enum intr_type type; - int i, error; - - dev = sc->vmx_dev; - intr = &sc->vmx_intrs[0]; - type = INTR_TYPE_NET | INTR_MPSAFE; - - for (i = 0; i < sc->vmx_ntxqueues; i++, intr++) { - txq = &sc->vmx_txq[i]; - error = bus_setup_intr(dev, intr->vmxi_irq, type, NULL, - vmxnet3_txq_intr, txq, &intr->vmxi_handler); - if (error) - return (error); - bus_describe_intr(dev, intr->vmxi_irq, intr->vmxi_handler, - "tq%d", i); - txq->vxtxq_intr_idx = intr->vmxi_rid - 1; - } - - for (i = 0; i < sc->vmx_nrxqueues; i++, intr++) { - rxq = &sc->vmx_rxq[i]; - error = bus_setup_intr(dev, intr->vmxi_irq, type, NULL, - vmxnet3_rxq_intr, rxq, &intr->vmxi_handler); - if (error) - return (error); - bus_describe_intr(dev, intr->vmxi_irq, intr->vmxi_handler, - "rq%d", i); - rxq->vxrxq_intr_idx = intr->vmxi_rid - 1; - } - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jan 22 01:44:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B960114A229B; Tue, 22 Jan 2019 01:44:48 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C3CC8EF45; Tue, 22 Jan 2019 01:44:48 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10AC722420; Tue, 22 Jan 2019 01:44:48 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0M1ilQB043761; Tue, 22 Jan 2019 01:44:47 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M1ilT9043760; Tue, 22 Jan 2019 01:44:47 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901220144.x0M1ilT9043760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 22 Jan 2019 01:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343292 - head/sys/dev/iwn X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/iwn X-SVN-Commit-Revision: 343292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1C3CC8EF45 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 01:44:48 -0000 Author: avos Date: Tue Jan 22 01:44:47 2019 New Revision: 343292 URL: https://svnweb.freebsd.org/changeset/base/343292 Log: iwn(4): drop i_seq field initialization for A-MPDU frames. It is done by net80211 since r319460. MFC after: 24 days X-MFC-With: 343094 Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Tue Jan 22 01:11:17 2019 (r343291) +++ head/sys/dev/iwn/if_iwn.c Tue Jan 22 01:44:47 2019 (r343292) @@ -4587,10 +4587,6 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, stru if (!IEEE80211_AMPDU_RUNNING(tap)) return (EINVAL); - /* NB: clear Fragment Number field. */ - /* XXX move this to net80211 */ - *(uint16_t *)wh->i_seq = 0; - ac = *(int *)tap->txa_private; } From owner-svn-src-head@freebsd.org Tue Jan 22 02:13:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE0D614A5A23; Tue, 22 Jan 2019 02:13:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73F546AAFE; Tue, 22 Jan 2019 02:13:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BE5022A2E; Tue, 22 Jan 2019 02:13:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0M2DYYJ059589; Tue, 22 Jan 2019 02:13:34 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M2DYiP059588; Tue, 22 Jan 2019 02:13:34 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901220213.x0M2DYiP059588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 22 Jan 2019 02:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343295 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 343295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73F546AAFE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 02:13:35 -0000 Author: kp Date: Tue Jan 22 02:13:33 2019 New Revision: 343295 URL: https://svnweb.freebsd.org/changeset/base/343295 Log: pf: Validate psn_len in DIOCGETSRCNODES psn_len is controlled by user space, but we allocated memory based on it. Check how much memory we might need at most (i.e. how many source nodes we have) and limit the allocation to that. Reported by: markj MFC after: 1 week Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Tue Jan 22 02:04:37 2019 (r343294) +++ head/sys/netpfil/pf/pf_ioctl.c Tue Jan 22 02:13:33 2019 (r343295) @@ -3577,14 +3577,18 @@ DIOCCHANGEADDR_error: struct pf_src_node *n, *p, *pstore; uint32_t i, nr = 0; + for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; + i++, sh++) { + PF_HASHROW_LOCK(sh); + LIST_FOREACH(n, &sh->nodes, entry) + nr++; + PF_HASHROW_UNLOCK(sh); + } + + psn->psn_len = min(psn->psn_len, + sizeof(struct pf_src_node) * nr); + if (psn->psn_len == 0) { - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; - i++, sh++) { - PF_HASHROW_LOCK(sh); - LIST_FOREACH(n, &sh->nodes, entry) - nr++; - PF_HASHROW_UNLOCK(sh); - } psn->psn_len = sizeof(struct pf_src_node) * nr; break; } From owner-svn-src-head@freebsd.org Tue Jan 22 02:54:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B618814A9126; Tue, 22 Jan 2019 02:54:00 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59D3B6CBF5; Tue, 22 Jan 2019 02:54:00 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D6252313A; Tue, 22 Jan 2019 02:54:00 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0M2s0Pr080080; Tue, 22 Jan 2019 02:54:00 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M2s099080077; Tue, 22 Jan 2019 02:54:00 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201901220254.x0M2s099080077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Tue, 22 Jan 2019 02:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343296 - head/sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/sbin/pfctl X-SVN-Commit-Revision: 343296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 59D3B6CBF5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 02:54:00 -0000 Author: pkelsey Date: Tue Jan 22 02:53:59 2019 New Revision: 343296 URL: https://svnweb.freebsd.org/changeset/base/343296 Log: Remove unused function gsc_destroy() gsc_destroy() is no longer needed as of r343287. MFC after: 1 week Modified: head/sbin/pfctl/pfctl_altq.c Modified: head/sbin/pfctl/pfctl_altq.c ============================================================================== --- head/sbin/pfctl/pfctl_altq.c Tue Jan 22 02:13:33 2019 (r343295) +++ head/sbin/pfctl/pfctl_altq.c Tue Jan 22 02:53:59 2019 (r343296) @@ -93,7 +93,6 @@ static int check_commit_fairq(int, int, struct pfctl_a static void gsc_add_sc(struct gen_sc *, struct service_curve *); static int is_gsc_under_sc(struct gen_sc *, struct service_curve *); -static void gsc_destroy(struct gen_sc *); static struct segment *gsc_getentry(struct gen_sc *, double); static int gsc_add_seg(struct gen_sc *, double, double, double, double); @@ -1127,17 +1126,6 @@ is_gsc_under_sc(struct gen_sc *gsc, struct service_cur return (0); } return (1); -} - -static void -gsc_destroy(struct gen_sc *gsc) -{ - struct segment *s; - - while ((s = LIST_FIRST(gsc)) != NULL) { - LIST_REMOVE(s, _next); - free(s); - } } /* From owner-svn-src-head@freebsd.org Tue Jan 22 02:56:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2C1614A9306; Tue, 22 Jan 2019 02:56:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8696CE0B; Tue, 22 Jan 2019 02:56:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C1AE23147; Tue, 22 Jan 2019 02:56:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0M2ubt7080257; Tue, 22 Jan 2019 02:56:37 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M2ubm5080256; Tue, 22 Jan 2019 02:56:37 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901220256.x0M2ubm5080256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 22 Jan 2019 02:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343297 - head/tests/sys/netpfil/pf/ioctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf/ioctl X-SVN-Commit-Revision: 343297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4B8696CE0B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 02:56:38 -0000 Author: kp Date: Tue Jan 22 02:56:36 2019 New Revision: 343297 URL: https://svnweb.freebsd.org/changeset/base/343297 Log: pf tests: Check size validation in DIOCGETSRCNODES Ensure that invalid sizes for DIOCGETSRCNODES do not cause panics. MFC after: 1 week Modified: head/tests/sys/netpfil/pf/ioctl/validation.c Modified: head/tests/sys/netpfil/pf/ioctl/validation.c ============================================================================== --- head/tests/sys/netpfil/pf/ioctl/validation.c Tue Jan 22 02:53:59 2019 (r343296) +++ head/tests/sys/netpfil/pf/ioctl/validation.c Tue Jan 22 02:56:36 2019 (r343297) @@ -753,6 +753,38 @@ ATF_TC_CLEANUP(commit, tc) COMMON_CLEANUP(); } +ATF_TC_WITH_CLEANUP(getsrcnodes); +ATF_TC_HEAD(getsrcnodes, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} + +ATF_TC_BODY(getsrcnodes, tc) +{ + struct pfioc_src_nodes psn; + + COMMON_HEAD(); + + bzero(&psn, sizeof(psn)); + + psn.psn_len = -1; + if (ioctl(dev, DIOCGETSRCNODES, &psn) != 0) + atf_tc_fail("request with size -1 failed"); + + psn.psn_len = 1 << 30; + if (ioctl(dev, DIOCGETSRCNODES, &psn) != 0) + atf_tc_fail("request with size << 30 failed"); + + psn.psn_len = 1 << 31; + if (ioctl(dev, DIOCGETSRCNODES, &psn) != 0) + atf_tc_fail("request with size << 30 failed"); +} + +ATF_TC_CLEANUP(getsrcnodes, tc) +{ + COMMON_CLEANUP(); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, addtables); @@ -772,6 +804,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, cxbegin); ATF_TP_ADD_TC(tp, cxrollback); ATF_TP_ADD_TC(tp, commit); + ATF_TP_ADD_TC(tp, getsrcnodes); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Tue Jan 22 03:53:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C635D14AB2C3; Tue, 22 Jan 2019 03:53:43 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60A956F30C; Tue, 22 Jan 2019 03:53:43 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D1A723C2A; Tue, 22 Jan 2019 03:53:43 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0M3rhOG012251; Tue, 22 Jan 2019 03:53:43 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M3rge9012248; Tue, 22 Jan 2019 03:53:42 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901220353.x0M3rge9012248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 22 Jan 2019 03:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343298 - head/sys/compat/ndis X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/compat/ndis X-SVN-Commit-Revision: 343298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 60A956F30C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 03:53:44 -0000 Author: gonzo Date: Tue Jan 22 03:53:42 2019 New Revision: 343298 URL: https://svnweb.freebsd.org/changeset/base/343298 Log: [ndis] Fix unregistered use of FPU by NDIS in kernel on amd64 amd64 miniport drivers are allowed to use FPU which triggers "Unregistered use of FPU in kernel" panic. Wrap all variants of MSCALL with fpu_kern_enter/fpu_kern_leave. To reduce amount of allocations/deallocations done via fpu_kern_alloc_ctx/fpu_kern_free_ctx maintain cache of fpu_kern_ctx elements. Based on the patch by Paul B Mahol PR: 165622 Submitted by: Vlad Movchan MFC after: 1 month Modified: head/sys/compat/ndis/kern_windrv.c head/sys/compat/ndis/pe_var.h Modified: head/sys/compat/ndis/kern_windrv.c ============================================================================== --- head/sys/compat/ndis/kern_windrv.c Tue Jan 22 02:56:36 2019 (r343297) +++ head/sys/compat/ndis/kern_windrv.c Tue Jan 22 03:53:42 2019 (r343298) @@ -58,6 +58,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef __amd64__ +#include +#endif + #include #include @@ -68,6 +72,19 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef __amd64__ +struct fpu_cc_ent { + struct fpu_kern_ctx *ctx; + LIST_ENTRY(fpu_cc_ent) entries; +}; +static LIST_HEAD(fpu_ctx_free, fpu_cc_ent) fpu_free_head = + LIST_HEAD_INITIALIZER(fpu_free_head); +static LIST_HEAD(fpu_ctx_busy, fpu_cc_ent) fpu_busy_head = + LIST_HEAD_INITIALIZER(fpu_busy_head); +static struct mtx fpu_free_mtx; +static struct mtx fpu_busy_mtx; +#endif + static struct mtx drvdb_mtx; static STAILQ_HEAD(drvdb, drvdb_ent) drvdb_head; @@ -98,6 +115,13 @@ windrv_libinit(void) mtx_init(&drvdb_mtx, "Windows driver DB lock", "Windows internal lock", MTX_DEF); +#ifdef __amd64__ + LIST_INIT(&fpu_free_head); + LIST_INIT(&fpu_busy_head); + mtx_init(&fpu_free_mtx, "free fpu context list lock", NULL, MTX_DEF); + mtx_init(&fpu_busy_mtx, "busy fpu context list lock", NULL, MTX_DEF); +#endif + /* * PCI and pccard devices don't need to use IRPs to * interact with their bus drivers (usually), so our @@ -132,6 +156,9 @@ int windrv_libfini(void) { struct drvdb_ent *d; +#ifdef __amd64__ + struct fpu_cc_ent *ent; +#endif mtx_lock(&drvdb_mtx); while(STAILQ_FIRST(&drvdb_head) != NULL) { @@ -150,6 +177,18 @@ windrv_libfini(void) smp_rendezvous(NULL, x86_oldldt, NULL, NULL); ExFreePool(my_tids); #endif +#ifdef __amd64__ + while ((ent = LIST_FIRST(&fpu_free_head)) != NULL) { + LIST_REMOVE(ent, entries); + fpu_kern_free_ctx(ent->ctx); + free(ent, M_DEVBUF); + } + mtx_destroy(&fpu_free_mtx); + + ent = LIST_FIRST(&fpu_busy_head); + KASSERT(ent == NULL, ("busy fpu context list is not empty")); + mtx_destroy(&fpu_busy_mtx); +#endif return (0); } @@ -614,6 +653,148 @@ windrv_wrap(func, wrap, argcnt, ftype) *wrap = p; return (0); +} + +static struct fpu_cc_ent * +request_fpu_cc_ent(void) +{ + struct fpu_cc_ent *ent; + + mtx_lock(&fpu_free_mtx); + if ((ent = LIST_FIRST(&fpu_free_head)) != NULL) { + LIST_REMOVE(ent, entries); + mtx_unlock(&fpu_free_mtx); + mtx_lock(&fpu_busy_mtx); + LIST_INSERT_HEAD(&fpu_busy_head, ent, entries); + mtx_unlock(&fpu_busy_mtx); + return (ent); + } + mtx_unlock(&fpu_free_mtx); + + if ((ent = malloc(sizeof(struct fpu_cc_ent), M_DEVBUF, M_NOWAIT | + M_ZERO)) != NULL) { + ent->ctx = fpu_kern_alloc_ctx(FPU_KERN_NORMAL | + FPU_KERN_NOWAIT); + if (ent->ctx != NULL) { + mtx_lock(&fpu_busy_mtx); + LIST_INSERT_HEAD(&fpu_busy_head, ent, entries); + mtx_unlock(&fpu_busy_mtx); + } else { + free(ent, M_DEVBUF); + ent = NULL; + } + } + + return (ent); +} + +static void +release_fpu_cc_ent(struct fpu_cc_ent *ent) +{ + mtx_lock(&fpu_busy_mtx); + LIST_REMOVE(ent, entries); + mtx_unlock(&fpu_busy_mtx); + mtx_lock(&fpu_free_mtx); + LIST_INSERT_HEAD(&fpu_free_head, ent, entries); + mtx_unlock(&fpu_free_mtx); +} + +uint64_t +_x86_64_call1(void *fn, uint64_t a) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call1(fn, a); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); +} + +uint64_t +_x86_64_call2(void *fn, uint64_t a, uint64_t b) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call2(fn, a, b); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); +} + +uint64_t +_x86_64_call3(void *fn, uint64_t a, uint64_t b, uint64_t c) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call3(fn, a, b, c); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); +} + +uint64_t +_x86_64_call4(void *fn, uint64_t a, uint64_t b, uint64_t c, uint64_t d) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call4(fn, a, b, c, d); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); +} + +uint64_t +_x86_64_call5(void *fn, uint64_t a, uint64_t b, uint64_t c, uint64_t d, + uint64_t e) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call5(fn, a, b, c, d, e); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); +} + +uint64_t +_x86_64_call6(void *fn, uint64_t a, uint64_t b, uint64_t c, uint64_t d, + uint64_t e, uint64_t f) +{ + struct fpu_cc_ent *ent; + uint64_t ret; + + if ((ent = request_fpu_cc_ent()) == NULL) + return (ENOMEM); + fpu_kern_enter(curthread, ent->ctx, FPU_KERN_NORMAL); + ret = x86_64_call6(fn, a, b, c, d, e, f); + fpu_kern_leave(curthread, ent->ctx); + release_fpu_cc_ent(ent); + + return (ret); } #endif /* __amd64__ */ Modified: head/sys/compat/ndis/pe_var.h ============================================================================== --- head/sys/compat/ndis/pe_var.h Tue Jan 22 02:56:36 2019 (r343297) +++ head/sys/compat/ndis/pe_var.h Tue Jan 22 03:53:42 2019 (r343298) @@ -460,22 +460,30 @@ extern uint64_t x86_64_call5(void *, uint64_t, uint64_ extern uint64_t x86_64_call6(void *, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t); +uint64_t _x86_64_call1(void *, uint64_t); +uint64_t _x86_64_call2(void *, uint64_t, uint64_t); +uint64_t _x86_64_call3(void *, uint64_t, uint64_t, uint64_t); +uint64_t _x86_64_call4(void *, uint64_t, uint64_t, uint64_t, uint64_t); +uint64_t _x86_64_call5(void *, uint64_t, uint64_t, uint64_t, uint64_t, + uint64_t); +uint64_t _x86_64_call6(void *, uint64_t, uint64_t, uint64_t, uint64_t, + uint64_t, uint64_t); #define MSCALL1(fn, a) \ - x86_64_call1((fn), (uint64_t)(a)) + _x86_64_call1((fn), (uint64_t)(a)) #define MSCALL2(fn, a, b) \ - x86_64_call2((fn), (uint64_t)(a), (uint64_t)(b)) + _x86_64_call2((fn), (uint64_t)(a), (uint64_t)(b)) #define MSCALL3(fn, a, b, c) \ - x86_64_call3((fn), (uint64_t)(a), (uint64_t)(b), \ + _x86_64_call3((fn), (uint64_t)(a), (uint64_t)(b), \ (uint64_t)(c)) #define MSCALL4(fn, a, b, c, d) \ - x86_64_call4((fn), (uint64_t)(a), (uint64_t)(b), \ + _x86_64_call4((fn), (uint64_t)(a), (uint64_t)(b), \ (uint64_t)(c), (uint64_t)(d)) #define MSCALL5(fn, a, b, c, d, e) \ - x86_64_call5((fn), (uint64_t)(a), (uint64_t)(b), \ + _x86_64_call5((fn), (uint64_t)(a), (uint64_t)(b), \ (uint64_t)(c), (uint64_t)(d), (uint64_t)(e)) #define MSCALL6(fn, a, b, c, d, e, f) \ - x86_64_call6((fn), (uint64_t)(a), (uint64_t)(b), \ + _x86_64_call6((fn), (uint64_t)(a), (uint64_t)(b), \ (uint64_t)(c), (uint64_t)(d), (uint64_t)(e), (uint64_t)(f)) #endif /* __amd64__ */ From owner-svn-src-head@freebsd.org Tue Jan 22 04:36:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EFF214ACA06; Tue, 22 Jan 2019 04:36:20 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35D2E70BC1; Tue, 22 Jan 2019 04:36:20 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 297A524338; Tue, 22 Jan 2019 04:36:20 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0M4aK9c033510; Tue, 22 Jan 2019 04:36:20 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0M4aK57033509; Tue, 22 Jan 2019 04:36:20 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201901220436.x0M4aK57033509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Tue, 22 Jan 2019 04:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343301 - head/sys/modules/vmware/vmxnet3 X-SVN-Group: head X-SVN-Commit-Author: pkelsey X-SVN-Commit-Paths: head/sys/modules/vmware/vmxnet3 X-SVN-Commit-Revision: 343301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 35D2E70BC1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 04:36:20 -0000 Author: pkelsey Date: Tue Jan 22 04:36:19 2019 New Revision: 343301 URL: https://svnweb.freebsd.org/changeset/base/343301 Log: Add missing dependency to vmxnet3 Makefile and clean it up a bit otherwise. MFC after: 1 week Modified: head/sys/modules/vmware/vmxnet3/Makefile Modified: head/sys/modules/vmware/vmxnet3/Makefile ============================================================================== --- head/sys/modules/vmware/vmxnet3/Makefile Tue Jan 22 04:20:52 2019 (r343300) +++ head/sys/modules/vmware/vmxnet3/Makefile Tue Jan 22 04:36:19 2019 (r343301) @@ -27,10 +27,7 @@ KMOD= if_vmx SRCS= if_vmx.c -SRCS+= bus_if.h device_if.h pci_if.h opt_inet.h opt_inet6.h - -# With VMXNET3_LEGACY_TX, the driver will use the non-multiqueue -# capable if_start interface. -#CFLAGS+= -DVMXNET3_LEGACY_TX +SRCS+= bus_if.h device_if.h pci_if.h ifdi_if.h +SRCS+= opt_inet.h opt_inet6.h .include From owner-svn-src-head@freebsd.org Tue Jan 22 12:56:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1278114BBF0D; Tue, 22 Jan 2019 12:56:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73DF78B388; Tue, 22 Jan 2019 12:56:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 634A71944; Tue, 22 Jan 2019 12:56:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0MCuobp095419; Tue, 22 Jan 2019 12:56:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0MCun47095417; Tue, 22 Jan 2019 12:56:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901221256.x0MCun47095417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 22 Jan 2019 12:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343302 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 343302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 73DF78B388 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 12:56:51 -0000 Author: kib Date: Tue Jan 22 12:56:49 2019 New Revision: 343302 URL: https://svnweb.freebsd.org/changeset/base/343302 Log: Remove unused *_sysinit_flags() declarations. Submitted by: Sebastian Huber MFC after: 3 days Modified: head/sys/sys/rmlock.h head/sys/sys/rwlock.h Modified: head/sys/sys/rmlock.h ============================================================================== --- head/sys/sys/rmlock.h Tue Jan 22 04:36:19 2019 (r343301) +++ head/sys/sys/rmlock.h Tue Jan 22 12:56:49 2019 (r343302) @@ -54,7 +54,6 @@ void rm_init_flags(struct rmlock *rm, const char *name void rm_destroy(struct rmlock *rm); int rm_wowned(const struct rmlock *rm); void rm_sysinit(void *arg); -void rm_sysinit_flags(void *arg); void _rm_wlock_debug(struct rmlock *rm, const char *file, int line); void _rm_wunlock_debug(struct rmlock *rm, const char *file, int line); Modified: head/sys/sys/rwlock.h ============================================================================== --- head/sys/sys/rwlock.h Tue Jan 22 04:36:19 2019 (r343301) +++ head/sys/sys/rwlock.h Tue Jan 22 12:56:49 2019 (r343302) @@ -130,7 +130,6 @@ void _rw_init_flags(volatile uintptr_t *c, const char *name, int opts); void _rw_destroy(volatile uintptr_t *c); void rw_sysinit(void *arg); -void rw_sysinit_flags(void *arg); int _rw_wowned(const volatile uintptr_t *c); void _rw_wlock_cookie(volatile uintptr_t *c, const char *file, int line); int __rw_try_wlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF); From owner-svn-src-head@freebsd.org Tue Jan 22 13:11:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1057614814E1; Tue, 22 Jan 2019 13:11:16 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC3988BCD3; Tue, 22 Jan 2019 13:11:15 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FB981B39; Tue, 22 Jan 2019 13:11:15 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0MDBF1p002122; Tue, 22 Jan 2019 13:11:15 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0MDBFic002121; Tue, 22 Jan 2019 13:11:15 GMT (envelope-from se@FreeBSD.org) Message-Id: <201901221311.x0MDBFic002121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Tue, 22 Jan 2019 13:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343303 - head/usr.sbin/kbdmap X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/usr.sbin/kbdmap X-SVN-Commit-Revision: 343303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC3988BCD3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 13:11:16 -0000 Author: se Date: Tue Jan 22 13:11:15 2019 New Revision: 343303 URL: https://svnweb.freebsd.org/changeset/base/343303 Log: Silence a CI warning regarding the use of strcpy(). While this is a false positive (a sufficiently large buffer has been allocated in the line above), the use of strdup() simplifies and clarifies the code. MFC after: 2 weeks Modified: head/usr.sbin/kbdmap/kbdmap.c Modified: head/usr.sbin/kbdmap/kbdmap.c ============================================================================== --- head/usr.sbin/kbdmap/kbdmap.c Tue Jan 22 12:56:49 2019 (r343302) +++ head/usr.sbin/kbdmap/kbdmap.c Tue Jan 22 13:11:15 2019 (r343303) @@ -241,8 +241,7 @@ get_font(void) if (strcmp(buf, "NO")) { if (fnt) free(fnt); - fnt = (char *) malloc(strlen(buf) + 1); - strcpy(fnt, buf); + fnt = strdup(buf); } } } From owner-svn-src-head@freebsd.org Tue Jan 22 17:39:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50F9B14A9777; Tue, 22 Jan 2019 17:39:27 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB35795A44; Tue, 22 Jan 2019 17:39:26 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB69D4B3A; Tue, 22 Jan 2019 17:39:26 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0MHdQX5047361; Tue, 22 Jan 2019 17:39:26 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0MHdQps047360; Tue, 22 Jan 2019 17:39:26 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201901221739.x0MHdQps047360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 22 Jan 2019 17:39:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343305 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 343305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EB35795A44 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 17:39:27 -0000 Author: brooks Date: Tue Jan 22 17:39:26 2019 New Revision: 343305 URL: https://svnweb.freebsd.org/changeset/base/343305 Log: Rework CASE_IOC_IFGROUPREQ() to require a case before the macro. This is more compatible with formatting tools and looks more normal. Reported by: jhb (on a different review) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18442 Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Jan 22 17:34:53 2019 (r343304) +++ head/sys/net/if.c Tue Jan 22 17:39:26 2019 (r343305) @@ -168,14 +168,14 @@ struct ifmediareq32 { #define SIOCGIFXMEDIA32 _IOC_NEWTYPE(SIOCGIFXMEDIA, struct ifmediareq32) #define _CASE_IOC_IFGROUPREQ_32(cmd) \ - case _IOC_NEWTYPE((cmd), struct ifgroupreq32): + _IOC_NEWTYPE((cmd), struct ifgroupreq32): case #else /* !COMPAT_FREEBSD32 */ #define _CASE_IOC_IFGROUPREQ_32(cmd) #endif /* !COMPAT_FREEBSD32 */ #define CASE_IOC_IFGROUPREQ(cmd) \ _CASE_IOC_IFGROUPREQ_32(cmd) \ - case (cmd) + (cmd) union ifreq_union { struct ifreq ifr; @@ -2894,7 +2894,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, error = if_gethwaddr(ifp, ifr); break; - CASE_IOC_IFGROUPREQ(SIOCAIFGROUP): + case CASE_IOC_IFGROUPREQ(SIOCAIFGROUP): error = priv_check(td, PRIV_NET_ADDIFGROUP); if (error) return (error); @@ -2903,12 +2903,12 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, return (error); break; - CASE_IOC_IFGROUPREQ(SIOCGIFGROUP): + case CASE_IOC_IFGROUPREQ(SIOCGIFGROUP): if ((error = if_getgroup((struct ifgroupreq *)data, ifp))) return (error); break; - CASE_IOC_IFGROUPREQ(SIOCDIFGROUP): + case CASE_IOC_IFGROUPREQ(SIOCDIFGROUP): error = priv_check(td, PRIV_NET_DELIFGROUP); if (error) return (error); @@ -3063,7 +3063,7 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s error = if_clone_list((struct if_clonereq *)data); goto out_noref; - CASE_IOC_IFGROUPREQ(SIOCGIFGMEMB): + case CASE_IOC_IFGROUPREQ(SIOCGIFGMEMB): error = if_getgroupmembers((struct ifgroupreq *)data); goto out_noref; From owner-svn-src-head@freebsd.org Tue Jan 22 18:01:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 958B714AA076 for ; Tue, 22 Jan 2019 18:01:30 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A7489667E for ; Tue, 22 Jan 2019 18:01:30 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1548179061; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=oOUBlm9JajN7+0ZEEUbG11uudqQM4GyzgST3k2TCV4TqSG6iaGsUce3MiGtYq5FW1VO+R3/yuo/CH /TjFZbDdhx1tnsMHeoTAkhMZiMuEG6EV53lfErTPZvN5JPIj0ZbCwWckRrBXnVShrA3xDIhztL81fL AJjwRA8i9E12Mrf0N6QW8NOQoYSOqGn+Mqc6OxWD6melk4xmAoPcF5C0FXyYu9dx81TfKv7lD7dBG5 ErkhyyaoeEs50Sr9VypOnRdEGZQwFKKruyoOimXXX1Pth8cyfdgMnkabBXoFDnP4umsQmKOTA1pnDb MrwDukxPUeXxSCUdofneO8yfhyouePg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=y8SE+s26+b5A4cv8r00QVFwFf9GBwxNXwW/UBadoJSo=; b=NIq8YKZaObY1Cudb/12cbj7vSSeWSoVCpDJtmWzMme3nApEzqR2sjG7pAaydBrgWEBRg+AuUvOxks rT29z5NMcK9PErMKKN70HT9s8kaPzTUmzqAZi72CBhJ3HoLG6lmeRTLO9NG137J6jqn9U1tSlij4nY xHKResICkGcQAIheg1ipec8SRiIL/iAWrty2dMtiUK23a6JqcGYLQLE2EnocYU6h52VbommzZq2rQW qExWtnO1HULkggD35j1y6nUzGlAysd+d02gymCAxD7Rr6sKJBGmHecJFQCe3C7iKk1qhWg/f6iQYNr kXQR7mZBysb+6YOyVG3KFso+5Pvj7BA== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=y8SE+s26+b5A4cv8r00QVFwFf9GBwxNXwW/UBadoJSo=; b=ImYpBIqc+Cmgc4L5cjoVg424ZDb7R17/J4TFHRVIc9m0ylyTi/NI6sjoa6GpTXYLWZ+wSx0ScU26S PzgXIrFJFw+V20NmQYF0J0WaHvnx2OQdNRfzbMvAfGKJNlrTKGLjUpXN13/OemcIrZTZ3fNBgsFbO8 qk7sK8YXgJvHIhItCKYTAgT1IEutrJ/KjD8Rboi0ZvwlqvysPNZwlGPWE1klAyPNXZDZRtTg5Mnj6f YSbZeJNHrC+SSer3qT0O6/b8nQ+R2cCLwrU+d3IxES3aapXr2XXkQbY7DpmvpuN0at4eFucGUl7nSa t/f0ZkjUI3dN6jpDgUpgxrT4L08REtA== X-MHO-RoutePath: aGlwcGll X-MHO-User: 588bbae1-1e6d-11e9-befd-af03bedce89f X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 588bbae1-1e6d-11e9-befd-af03bedce89f; Tue, 22 Jan 2019 17:44:20 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x0MHjGPH095249; Tue, 22 Jan 2019 10:45:16 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r343305 - head/sys/net From: Ian Lepore To: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 22 Jan 2019 10:45:16 -0700 In-Reply-To: <201901221739.x0MHdQps047360@repo.freebsd.org> References: <201901221739.x0MHdQps047360@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 1A7489667E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 18:01:30 -0000 On Tue, 2019-01-22 at 17:39 +0000, Brooks Davis wrote: > Author: brooks > Date: Tue Jan 22 17:39:26 2019 > New Revision: 343305 > URL: https://svnweb.freebsd.org/changeset/base/343305 > > Log: > Rework CASE_IOC_IFGROUPREQ() to require a case before the macro. > > This is more compatible with formatting tools and looks more > normal. > > Reported by: jhb (on a different review) > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D18442 > > Modified: > head/sys/net/if.c > > Modified: head/sys/net/if.c > ===================================================================== > ========= > --- head/sys/net/if.c Tue Jan 22 17:34:53 2019 (r343304) > +++ head/sys/net/if.c Tue Jan 22 17:39:26 2019 (r343305) > @@ -168,14 +168,14 @@ struct ifmediareq32 { > #define SIOCGIFXMEDIA32 _IOC_NEWTYPE(SIOCGIFXMEDIA, struct > ifmediareq32) > > #define _CASE_IOC_IFGROUPREQ_32(cmd) > \ > - case _IOC_NEWTYPE((cmd), struct ifgroupreq32): > + _IOC_NEWTYPE((cmd), struct ifgroupreq32): case That 'case' at the end of the line doesn't look right. -- Ian From owner-svn-src-head@freebsd.org Tue Jan 22 18:13:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 597B814AA6D4; Tue, 22 Jan 2019 18:13:04 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8A8A97219; Tue, 22 Jan 2019 18:13:03 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd29.google.com with SMTP id k2so19876420iog.7; Tue, 22 Jan 2019 10:13:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DW0eb+zv2NZxrR/ceid+v2jLLPo6ps51j2M/byTTwBw=; b=sr++J1IC0X7RhuS4eugg3hadqNFOhJgmIBvz7xec2a5zpMeadNWJHQdcsdqRPfRxYr qnq4J2el7FH5oDp+W9VzRxGqQ3Z8JAOBzz0/9aT+2yFfLXUav7L7rTzbfFYB9KB6EY2a NHaBklkH29Dq26ZZnS2K00RLoSBBX5ezB+uYjxm+IPBBuDOqYfjPyMb9RjCZh8KD9eWS p6pPf1/0smiPuXr1t0eOGl8gbBQDgUH6Qgwjk4WqZGs3xpOC24C9lnk61zmz2pOuUfgx tHjQQWtdEX8NBBGw1kwcW7hvqb3BkI05m4viGjmnZFeVQUH2INzP5oWRjwzL43sfB6KT Ek6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=DW0eb+zv2NZxrR/ceid+v2jLLPo6ps51j2M/byTTwBw=; b=cb/VfyfuiiDH53qruEpAqb4hmqhSBj8gs0Ir90NG4Xxf1Bx401Y7QVUWoW+ng4vMdl fiC0OqSVLaPRfPAUYKTcQYnFKo19Cv4c9vuOeNZwwdYIT2D6r+eFinSewCQgGiqCfprx ahSBonpnQBnJp6nO4ZDXEAqwqnUvKo+S2IUnKTtEcw/+hwgo+4Hl6/5ob9+9XKPj2q8r ApNx8T0hu9oCPAS4j22HmuuoFr1DQlzIIzxmuFe/B2fbu9q68FSnREff+9gualJlKfBM 3A2flH6oEeMdQzDq3qEytooUJSVrLC+wXTnm/c4IEQS2FqNFHloBGUQFyRLeRY4dZ5vY JnZQ== X-Gm-Message-State: AJcUukfYOktOZCHQO848h8eAYHJl58I/vnu2fE/bDWKty//XGjqMCgey 6NFOBsvWZQCxsSsJww+lAAeFGcwoEdc= X-Google-Smtp-Source: ALg8bN7/2mgAfEkApR6PmMK18F6tkn78GxmXF0edaI8xB20u6qq4oI9rs/SnQdBlWdTvCEvwxf9elQ== X-Received: by 2002:a6b:f017:: with SMTP id w23mr18090377ioc.12.1548180782782; Tue, 22 Jan 2019 10:13:02 -0800 (PST) Received: from raichu (toroon0560w-lp130-07-64-229-95-98.dsl.bell.ca. [64.229.95.98]) by smtp.gmail.com with ESMTPSA id e21sm8147064itc.6.2019.01.22.10.13.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Jan 2019 10:13:02 -0800 (PST) Sender: Mark Johnston Date: Tue, 22 Jan 2019 13:12:57 -0500 From: Mark Johnston To: Ian Lepore Cc: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343305 - head/sys/net Message-ID: <20190122181257.GA81189@raichu> References: <201901221739.x0MHdQps047360@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: D8A8A97219 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.939,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 18:13:04 -0000 On Tue, Jan 22, 2019 at 10:45:16AM -0700, Ian Lepore wrote: > On Tue, 2019-01-22 at 17:39 +0000, Brooks Davis wrote: > > Author: brooks > > Date: Tue Jan 22 17:39:26 2019 > > New Revision: 343305 > > URL: https://svnweb.freebsd.org/changeset/base/343305 > > > > Log: > > Rework CASE_IOC_IFGROUPREQ() to require a case before the macro. > > > > This is more compatible with formatting tools and looks more > > normal. > > > > Reported by: jhb (on a different review) > > Sponsored by: DARPA, AFRL > > Differential Revision: https://reviews.freebsd.org/D18442 > > > > Modified: > > head/sys/net/if.c > > > > Modified: head/sys/net/if.c > > ===================================================================== > > ========= > > --- head/sys/net/if.c Tue Jan 22 17:34:53 2019 (r343304) > > +++ head/sys/net/if.c Tue Jan 22 17:39:26 2019 (r343305) > > @@ -168,14 +168,14 @@ struct ifmediareq32 { > > #define SIOCGIFXMEDIA32 _IOC_NEWTYPE(SIOCGIFXMEDIA, struct > > ifmediareq32) > > > > #define _CASE_IOC_IFGROUPREQ_32(cmd) > > \ > > - case _IOC_NEWTYPE((cmd), struct ifgroupreq32): > > + _IOC_NEWTYPE((cmd), struct ifgroupreq32): case > > That 'case' at the end of the line doesn't look right. With the change, CASE_IOC_IFGROUPREQ(cmd) yields case 32: case : which seems to be the intent. From owner-svn-src-head@freebsd.org Tue Jan 22 18:57:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5141614AB8C7; Tue, 22 Jan 2019 18:57:22 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC4506A4D8; Tue, 22 Jan 2019 18:57:21 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 00EAB3C475F; Tue, 22 Jan 2019 18:57:14 +0000 (UTC) Date: Tue, 22 Jan 2019 18:57:14 +0000 From: Brooks Davis To: Mark Johnston Cc: Ian Lepore , Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343305 - head/sys/net Message-ID: <20190122185714.GA77653@spindle.one-eyed-alien.net> References: <201901221739.x0MHdQps047360@repo.freebsd.org> <20190122181257.GA81189@raichu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline In-Reply-To: <20190122181257.GA81189@raichu> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: EC4506A4D8 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.92)[-0.923,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 18:57:22 -0000 --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 22, 2019 at 01:12:57PM -0500, Mark Johnston wrote: > On Tue, Jan 22, 2019 at 10:45:16AM -0700, Ian Lepore wrote: > > On Tue, 2019-01-22 at 17:39 +0000, Brooks Davis wrote: > > > Author: brooks > > > Date: Tue Jan 22 17:39:26 2019 > > > New Revision: 343305 > > > URL: https://svnweb.freebsd.org/changeset/base/343305 > > >=20 > > > Log: > > > Rework CASE_IOC_IFGROUPREQ() to require a case before the macro. > > > =20 > > > This is more compatible with formatting tools and looks more > > > normal. > > > =20 > > > Reported by: jhb (on a different review) > > > Sponsored by: DARPA, AFRL > > > Differential Revision: https://reviews.freebsd.org/D18442 > > >=20 > > > Modified: > > > head/sys/net/if.c > > >=20 > > > Modified: head/sys/net/if.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D > > > --- head/sys/net/if.c Tue Jan 22 17:34:53 2019 (r343304) > > > +++ head/sys/net/if.c Tue Jan 22 17:39:26 2019 (r343305) > > > @@ -168,14 +168,14 @@ struct ifmediareq32 { > > > #define SIOCGIFXMEDIA32 _IOC_NEWTYPE(SIOCGIFXMEDIA, struct > > > ifmediareq32) > > > =20 > > > #define _CASE_IOC_IFGROUPREQ_32(cmd) =09 > > > \ > > > - case _IOC_NEWTYPE((cmd), struct ifgroupreq32): > > > + _IOC_NEWTYPE((cmd), struct ifgroupreq32): case > >=20 > > That 'case' at the end of the line doesn't look right. >=20 > With the change, CASE_IOC_IFGROUPREQ(cmd) yields >=20 > case 32: case : >=20 > which seems to be the intent. This is the intent. This macro avoids a pile of #ifdef macros in the actual code (and makes more sense in my upstream branch where I have another set of ioctl values). -- Brooks --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJcR2eKAAoJEKzQXbSebgfAOZMH/AsOazzb8/739uR36FiMCnov 8nJ9RrKUo2QYjvgsoHQi6yW+ol8NzZNyohKZgjt127l70I4Gdes0aovLSi8Rwkjn vaRsu0N4c9DqqVpZvRYPeU6feVC1FGCXie8HHZY8JpLHsJBgXBnZDnGZhodgNFqq xhFBhSBb5AWIOC0VIq1puCc76sTYUcu5KSS60ioxjpFzPH/7Iy34/F+pn2WeqtVU MwKmyxwmQKKC5GmJgIAdGDGD9cDC450p/Gj0Ix7tRx67eOElFfBf+7lHPdoPLbqV 9WLiwMOcyyuLQhgB4A93wowCohvhij8SSKKUxt8NcWEltyIUHHYo876XUUO2B3o= =8ILk -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ-- From owner-svn-src-head@freebsd.org Tue Jan 22 22:39:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F73B14B2188; Tue, 22 Jan 2019 22:39:47 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8A8F74701; Tue, 22 Jan 2019 22:39:46 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE4DD7DD8; Tue, 22 Jan 2019 22:39:46 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0MMdksR006943; Tue, 22 Jan 2019 22:39:46 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0MMdk5l006941; Tue, 22 Jan 2019 22:39:46 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201901222239.x0MMdk5l006941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Tue, 22 Jan 2019 22:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343327 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 343327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C8A8F74701 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2019 22:39:47 -0000 Author: wulf Date: Tue Jan 22 22:39:46 2019 New Revision: 343327 URL: https://svnweb.freebsd.org/changeset/base/343327 Log: Add quirk to enable mic and headphones redirection on HP Spectre laptops. Tested on HP AF006UR. MFC after: 2 weeks Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Tue Jan 22 21:52:07 2019 (r343326) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Tue Jan 22 22:39:46 2019 (r343327) @@ -410,6 +410,18 @@ hdac_pin_patch(struct hdaa_widget *w) patch = "as=1 seq=15"; break; } + } else if (id == HDA_CODEC_ALC295 && subid == HP_AF006UR_SUBVENDOR) { + switch (nid) { + case 18: + patch = "as=2"; + break; + case 25: + patch = "as=2 seq=15"; + break; + case 33: + patch = "as=1 seq=15"; + break; + } } else if (id == HDA_CODEC_ALC298 && subid == DELL_XPS9560_SUBVENDOR) { switch (nid) { case 24: Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Tue Jan 22 21:52:07 2019 (r343326) +++ head/sys/dev/sound/pci/hda/hdac.h Tue Jan 22 22:39:46 2019 (r343327) @@ -188,6 +188,7 @@ #define HP_DV5000_SUBVENDOR HDA_MODEL_CONSTRUCT(HP, 0x30a5) #define HP_DC7700S_SUBVENDOR HDA_MODEL_CONSTRUCT(HP, 0x2801) #define HP_DC7700_SUBVENDOR HDA_MODEL_CONSTRUCT(HP, 0x2802) +#define HP_AF006UR_SUBVENDOR HDA_MODEL_CONSTRUCT(HP, 0x83a2) #define HP_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(HP, 0xffff) /* What is wrong with XN 2563 anyway? (Got the picture ?) */ #define HP_NX6325_SUBVENDORX 0x103c30b0 From owner-svn-src-head@freebsd.org Wed Jan 23 02:09:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7AFA14B7031; Wed, 23 Jan 2019 02:09:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CC8F8446B; Wed, 23 Jan 2019 02:09:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BCE2A11C; Wed, 23 Jan 2019 02:09:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0N29GHM018738; Wed, 23 Jan 2019 02:09:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N29Gaq018737; Wed, 23 Jan 2019 02:09:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901230209.x0N29Gaq018737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 23 Jan 2019 02:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343335 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 343335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6CC8F8446B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 02:09:17 -0000 Author: kevans Date: Wed Jan 23 02:09:15 2019 New Revision: 343335 URL: https://svnweb.freebsd.org/changeset/base/343335 Log: libbe(3): simplify import, allow replication streams Previously, we directly used libzfs_core's lzc_receive to import to a temporary snapshot, then cloned the snapshot and setup the properties. This failed when attempting to import replication streams with questionable error. libzfs's zfs_receive is a much better fit here, so we now use it instead with the destination dataset and let libzfs take care of the dirty details. be_import is greatly simplified as a result. Reported by: Marie Helene Kvello-Aune MFC after: 1 week Modified: head/lib/libbe/be.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Wed Jan 23 01:23:45 2019 (r343334) +++ head/lib/libbe/be.c Wed Jan 23 02:09:15 2019 (r343335) @@ -649,32 +649,14 @@ int be_import(libbe_handle_t *lbh, const char *bootenv, int fd) { char buf[BE_MAXPATHLEN]; - time_t rawtime; nvlist_t *props; zfs_handle_t *zfs; - int err, len; - char nbuf[24]; + recvflags_t flags = { .nomount = 1 }; + int err; - /* - * We don't need this to be incredibly random, just unique enough that - * it won't conflict with an existing dataset name. Chopping time - * down to 32 bits is probably good enough for this. - */ - snprintf(nbuf, 24, "tmp%u", - (uint32_t)(time(NULL) & 0xFFFFFFFF)); - if ((err = be_root_concat(lbh, nbuf, buf)) != 0) - /* - * Technically this is our problem, but we try to use short - * enough names that we won't run into problems except in - * worst-case BE root approaching MAXPATHLEN. - */ - return (set_error(lbh, BE_ERR_PATHLEN)); + be_root_concat(lbh, bootenv, buf); - time(&rawtime); - len = strlen(buf); - strftime(buf + len, sizeof(buf) - len, "@%F-%T", localtime(&rawtime)); - - if ((err = lzc_receive(buf, NULL, NULL, false, fd)) != 0) { + if ((err = zfs_receive(lbh->lzh, buf, NULL, &flags, fd, NULL)) != 0) { switch (err) { case EINVAL: return (set_error(lbh, BE_ERR_NOORIGIN)); @@ -687,39 +669,22 @@ be_import(libbe_handle_t *lbh, const char *bootenv, in } } - if ((zfs = zfs_open(lbh->lzh, buf, ZFS_TYPE_SNAPSHOT)) == NULL) + if ((zfs = zfs_open(lbh->lzh, buf, ZFS_TYPE_FILESYSTEM)) == NULL) return (set_error(lbh, BE_ERR_ZFSOPEN)); nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); nvlist_add_string(props, "mountpoint", "/"); - be_root_concat(lbh, bootenv, buf); - - err = zfs_clone(zfs, buf, props); - zfs_close(zfs); + err = zfs_prop_set_list(zfs, props); nvlist_free(props); - if (err != 0) - return (set_error(lbh, BE_ERR_UNKNOWN)); - - /* - * Finally, we open up the dataset we just cloned the snapshot so that - * we may promote it. This is necessary in order to clean up the ghost - * snapshot that doesn't need to be seen after the operation is - * complete. - */ - if ((zfs = zfs_open(lbh->lzh, buf, ZFS_TYPE_DATASET)) == NULL) - return (set_error(lbh, BE_ERR_ZFSOPEN)); - - err = zfs_promote(zfs); zfs_close(zfs); if (err != 0) return (set_error(lbh, BE_ERR_UNKNOWN)); - /* Clean up the temporary snapshot */ - return (be_destroy(lbh, nbuf, 0)); + return (0); } #if SOON From owner-svn-src-head@freebsd.org Wed Jan 23 02:46:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CC6E14B7ECD; Wed, 23 Jan 2019 02:46:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 427AC85DA0; Wed, 23 Jan 2019 02:46:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31C81A7D3; Wed, 23 Jan 2019 02:46:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0N2kaXK039180; Wed, 23 Jan 2019 02:46:36 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0N2kaCt039179; Wed, 23 Jan 2019 02:46:36 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901230246.x0N2kaCt039179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Wed, 23 Jan 2019 02:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343338 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 343338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 427AC85DA0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 02:46:36 -0000 Author: gonzo Date: Wed Jan 23 02:46:35 2019 New Revision: 343338 URL: https://svnweb.freebsd.org/changeset/base/343338 Log: Fix systat's :only command parser for the multiple arguments case According to systat(1) :only option is supposed to accept multiple drives but the parser for its arguments stops after first entry. Fix the parser logic to accept multiple drives. PR: 59220 Reported by: Andy Farkas MFC after: 1 week Modified: head/usr.bin/systat/devs.c Modified: head/usr.bin/systat/devs.c ============================================================================== --- head/usr.bin/systat/devs.c Wed Jan 23 02:43:49 2019 (r343337) +++ head/usr.bin/systat/devs.c Wed Jan 23 02:46:35 2019 (r343338) @@ -288,7 +288,7 @@ dsselect(const char *args, devstat_select_mode select_ ; if (*cp) *cp++ = '\0'; - if (cp - args == 0) + if (cp - tmpstr1 == 0) break; for (i = 0; i < num_devices; i++) { asprintf(&buffer, "%s%d", dev_select[i].device_name, @@ -312,7 +312,7 @@ dsselect(const char *args, devstat_select_mode select_ } if (i >= num_devices) error("%s: unknown drive", args); - args = cp; + tmpstr1 = cp; } free(tmpstr); From owner-svn-src-head@freebsd.org Wed Jan 23 10:05:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D70A14C154E; Wed, 23 Jan 2019 10:05:28 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 030AA6C30B; Wed, 23 Jan 2019 10:05:28 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC4EDF40C; Wed, 23 Jan 2019 10:05:27 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NA5R0x069932; Wed, 23 Jan 2019 10:05:27 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NA5RTp069931; Wed, 23 Jan 2019 10:05:27 GMT (envelope-from se@FreeBSD.org) Message-Id: <201901231005.x0NA5RTp069931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Wed, 23 Jan 2019 10:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343339 - head/usr.sbin/kbdcontrol X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/usr.sbin/kbdcontrol X-SVN-Commit-Revision: 343339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 030AA6C30B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 10:05:28 -0000 Author: se Date: Wed Jan 23 10:05:27 2019 New Revision: 343339 URL: https://svnweb.freebsd.org/changeset/base/343339 Log: Silence Clang Scan warning about use of unitialized variable. While the warning is a false positive, it is possible to clarify the code by always initializing the variable. This does also allow to make the sending of the "beep" control sequence depend on the validity of its parameters. I have left the redundant assignment of 0 to the now initialized variables in place since this makes the code simpler to understand and does not add any run-time overhead (the compiler completely removes the "else if" test and the assignments). There was an embedded literal escape character in a string, which messes up diplaying the source code on a terminal that interprets ANSI sequences. The literal escape has been replaced by \e (non-standard, but supported by all relevant compilers, and already used in other source files in base). MFC after: 2 weeks Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c ============================================================================== --- head/usr.sbin/kbdcontrol/kbdcontrol.c Wed Jan 23 02:46:35 2019 (r343338) +++ head/usr.sbin/kbdcontrol/kbdcontrol.c Wed Jan 23 10:05:27 2019 (r343339) @@ -961,6 +961,8 @@ set_bell_values(char *opt) int bell, duration, pitch; bell = 0; + duration = 0; + pitch = 0; if (!strncmp(opt, "quiet.", 6)) { bell = CONS_QUIET_BELL; opt += 6; @@ -991,8 +993,8 @@ badopt: } ioctl(0, CONS_BELLTYPE, &bell); - if (!(bell & CONS_VISUAL_BELL)) - fprintf(stderr, "[=%d;%dB", pitch, duration); + if (duration > 0 && pitch > 0) + fprintf(stderr, "\e[=%d;%dB", pitch, duration); } static void From owner-svn-src-head@freebsd.org Wed Jan 23 12:43:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFEBA14A7009; Wed, 23 Jan 2019 12:43:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60E15712BC; Wed, 23 Jan 2019 12:43:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DA3118ED4; Wed, 23 Jan 2019 12:43:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NChlGG053025; Wed, 23 Jan 2019 12:43:47 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NChlul053024; Wed, 23 Jan 2019 12:43:47 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901231243.x0NChlul053024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 23 Jan 2019 12:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343340 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 343340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 60E15712BC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 12:43:48 -0000 Author: avos Date: Wed Jan 23 12:43:46 2019 New Revision: 343340 URL: https://svnweb.freebsd.org/changeset/base/343340 Log: net80211: fix channel list construction for non-auto operating mode. Change the way how channel list mode <-> desired mode match is done: - Match channel list mode for next non-auto desired modes: * 11b: 11g, 11ng, 11acg; * 11a: 11na, 11ac - Add pre-defined channels only when one of the next conditions met: * the desired channel mode is 'auto' or * the desired channel and selected channel list modes are exactly the same or * the previous rule (11g / 11n / 11ac promotion) applies. Before r275875 construction work properly for all except 11ng / 11na / 11acg / 11ac modes - these were broken at all (i.e., the scan list was empty); after r275875 all checks were removed, so scan table was populated by all device-compatible channels (desired mode was ignored). For example, if I will set 'ifconfig wlan0 mode 11ng' for RTL8821AU: - pre-r275875: nothing, scan will not work; - after r275875: both 11ng and 11na bands were scanned; also, since 11b channel list was used, 14th channel was scanned too. - after this change: only 11ng - 1-13 channels - are used for scanning. Tested with: * RTL8188EE, STA mode. * RTL8821AU, STA mode. MFC after: 5 days Modified: head/sys/net80211/ieee80211_scan_sta.c Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Wed Jan 23 10:05:27 2019 (r343339) +++ head/sys/net80211/ieee80211_scan_sta.c Wed Jan 23 12:43:46 2019 (r343340) @@ -472,6 +472,8 @@ static const u_int chanflags[IEEE80211_MODE_MAX] = { /* check legacy */ [IEEE80211_MODE_11NA] = IEEE80211_CHAN_A, [IEEE80211_MODE_11NG] = IEEE80211_CHAN_G, + [IEEE80211_MODE_VHT_5GHZ] = IEEE80211_CHAN_A, + [IEEE80211_MODE_VHT_2GHZ] = IEEE80211_CHAN_G, }; static void @@ -618,32 +620,48 @@ makescanlist(struct ieee80211_scan_state *ss, struct i */ for (scan = table; scan->list != NULL; scan++) { mode = scan->mode; - if (vap->iv_des_mode != IEEE80211_MODE_AUTO) { + + switch (mode) { + case IEEE80211_MODE_11B: + if (vap->iv_des_mode == IEEE80211_MODE_11B) + break; + /* - * If a desired mode was specified, scan only - * channels that satisfy that constraint. + * The scan table marks 2.4Ghz channels as b + * so if the desired mode is 11g / 11ng / 11acg, + * then use the 11b channel list but upgrade the mode. + * + * NB: 11b -> AUTO lets add_channels upgrade an + * 11b channel to 11g if available. */ - if (vap->iv_des_mode != mode) { - /* - * The scan table marks 2.4Ghz channels as b - * so if the desired mode is 11g, then use - * the 11b channel list but upgrade the mode. - */ - if (vap->iv_des_mode == IEEE80211_MODE_11G) { - if (mode == IEEE80211_MODE_11G) /* Skip the G check */ - continue; - else if (mode == IEEE80211_MODE_11B) - mode = IEEE80211_MODE_11G; /* upgrade */ - } + if (vap->iv_des_mode == IEEE80211_MODE_AUTO || + vap->iv_des_mode == IEEE80211_MODE_11G || + vap->iv_des_mode == IEEE80211_MODE_11NG || + vap->iv_des_mode == IEEE80211_MODE_VHT_2GHZ) { + mode = vap->iv_des_mode; + break; } - } else { + + continue; + case IEEE80211_MODE_11A: + /* Use 11a channel list for 11na / 11ac modes */ + if (vap->iv_des_mode == IEEE80211_MODE_11NA || + vap->iv_des_mode == IEEE80211_MODE_VHT_5GHZ) { + mode = vap->iv_des_mode; + break; + } + + /* FALLTHROUGH */ + default: /* - * This lets add_channels upgrade an 11b channel - * to 11g if available. + * If a desired mode was specified, scan only + * channels that satisfy that constraint. */ - if (mode == IEEE80211_MODE_11B) - mode = IEEE80211_MODE_AUTO; + if (vap->iv_des_mode != IEEE80211_MODE_AUTO && + vap->iv_des_mode != mode) + continue; } + #ifdef IEEE80211_F_XR /* XR does not operate on turbo channels */ if ((vap->iv_flags & IEEE80211_F_XR) && From owner-svn-src-head@freebsd.org Wed Jan 23 13:07:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 708CF14A799A; Wed, 23 Jan 2019 13:07:06 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1298571EAC; Wed, 23 Jan 2019 13:07:06 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0664019232; Wed, 23 Jan 2019 13:07:06 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0ND75MF063549; Wed, 23 Jan 2019 13:07:05 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0ND75Yj063548; Wed, 23 Jan 2019 13:07:05 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901231307.x0ND75Yj063548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 23 Jan 2019 13:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343341 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 343341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1298571EAC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 13:07:06 -0000 Author: avos Date: Wed Jan 23 13:07:05 2019 New Revision: 343341 URL: https://svnweb.freebsd.org/changeset/base/343341 Log: ifconfig: drop unused macros from ifieee80211.c MFC after: 5 days Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Wed Jan 23 12:43:46 2019 (r343340) +++ head/sbin/ifconfig/ifieee80211.c Wed Jan 23 13:07:05 2019 (r343341) @@ -1528,9 +1528,6 @@ getmodeflags(const char *val) return flags; } -#define IEEE80211_CHAN_HTA (IEEE80211_CHAN_HT|IEEE80211_CHAN_5GHZ) -#define IEEE80211_CHAN_HTG (IEEE80211_CHAN_HT|IEEE80211_CHAN_2GHZ) - #define _APPLY(_flags, _base, _param, _v) do { \ if (_flags & IEEE80211_CHAN_HT) { \ if ((_flags & (IEEE80211_CHAN_5GHZ|IEEE80211_CHAN_2GHZ)) == 0) {\ @@ -1720,8 +1717,6 @@ DECL_CMD_FUNC(set80211maxretry, val, d) } #undef _APPLY_RATE #undef _APPLY -#undef IEEE80211_CHAN_HTA -#undef IEEE80211_CHAN_HTG static DECL_CMD_FUNC(set80211fragthreshold, val, d) From owner-svn-src-head@freebsd.org Wed Jan 23 13:17:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98C5A14A7CA8; Wed, 23 Jan 2019 13:17:04 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CEAE723D7; Wed, 23 Jan 2019 13:17:04 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32264193D4; Wed, 23 Jan 2019 13:17:04 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NDH3db068960; Wed, 23 Jan 2019 13:17:03 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NDH3Tp068959; Wed, 23 Jan 2019 13:17:03 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901231317.x0NDH3Tp068959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 23 Jan 2019 13:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343342 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 343342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3CEAE723D7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 13:17:04 -0000 Author: avos Date: Wed Jan 23 13:17:03 2019 New Revision: 343342 URL: https://svnweb.freebsd.org/changeset/base/343342 Log: net80211: turn channel mode check into assertion. There is may be only 11b channel (since chanflags[] table maps MODE_AUTO to the corresponding 11b channel flags). Checked with RTL8812AU, STA mode. MFC after: 5 days Modified: head/sys/net80211/ieee80211_scan_sta.c Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Wed Jan 23 13:07:05 2019 (r343341) +++ head/sys/net80211/ieee80211_scan_sta.c Wed Jan 23 13:17:03 2019 (r343342) @@ -496,12 +496,15 @@ add_channels(struct ieee80211vap *vap, if (c == NULL || isexcluded(vap, c)) continue; if (mode == IEEE80211_MODE_AUTO) { + KASSERT(IEEE80211_IS_CHAN_B(c), + ("%s: wrong channel for 'auto' mode %u / %u\n", + __func__, c->ic_freq, c->ic_flags)); + /* * XXX special-case 11b/g channels so we select * the g channel if both are present. */ - if (IEEE80211_IS_CHAN_B(c) && - (cg = find11gchannel(ic, i, c->ic_freq)) != NULL) + if ((cg = find11gchannel(ic, i, c->ic_freq)) != NULL) c = cg; } ss->ss_chans[ss->ss_last++] = c; From owner-svn-src-head@freebsd.org Wed Jan 23 13:18:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C57814A7D70; Wed, 23 Jan 2019 13:18:23 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2F217257F; Wed, 23 Jan 2019 13:18:22 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lj1-f177.google.com with SMTP id s5-v6so1864602ljd.12; Wed, 23 Jan 2019 05:18:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=ltCfjepHYAPGhuZLgAtb/7strNUvXaVT8egdNluQnmg=; b=dl7N63agrti9EZR5zaC8usYOhdxdPLyKEa8mlFUAe9tQfRUTCa9RiG5aMziGMq0nhs 2ect2DdFs38Sy1QQkLXhp2aftpDn2aY+Y2FxFfAGUbee1f/bGMis0UsZvDgshro0vaso tKxoPWLFl4DjtYnrcZ5cAiyLwjPKqn9g47oP0VX1TtwBayKErNN1zhiNmFo4IHITCOgO t1hM76Oyu122NgrBNV5xQUA6KJ2WqfjNuPobfzpjomQVt7Xui0sI0MjlsktQhaRqUEvr DspTT/xFc3uo2d4yOpPoOoFjiFCY69lJcZNIzl8UYEeUk9HcdDZCEro8tdronClgCn5R 4R0w== X-Gm-Message-State: AJcUukdbVnklWyYDPU0TsZOVrkOQhbUEUX1jDpkSo2a7U3MVpTHY2uK+ kII7dPtnPTBbMe1SlnxafiY9BS63qSDDDQ== X-Google-Smtp-Source: ALg8bN4agF/3amtfx5ZoqcoBsHqarNB5CUbuYltsfD7zaKwHoj092aU2OLyvwfukVX67lg0LFkWcuA== X-Received: by 2002:a2e:6595:: with SMTP id e21-v6mr1917128ljf.123.1548249499976; Wed, 23 Jan 2019 05:18:19 -0800 (PST) Received: from localhost (178-133-59-65.dialup.umc.net.ua. [178.133.59.65]) by smtp.gmail.com with ESMTPSA id b21sm477291lfi.7.2019.01.23.05.18.17 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 23 Jan 2019 05:18:19 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343342 - head/sys/net80211 References: <201901231317.x0NDH3Tp068959@repo.freebsd.org> Date: Wed, 23 Jan 2019 15:17:48 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <201901231317.x0NDH3Tp068959@repo.freebsd.org> User-Agent: Opera Mail/12.15 (FreeBSD) X-Rspamd-Queue-Id: D2F217257F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 13:18:23 -0000 Wed, 23 Jan 2019 15:17:03 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Andriy Voskoboinyk = : > Author: avos > Date: Wed Jan 23 13:17:03 2019 > New Revision: 343342 > URL: https://svnweb.freebsd.org/changeset/base/343342 > > Log: > net80211: turn channel mode check into assertion. > There is may be only 11b channel (since chanflags[] table > maps MODE_AUTO to the corresponding 11b channel flags). > Checked with RTL8812AU, STA mode. Typo: this should be RTL8821AU From owner-svn-src-head@freebsd.org Wed Jan 23 14:21:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA9E214A986F; Wed, 23 Jan 2019 14:21:24 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93F7D74B03; Wed, 23 Jan 2019 14:21:24 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88B3219F24; Wed, 23 Jan 2019 14:21:24 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NELO29001361; Wed, 23 Jan 2019 14:21:24 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NELNFd001356; Wed, 23 Jan 2019 14:21:23 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201901231421.x0NELNFd001356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 23 Jan 2019 14:21:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343344 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 343344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 93F7D74B03 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 14:21:25 -0000 Author: vmaffione Date: Wed Jan 23 14:21:23 2019 New Revision: 343344 URL: https://svnweb.freebsd.org/changeset/base/343344 Log: netmap: fix knote() argument to match the mutex state The nm_os_selwakeup function needs to call knote() to wake up kqueue(9) users. However, this function can be called from different code paths, with different lock requirements. This patch fixes the knote() call argument to match the relavant lock state. Also, comments have been updated to reflect current code. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219846 Reported by: Aleksandr Fedorov Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18876 Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Wed Jan 23 14:19:40 2019 (r343343) +++ head/sys/dev/netmap/netmap.c Wed Jan 23 14:21:23 2019 (r343344) @@ -2531,7 +2531,6 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c } nifp = priv->np_nifp; - priv->np_td = td; /* for debugging purposes */ /* return the offset of the netmap_if object */ req->nr_rx_rings = na->num_rx_rings; @@ -3207,8 +3206,8 @@ nmreq_checkoptions(struct nmreq_header *hdr) * * Can be called for one or more queues. * Return true the event mask corresponding to ready events. - * If there are no ready events, do a selrecord on either individual - * selinfo or on the global one. + * If there are no ready events (and 'sr' is not NULL), do a + * selrecord on either individual selinfo or on the global one. * Device-dependent parts (locking and sync of tx/rx rings) * are done through callbacks. * Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Wed Jan 23 14:19:40 2019 (r343343) +++ head/sys/dev/netmap/netmap_freebsd.c Wed Jan 23 14:21:23 2019 (r343344) @@ -85,7 +85,7 @@ void nm_os_selinfo_uninit(NM_SELINFO_T *si) { /* XXX kqueue(9) needed; these will mirror knlist_init. */ - knlist_delete(&si->si.si_note, curthread, 0 /* not locked */ ); + knlist_delete(&si->si.si_note, curthread, /*islocked=*/0); knlist_destroy(&si->si.si_note); /* now we don't need the mutex anymore */ mtx_destroy(&si->m); @@ -1294,21 +1294,21 @@ nm_os_kctx_destroy(struct nm_kctx *nmk) /******************** kqueue support ****************/ /* - * nm_os_selwakeup also needs to issue a KNOTE_UNLOCKED. - * We use a non-zero argument to distinguish the call from the one - * in kevent_scan() which instead also needs to run netmap_poll(). - * The knote uses a global mutex for the time being. We might - * try to reuse the one in the si, but it is not allocated - * permanently so it might be a bit tricky. + * In addition to calling selwakeuppri(), nm_os_selwakeup() also + * needs to call KNOTE to wake up kqueue listeners. + * We use a non-zero 'hint' argument to inform the netmap_knrw() + * function that it is being called from 'nm_os_selwakeup'; this + * is necessary because when netmap_knrw() is called by the kevent + * subsystem (i.e. kevent_scan()) we also need to call netmap_poll(). + * The knote uses a private mutex associated to the 'si' (see struct + * selinfo, struct nm_selinfo, and nm_os_selinfo_init). * - * The *kqfilter function registers one or another f_event - * depending on read or write mode. - * In the call to f_event() td_fpop is NULL so any child function - * calling devfs_get_cdevpriv() would fail - and we need it in - * netmap_poll(). As a workaround we store priv into kn->kn_hook - * and pass it as first argument to netmap_poll(), which then - * uses the failure to tell that we are called from f_event() - * and do not need the selrecord(). + * The netmap_kqfilter() function registers one or another f_event + * depending on read or write mode. A pointer to the struct + * 'netmap_priv_d' is stored into kn->kn_hook, so that it can later + * be passed to netmap_poll(). We pass NULL as a third argument to + * netmap_poll(), so that the latter only runs the txsync/rxsync + * (if necessary), and skips the nm_os_selrecord() calls. */ @@ -1316,12 +1316,13 @@ void nm_os_selwakeup(struct nm_selinfo *si) { if (netmap_verbose) - D("on knote %p", &si->si.si_note); + nm_prinf("on knote %p", &si->si.si_note); selwakeuppri(&si->si, PI_NET); - /* use a non-zero hint to tell the notification from the - * call done in kqueue_scan() which uses 0 + /* We use a non-zero hint to distinguish this notification call + * from the call done in kqueue_scan(), which uses hint=0. */ - KNOTE_UNLOCKED(&si->si.si_note, 0x100 /* notification */); + KNOTE(&si->si.si_note, /*hint=*/0x100, + mtx_owned(&si->m) ? KNF_LISTLOCKED : 0); } void @@ -1337,7 +1338,7 @@ netmap_knrdetach(struct knote *kn) struct selinfo *si = &priv->np_si[NR_RX]->si; D("remove selinfo %p", si); - knlist_remove(&si->si_note, kn, 0); + knlist_remove(&si->si_note, kn, /*islocked=*/0); } static void @@ -1347,14 +1348,15 @@ netmap_knwdetach(struct knote *kn) struct selinfo *si = &priv->np_si[NR_TX]->si; D("remove selinfo %p", si); - knlist_remove(&si->si_note, kn, 0); + knlist_remove(&si->si_note, kn, /*islocked=*/0); } /* - * callback from notifies (generated externally) and our - * calls to kevent(). The former we just return 1 (ready) - * since we do not know better. - * In the latter we call netmap_poll and return 0/1 accordingly. + * Callback triggered by netmap notifications (see netmap_notify()), + * and by the application calling kevent(). In the former case we + * just return 1 (events ready), since we are not able to do better. + * In the latter case we use netmap_poll() to see which events are + * ready. */ static int netmap_knrw(struct knote *kn, long hint, int events) @@ -1363,21 +1365,17 @@ netmap_knrw(struct knote *kn, long hint, int events) int revents; if (hint != 0) { - ND(5, "call from notify"); - return 1; /* assume we are ready */ - } - priv = kn->kn_hook; - /* the notification may come from an external thread, - * in which case we do not want to run the netmap_poll - * This should be filtered above, but check just in case. - */ - if (curthread != priv->np_td) { /* should not happen */ - RD(5, "curthread changed %p %p", curthread, priv->np_td); + /* Called from netmap_notify(), typically from a + * thread different from the one issuing kevent(). + * Assume we are ready. */ return 1; - } else { - revents = netmap_poll(priv, events, NULL); - return (events & revents) ? 1 : 0; } + + /* Called from kevent(). */ + priv = kn->kn_hook; + revents = netmap_poll(priv, events, /*thread=*/NULL); + + return (events & revents) ? 1 : 0; } static int @@ -1408,7 +1406,7 @@ static struct filterops netmap_wfiltops = { /* * This is called when a thread invokes kevent() to record * a change in the configuration of the kqueue(). - * The 'priv' should be the same as in the netmap device. + * The 'priv' is the one associated to the open netmap device. */ static int netmap_kqfilter(struct cdev *dev, struct knote *kn) @@ -1435,16 +1433,11 @@ netmap_kqfilter(struct cdev *dev, struct knote *kn) } /* the si is indicated in the priv */ si = priv->np_si[(ev == EVFILT_WRITE) ? NR_TX : NR_RX]; - // XXX lock(priv) ? kn->kn_fop = (ev == EVFILT_WRITE) ? &netmap_wfiltops : &netmap_rfiltops; kn->kn_hook = priv; - knlist_add(&si->si.si_note, kn, 0); - // XXX unlock(priv) - ND("register %p %s td %p priv %p kn %p np_nifp %p kn_fp/fpop %s", - na, na->ifp->if_xname, curthread, priv, kn, - priv->np_nifp, - kn->kn_fp == curthread->td_fpop ? "match" : "MISMATCH"); + knlist_add(&si->si.si_note, kn, /*islocked=*/0); + return 0; } Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Wed Jan 23 14:19:40 2019 (r343343) +++ head/sys/dev/netmap/netmap_kern.h Wed Jan 23 14:21:23 2019 (r343344) @@ -1946,7 +1946,6 @@ struct netmap_priv_d { * (N entries). */ struct nm_csb_ktoa *np_csb_ktoa_base; - struct thread *np_td; /* kqueue, just debugging */ #ifdef linux struct file *np_filp; /* used by sync kloop */ #endif /* linux */ From owner-svn-src-head@freebsd.org Wed Jan 23 14:51:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 391E914AA891; Wed, 23 Jan 2019 14:51:38 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9FA776001; Wed, 23 Jan 2019 14:51:37 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C53571A439; Wed, 23 Jan 2019 14:51:37 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NEpb1Q019543; Wed, 23 Jan 2019 14:51:37 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NEpb9Y019540; Wed, 23 Jan 2019 14:51:37 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201901231451.x0NEpb9Y019540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 23 Jan 2019 14:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343346 - in head/sys: dev/netmap net X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head/sys: dev/netmap net X-SVN-Commit-Revision: 343346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D9FA776001 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 14:51:38 -0000 Author: vmaffione Date: Wed Jan 23 14:51:36 2019 New Revision: 343346 URL: https://svnweb.freebsd.org/changeset/base/343346 Log: netmap: improvements to the netmap kloop (CSB mode) Changelist: - Add the proper memory barriers in the kloop ring processing functions. - Fix memory barriers usage in the user helpers (nm_sync_kloop_appl_write, nm_sync_kloop_appl_read). - Fix nm_kr_txempty() helper to look at rhead rather than rcur. This is important since the kloop can read a value of rcur which is ahead of the value of rhead (see explanation in nm_sync_kloop_appl_write) - Remove obsolete ptnetmap_guest_write_kring_csb() and ptnet_guest_read_kring_csb(), and update if_ptnet(4) to use those. - Prepare in advance the arguments for netmap_sync_kloop_[tr]x_ring(), to make the kloop faster. - Provide kernel and user implementation for nm_ldld_barrier() and nm_ldst_barrier() MFC after: 2 weeks Modified: head/sys/dev/netmap/if_ptnet.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_kloop.c head/sys/net/netmap.h Modified: head/sys/dev/netmap/if_ptnet.c ============================================================================== --- head/sys/dev/netmap/if_ptnet.c Wed Jan 23 14:22:21 2019 (r343345) +++ head/sys/dev/netmap/if_ptnet.c Wed Jan 23 14:51:36 2019 (r343346) @@ -1688,7 +1688,7 @@ ptnet_ring_update(struct ptnet_queue *pq, struct netma /* Mimic nm_txsync_prologue/nm_rxsync_prologue. */ kring->rcur = kring->rhead = head; - ptnetmap_guest_write_kring_csb(atok, kring->rcur, kring->rhead); + nm_sync_kloop_appl_write(atok, kring->rcur, kring->rhead); /* Kick the host if needed. */ if (NM_ACCESS_ONCE(ktoa->kern_need_kick)) { @@ -1764,7 +1764,12 @@ ptnet_drain_transmit_queue(struct ptnet_queue *pq, uns * the host. */ atok->appl_need_kick = 1; - /* Double-check. */ + /* Double check. We need a full barrier to + * prevent the store to atok->appl_need_kick + * to be reordered with the load from + * ktoa->hwcur and ktoa->hwtail (store-load + * barrier). */ + nm_stld_barrier(); ptnet_sync_tail(ktoa, kring); if (likely(PTNET_TX_NOSPACE(head, kring, minspace))) { @@ -2046,7 +2051,12 @@ host_sync: * last interrupt. */ atok->appl_need_kick = 1; - /* Double-check. */ + /* Double check for more completed RX slots. + * We need a full barrier to prevent the store + * to atok->appl_need_kick to be reordered with + * the load from ktoa->hwcur and ktoa->hwtail + * (store-load barrier). */ + nm_stld_barrier(); ptnet_sync_tail(ktoa, kring); if (likely(head == ring->tail)) { break; Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Wed Jan 23 14:22:21 2019 (r343345) +++ head/sys/dev/netmap/netmap_kern.h Wed Jan 23 14:51:36 2019 (r343346) @@ -1159,7 +1159,7 @@ nm_kr_rxspace(struct netmap_kring *k) static inline int nm_kr_txempty(struct netmap_kring *kring) { - return kring->rcur == kring->nr_hwtail; + return kring->rhead == kring->nr_hwtail; } /* True if no more completed slots in the rx ring, only valid after @@ -2245,61 +2245,14 @@ int ptnet_nm_krings_create(struct netmap_adapter *na); void ptnet_nm_krings_delete(struct netmap_adapter *na); void ptnet_nm_dtor(struct netmap_adapter *na); -/* Guest driver: Write kring pointers (cur, head) to the CSB. - * This routine is coupled with ptnetmap_host_read_kring_csb(). */ +/* Helper function wrapping nm_sync_kloop_appl_read(). */ static inline void -ptnetmap_guest_write_kring_csb(struct nm_csb_atok *atok, uint32_t cur, - uint32_t head) -{ - /* - * We need to write cur and head to the CSB but we cannot do it atomically. - * There is no way we can prevent the host from reading the updated value - * of one of the two and the old value of the other. However, if we make - * sure that the host never reads a value of head more recent than the - * value of cur we are safe. We can allow the host to read a value of cur - * more recent than the value of head, since in the netmap ring cur can be - * ahead of head and cur cannot wrap around head because it must be behind - * tail. Inverting the order of writes below could instead result into the - * host to think head went ahead of cur, which would cause the sync - * prologue to fail. - * - * The following memory barrier scheme is used to make this happen: - * - * Guest Host - * - * STORE(cur) LOAD(head) - * mb() <-----------> mb() - * STORE(head) LOAD(cur) - */ - atok->cur = cur; - nm_stst_barrier(); - atok->head = head; -} - -/* Guest driver: Read kring pointers (hwcur, hwtail) from the CSB. - * This routine is coupled with ptnetmap_host_write_kring_csb(). */ -static inline void -ptnetmap_guest_read_kring_csb(struct nm_csb_ktoa *ktoa, - struct netmap_kring *kring) -{ - /* - * We place a memory barrier to make sure that the update of hwtail never - * overtakes the update of hwcur. - * (see explanation in ptnetmap_host_write_kring_csb). - */ - kring->nr_hwtail = ktoa->hwtail; - nm_stst_barrier(); - kring->nr_hwcur = ktoa->hwcur; -} - -/* Helper function wrapping ptnetmap_guest_read_kring_csb(). */ -static inline void ptnet_sync_tail(struct nm_csb_ktoa *ktoa, struct netmap_kring *kring) { struct netmap_ring *ring = kring->ring; /* Update hwcur and hwtail as known by the host. */ - ptnetmap_guest_read_kring_csb(ktoa, kring); + nm_sync_kloop_appl_read(ktoa, &kring->nr_hwtail, &kring->nr_hwcur); /* nm_sync_finalize */ ring->tail = kring->rtail = kring->nr_hwtail; Modified: head/sys/dev/netmap/netmap_kloop.c ============================================================================== --- head/sys/dev/netmap/netmap_kloop.c Wed Jan 23 14:22:21 2019 (r343345) +++ head/sys/dev/netmap/netmap_kloop.c Wed Jan 23 14:51:36 2019 (r343346) @@ -66,8 +66,12 @@ static inline void sync_kloop_kernel_write(struct nm_csb_ktoa __user *ptr, uint32_t hwcur, uint32_t hwtail) { + /* Issue a first store-store barrier to make sure writes to the + * netmap ring do not overcome updates on ktoa->hwcur and ktoa->hwtail. */ + nm_stst_barrier(); + /* - * The same scheme used in ptnetmap_guest_write_kring_csb() applies here. + * The same scheme used in nm_sync_kloop_appl_write() applies here. * We allow the application to read a value of hwcur more recent than the value * of hwtail, since this would anyway result in a consistent view of the * ring state (and hwcur can never wraparound hwtail, since hwcur must be @@ -75,11 +79,11 @@ sync_kloop_kernel_write(struct nm_csb_ktoa __user *ptr * * The following memory barrier scheme is used to make this happen: * - * Application Kernel + * Application Kernel * - * STORE(hwcur) LOAD(hwtail) - * mb() <-------------> mb() - * STORE(hwtail) LOAD(hwcur) + * STORE(hwcur) LOAD(hwtail) + * wmb() <-------------> rmb() + * STORE(hwtail) LOAD(hwcur) */ CSB_WRITE(ptr, hwcur, hwcur); nm_stst_barrier(); @@ -96,12 +100,16 @@ sync_kloop_kernel_read(struct nm_csb_atok __user *ptr, /* * We place a memory barrier to make sure that the update of head never * overtakes the update of cur. - * (see explanation in ptnetmap_guest_write_kring_csb). + * (see explanation in sync_kloop_kernel_write). */ CSB_READ(ptr, head, shadow_ring->head); - nm_stst_barrier(); + nm_ldld_barrier(); CSB_READ(ptr, cur, shadow_ring->cur); CSB_READ(ptr, sync_flags, shadow_ring->flags); + + /* Make sure that loads from atok->head and atok->cur are not delayed + * after the loads from the netmap ring. */ + nm_ldld_barrier(); } /* Enable or disable application --> kernel kicks. */ @@ -127,10 +135,10 @@ csb_atok_intr_enabled(struct nm_csb_atok __user *csb_a static inline void sync_kloop_kring_dump(const char *title, const struct netmap_kring *kring) { - nm_prinf("%s - name: %s hwcur: %d hwtail: %d " - "rhead: %d rcur: %d rtail: %d", - title, kring->name, kring->nr_hwcur, kring->nr_hwtail, - kring->rhead, kring->rcur, kring->rtail); + nm_prinf("%s, kring %s, hwcur %d, rhead %d, " + "rcur %d, rtail %d, hwtail %d", + title, kring->name, kring->nr_hwcur, kring->rhead, + kring->rcur, kring->rtail, kring->nr_hwtail); } struct sync_kloop_ring_args { @@ -240,7 +248,8 @@ netmap_sync_kloop_tx_ring(const struct sync_kloop_ring */ /* Reenable notifications. */ csb_ktoa_kick_enable(csb_ktoa, 1); - /* Doublecheck. */ + /* Double check, with store-load memory barrier. */ + nm_stld_barrier(); sync_kloop_kernel_read(csb_atok, &shadow_ring, num_slots); if (shadow_ring.head != kring->rhead) { /* We won the race condition, there are more packets to @@ -358,7 +367,8 @@ netmap_sync_kloop_rx_ring(const struct sync_kloop_ring */ /* Reenable notifications. */ csb_ktoa_kick_enable(csb_ktoa, 1); - /* Doublecheck. */ + /* Double check, with store-load memory barrier. */ + nm_stld_barrier(); sync_kloop_kernel_read(csb_atok, &shadow_ring, num_slots); if (!sync_kloop_norxslots(kring, shadow_ring.head)) { /* We won the race condition, more slots are available. Disable @@ -439,6 +449,7 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n struct sync_kloop_poll_ctx *poll_ctx = NULL; #endif /* SYNC_KLOOP_POLL */ int num_rx_rings, num_tx_rings, num_rings; + struct sync_kloop_ring_args *args = NULL; uint32_t sleep_us = req->sleep_us; struct nm_csb_atok* csb_atok_base; struct nm_csb_ktoa* csb_ktoa_base; @@ -488,6 +499,12 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n num_tx_rings = priv->np_qlast[NR_TX] - priv->np_qfirst[NR_TX]; num_rings = num_tx_rings + num_rx_rings; + args = nm_os_malloc(num_rings * sizeof(args[0])); + if (!args) { + err = ENOMEM; + goto out; + } + /* Validate notification options. */ opt = nmreq_findoption((struct nmreq_option *)(uintptr_t)hdr->nr_options, NETMAP_REQ_OPT_SYNC_KLOOP_EVENTFDS); @@ -558,8 +575,8 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n si[NR_TX] = nm_si_user(priv, NR_TX) ? &na->si[NR_TX] : &na->tx_rings[priv->np_qfirst[NR_TX]]->si; NMG_UNLOCK(); - poll_wait(priv->np_filp, si[NR_RX], &poll_ctx->wait_table); poll_wait(priv->np_filp, si[NR_TX], &poll_ctx->wait_table); + poll_wait(priv->np_filp, si[NR_RX], &poll_ctx->wait_table); } #else /* SYNC_KLOOP_POLL */ opt->nro_status = EOPNOTSUPP; @@ -567,6 +584,31 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n #endif /* SYNC_KLOOP_POLL */ } + /* Prepare the arguments for netmap_sync_kloop_tx_ring() + * and netmap_sync_kloop_rx_ring(). */ + for (i = 0; i < num_tx_rings; i++) { + struct sync_kloop_ring_args *a = args + i; + + a->kring = NMR(na, NR_TX)[i + priv->np_qfirst[NR_TX]]; + a->csb_atok = csb_atok_base + i; + a->csb_ktoa = csb_ktoa_base + i; +#ifdef SYNC_KLOOP_POLL + if (poll_ctx) + a->irq_ctx = poll_ctx->entries[i].irq_ctx; +#endif /* SYNC_KLOOP_POLL */ + } + for (i = 0; i < num_rx_rings; i++) { + struct sync_kloop_ring_args *a = args + num_tx_rings + i; + + a->kring = NMR(na, NR_RX)[i + priv->np_qfirst[NR_RX]]; + a->csb_atok = csb_atok_base + num_tx_rings + i; + a->csb_ktoa = csb_ktoa_base + num_tx_rings + i; +#ifdef SYNC_KLOOP_POLL + if (poll_ctx) + a->irq_ctx = poll_ctx->entries[num_tx_rings + i].irq_ctx; +#endif /* SYNC_KLOOP_POLL */ + } + /* Main loop. */ for (;;) { if (unlikely(NM_ACCESS_ONCE(priv->np_kloop_state) & NM_SYNC_KLOOP_STOPPING)) { @@ -574,47 +616,40 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n } #ifdef SYNC_KLOOP_POLL - if (poll_ctx) - __set_current_state(TASK_INTERRUPTIBLE); + if (poll_ctx) { + /* It is important to set the task state as + * interruptible before processing any TX/RX ring, + * so that if a notification on ring Y comes after + * we have processed ring Y, but before we call + * schedule(), we don't miss it. This is true because + * the wake up function will change the the task state, + * and therefore the schedule_timeout() call below + * will observe the change). + */ + set_current_state(TASK_INTERRUPTIBLE); + } #endif /* SYNC_KLOOP_POLL */ /* Process all the TX rings bound to this file descriptor. */ for (i = 0; i < num_tx_rings; i++) { - struct sync_kloop_ring_args a = { - .kring = NMR(na, NR_TX)[i + priv->np_qfirst[NR_TX]], - .csb_atok = csb_atok_base + i, - .csb_ktoa = csb_ktoa_base + i, - }; + struct sync_kloop_ring_args *a = args + i; -#ifdef SYNC_KLOOP_POLL - if (poll_ctx) - a.irq_ctx = poll_ctx->entries[i].irq_ctx; -#endif /* SYNC_KLOOP_POLL */ - if (unlikely(nm_kr_tryget(a.kring, 1, NULL))) { + if (unlikely(nm_kr_tryget(a->kring, 1, NULL))) { continue; } - netmap_sync_kloop_tx_ring(&a); - nm_kr_put(a.kring); + netmap_sync_kloop_tx_ring(a); + nm_kr_put(a->kring); } /* Process all the RX rings bound to this file descriptor. */ for (i = 0; i < num_rx_rings; i++) { - struct sync_kloop_ring_args a = { - .kring = NMR(na, NR_RX)[i + priv->np_qfirst[NR_RX]], - .csb_atok = csb_atok_base + num_tx_rings + i, - .csb_ktoa = csb_ktoa_base + num_tx_rings + i, - }; + struct sync_kloop_ring_args *a = args + num_tx_rings + i; -#ifdef SYNC_KLOOP_POLL - if (poll_ctx) - a.irq_ctx = poll_ctx->entries[num_tx_rings + i].irq_ctx; -#endif /* SYNC_KLOOP_POLL */ - - if (unlikely(nm_kr_tryget(a.kring, 1, NULL))) { + if (unlikely(nm_kr_tryget(a->kring, 1, NULL))) { continue; } - netmap_sync_kloop_rx_ring(&a); - nm_kr_put(a.kring); + netmap_sync_kloop_rx_ring(a); + nm_kr_put(a->kring); } #ifdef SYNC_KLOOP_POLL @@ -622,7 +657,7 @@ netmap_sync_kloop(struct netmap_priv_d *priv, struct n /* If a poll context is present, yield to the scheduler * waiting for a notification to come either from * netmap or the application. */ - schedule_timeout_interruptible(msecs_to_jiffies(1000)); + schedule_timeout(msecs_to_jiffies(20000)); } else #endif /* SYNC_KLOOP_POLL */ { @@ -657,6 +692,11 @@ out: } #endif /* SYNC_KLOOP_POLL */ + if (args) { + nm_os_free(args); + args = NULL; + } + /* Reset the kloop state. */ NMG_LOCK(); priv->np_kloop_state = 0; @@ -719,7 +759,7 @@ netmap_pt_guest_txsync(struct nm_csb_atok *atok, struc * packets. */ kring->nr_hwcur = ktoa->hwcur; - ptnetmap_guest_write_kring_csb(atok, kring->rcur, kring->rhead); + nm_sync_kloop_appl_write(atok, kring->rcur, kring->rhead); /* Ask for a kick from a guest to the host if needed. */ if (((kring->rhead != kring->nr_hwcur || nm_kr_txempty(kring)) @@ -733,7 +773,8 @@ netmap_pt_guest_txsync(struct nm_csb_atok *atok, struc * Second part: reclaim buffers for completed transmissions. */ if (nm_kr_txempty(kring) || (flags & NAF_FORCE_RECLAIM)) { - ptnetmap_guest_read_kring_csb(ktoa, kring); + nm_sync_kloop_appl_read(ktoa, &kring->nr_hwtail, + &kring->nr_hwcur); } /* @@ -744,8 +785,10 @@ netmap_pt_guest_txsync(struct nm_csb_atok *atok, struc if (nm_kr_txempty(kring) && !(kring->nr_kflags & NKR_NOINTR)) { /* Reenable notifications. */ atok->appl_need_kick = 1; - /* Double check */ - ptnetmap_guest_read_kring_csb(ktoa, kring); + /* Double check, with store-load memory barrier. */ + nm_stld_barrier(); + nm_sync_kloop_appl_read(ktoa, &kring->nr_hwtail, + &kring->nr_hwcur); /* If there is new free space, disable notifications */ if (unlikely(!nm_kr_txempty(kring))) { atok->appl_need_kick = 0; @@ -784,7 +827,7 @@ netmap_pt_guest_rxsync(struct nm_csb_atok *atok, struc * hwtail to the hwtail known from the host (read from the CSB). * This also updates the kring hwcur. */ - ptnetmap_guest_read_kring_csb(ktoa, kring); + nm_sync_kloop_appl_read(ktoa, &kring->nr_hwtail, &kring->nr_hwcur); kring->nr_kflags &= ~NKR_PENDINTR; /* @@ -792,8 +835,7 @@ netmap_pt_guest_rxsync(struct nm_csb_atok *atok, struc * released, by updating cur and head in the CSB. */ if (kring->rhead != kring->nr_hwcur) { - ptnetmap_guest_write_kring_csb(atok, kring->rcur, - kring->rhead); + nm_sync_kloop_appl_write(atok, kring->rcur, kring->rhead); /* Ask for a kick from the guest to the host if needed. */ if (NM_ACCESS_ONCE(ktoa->kern_need_kick)) { atok->sync_flags = flags; @@ -809,8 +851,10 @@ netmap_pt_guest_rxsync(struct nm_csb_atok *atok, struc if (nm_kr_rxempty(kring) && !(kring->nr_kflags & NKR_NOINTR)) { /* Reenable notifications. */ atok->appl_need_kick = 1; - /* Double check */ - ptnetmap_guest_read_kring_csb(ktoa, kring); + /* Double check, with store-load memory barrier. */ + nm_stld_barrier(); + nm_sync_kloop_appl_read(ktoa, &kring->nr_hwtail, + &kring->nr_hwcur); /* If there are new slots, disable notifications. */ if (!nm_kr_rxempty(kring)) { atok->appl_need_kick = 0; Modified: head/sys/net/netmap.h ============================================================================== --- head/sys/net/netmap.h Wed Jan 23 14:22:21 2019 (r343345) +++ head/sys/net/netmap.h Wed Jan 23 14:51:36 2019 (r343346) @@ -769,6 +769,8 @@ struct nm_csb_ktoa { #ifdef __KERNEL__ #define nm_stst_barrier smp_wmb +#define nm_ldld_barrier smp_rmb +#define nm_stld_barrier smp_mb #else /* !__KERNEL__ */ static inline void nm_stst_barrier(void) { @@ -777,18 +779,31 @@ static inline void nm_stst_barrier(void) * which is fine for us. */ __atomic_thread_fence(__ATOMIC_RELEASE); } +static inline void nm_ldld_barrier(void) +{ + /* A memory barrier with acquire semantic has the combined + * effect of a load-load barrier and a store-load barrier, + * which is fine for us. */ + __atomic_thread_fence(__ATOMIC_ACQUIRE); +} #endif /* !__KERNEL__ */ #elif defined(__FreeBSD__) #ifdef _KERNEL #define nm_stst_barrier atomic_thread_fence_rel +#define nm_ldld_barrier atomic_thread_fence_acq +#define nm_stld_barrier atomic_thread_fence_seq_cst #else /* !_KERNEL */ #include static inline void nm_stst_barrier(void) { atomic_thread_fence(memory_order_release); } +static inline void nm_ldld_barrier(void) +{ + atomic_thread_fence(memory_order_acquire); +} #endif /* !_KERNEL */ #else /* !__linux__ && !__FreeBSD__ */ @@ -801,6 +816,10 @@ static inline void nm_sync_kloop_appl_write(struct nm_csb_atok *atok, uint32_t cur, uint32_t head) { + /* Issue a first store-store barrier to make sure writes to the + * netmap ring do not overcome updates on atok->cur and atok->head. */ + nm_stst_barrier(); + /* * We need to write cur and head to the CSB but we cannot do it atomically. * There is no way we can prevent the host from reading the updated value @@ -815,11 +834,11 @@ nm_sync_kloop_appl_write(struct nm_csb_atok *atok, uin * * The following memory barrier scheme is used to make this happen: * - * Guest Host + * Guest Host * - * STORE(cur) LOAD(head) - * mb() <-----------> mb() - * STORE(head) LOAD(cur) + * STORE(cur) LOAD(head) + * wmb() <-----------> rmb() + * STORE(head) LOAD(cur) * */ atok->cur = cur; @@ -839,8 +858,12 @@ nm_sync_kloop_appl_read(struct nm_csb_ktoa *ktoa, uint * (see explanation in sync_kloop_kernel_write). */ *hwtail = ktoa->hwtail; - nm_stst_barrier(); + nm_ldld_barrier(); *hwcur = ktoa->hwcur; + + /* Make sure that loads from ktoa->hwtail and ktoa->hwcur are not delayed + * after the loads from the netmap ring. */ + nm_ldld_barrier(); } /* From owner-svn-src-head@freebsd.org Wed Jan 23 16:44:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8AD914ACA45; Wed, 23 Jan 2019 16:44:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E6F7817FF; Wed, 23 Jan 2019 16:44:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 723991B6C9; Wed, 23 Jan 2019 16:44:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NGiLmT078316; Wed, 23 Jan 2019 16:44:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NGiL4H078315; Wed, 23 Jan 2019 16:44:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201901231644.x0NGiL4H078315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 23 Jan 2019 16:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343347 - head/sys/geom/mirror X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/geom/mirror X-SVN-Commit-Revision: 343347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7E6F7817FF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 16:44:22 -0000 Author: cem Date: Wed Jan 23 16:44:21 2019 New Revision: 343347 URL: https://svnweb.freebsd.org/changeset/base/343347 Log: gmirror: Relocate DEVICE_FLAGS to adjacent lines gmirror's sc_flags is shared between some on-disk state and some runtime only state. There's no real reason for that and they could probably be split up. Until they are, locate all of the flags for the same field nearby each other in the source, for clarity. No functional change. Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.h Modified: head/sys/geom/mirror/g_mirror.h ============================================================================== --- head/sys/geom/mirror/g_mirror.h Wed Jan 23 14:51:36 2019 (r343346) +++ head/sys/geom/mirror/g_mirror.h Wed Jan 23 16:44:21 2019 (r343347) @@ -78,6 +78,12 @@ G_MIRROR_DEVICE_FLAG_NOFAILSYNC) #ifdef _KERNEL +#define G_MIRROR_DEVICE_FLAG_DESTROY 0x0100000000000000ULL +#define G_MIRROR_DEVICE_FLAG_DRAIN 0x0200000000000000ULL +#define G_MIRROR_DEVICE_FLAG_CLOSEWAIT 0x0400000000000000ULL +#define G_MIRROR_DEVICE_FLAG_TASTING 0x0800000000000000ULL +#define G_MIRROR_DEVICE_FLAG_WIPE 0x1000000000000000ULL + extern int g_mirror_debug; #define G_MIRROR_DEBUG(lvl, ...) do { \ @@ -166,12 +172,6 @@ struct g_mirror_event { int e_error; TAILQ_ENTRY(g_mirror_event) e_next; }; - -#define G_MIRROR_DEVICE_FLAG_DESTROY 0x0100000000000000ULL -#define G_MIRROR_DEVICE_FLAG_DRAIN 0x0200000000000000ULL -#define G_MIRROR_DEVICE_FLAG_CLOSEWAIT 0x0400000000000000ULL -#define G_MIRROR_DEVICE_FLAG_TASTING 0x0800000000000000ULL -#define G_MIRROR_DEVICE_FLAG_WIPE 0x1000000000000000ULL #define G_MIRROR_DEVICE_STATE_STARTING 0 #define G_MIRROR_DEVICE_STATE_RUNNING 1 From owner-svn-src-head@freebsd.org Wed Jan 23 17:28:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52D7214ADA47; Wed, 23 Jan 2019 17:28:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB4D583021; Wed, 23 Jan 2019 17:28:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D99E31BD88; Wed, 23 Jan 2019 17:28:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NHSdLu099507; Wed, 23 Jan 2019 17:28:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NHSdqH099506; Wed, 23 Jan 2019 17:28:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901231728.x0NHSdqH099506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 23 Jan 2019 17:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343348 - head/sys/dev/ocs_fc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/ocs_fc X-SVN-Commit-Revision: 343348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EB4D583021 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 17:28:40 -0000 Author: markj Date: Wed Jan 23 17:28:39 2019 New Revision: 343348 URL: https://svnweb.freebsd.org/changeset/base/343348 Log: ocs_fc: Ensure that we zero-initialize memory before copying it out. Note that the affected interface is available only to root. admbugs: 765 Reported by: Vlad Tsyrklevich Reviewed by: emaste, ram MFC after: 1 day Security: Kernel memory disclosure Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18914 Modified: head/sys/dev/ocs_fc/ocs_mgmt.c Modified: head/sys/dev/ocs_fc/ocs_mgmt.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 16:44:21 2019 (r343347) +++ head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:28:39 2019 (r343348) @@ -851,6 +851,7 @@ ocs_mgmt_firmware_write(ocs_t *ocs, char *name, void * if (arg_out_length > sizeof(status_str)) { arg_out_length = sizeof(status_str); } + ocs_memset(status_str, 0, sizeof(status_str)); ocs_snprintf(status_str, arg_out_length, "%d", change_status); if (ocs_copy_to_user(arg_out, status_str, arg_out_length)) { ocs_log_test(ocs, "copy to user failed for change_status\n"); From owner-svn-src-head@freebsd.org Wed Jan 23 17:34:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8C7C14ADC1B; Wed, 23 Jan 2019 17:34:03 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AE5C83496; Wed, 23 Jan 2019 17:34:03 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D4871BF29; Wed, 23 Jan 2019 17:34:03 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NHY3Ix004654; Wed, 23 Jan 2019 17:34:03 GMT (envelope-from ram@FreeBSD.org) Received: (from ram@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NHY11I004644; Wed, 23 Jan 2019 17:34:01 GMT (envelope-from ram@FreeBSD.org) Message-Id: <201901231734.x0NHY11I004644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ram set sender to ram@FreeBSD.org using -f From: Ram Kishore Vegesna Date: Wed, 23 Jan 2019 17:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343349 - head/sys/dev/ocs_fc X-SVN-Group: head X-SVN-Commit-Author: ram X-SVN-Commit-Paths: head/sys/dev/ocs_fc X-SVN-Commit-Revision: 343349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9AE5C83496 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 17:34:04 -0000 Author: ram Date: Wed Jan 23 17:34:01 2019 New Revision: 343349 URL: https://svnweb.freebsd.org/changeset/base/343349 Log: Fixed issues reported by coverity scan. Approved by: mav MFC after: 3 weeks Modified: head/sys/dev/ocs_fc/ocs_cam.c head/sys/dev/ocs_fc/ocs_hw.c head/sys/dev/ocs_fc/ocs_hw_queues.c head/sys/dev/ocs_fc/ocs_ioctl.c head/sys/dev/ocs_fc/ocs_mgmt.c head/sys/dev/ocs_fc/ocs_node.c head/sys/dev/ocs_fc/ocs_pci.c head/sys/dev/ocs_fc/ocs_xport.c head/sys/dev/ocs_fc/sli4.c Modified: head/sys/dev/ocs_fc/ocs_cam.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:34:01 2019 (r343349) @@ -1164,15 +1164,24 @@ ocs_scsi_del_target(ocs_node_t *node, ocs_scsi_del_tar struct ocs_softc *ocs = node->ocs; ocs_fcport *fcp = NULL; ocs_fc_target_t *tgt = NULL; - uint32_t tgt_id; + int32_t tgt_id; + if (ocs == NULL) { + ocs_log_err(ocs,"OCS is NULL \n"); + return -1; + } + fcp = node->sport->tgt_data; if (fcp == NULL) { ocs_log_err(ocs,"FCP is NULL \n"); - return 0; + return -1; } tgt_id = ocs_tgt_find(fcp, node); + if (tgt_id == -1) { + ocs_log_err(ocs,"target is invalid\n"); + return -1; + } tgt = &fcp->tgt[tgt_id]; @@ -1781,13 +1790,9 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb *ccb ocs_io_t *io = NULL; ocs_scsi_sgl_t sgl[OCS_FC_MAX_SGL]; int32_t sgl_count; + ocs_fcport *fcp; - ocs_fcport *fcp = NULL; fcp = FCPORT(ocs, cam_sim_bus(xpt_path_sim((ccb)->ccb_h.path))); - if (fcp == NULL) { - device_printf(ocs->dev, "%s: fcp is NULL\n", __func__); - return -1; - } if (fcp->tgt[ccb_h->target_id].state == OCS_TGT_STATE_LOST) { device_printf(ocs->dev, "%s: device LOST %d\n", __func__, @@ -2250,8 +2255,11 @@ ocs_action(struct cam_sim *sim, union ccb *ccb) } case XPT_RESET_BUS: if (ocs_xport_control(ocs->xport, OCS_XPORT_PORT_OFFLINE) == 0) { - ocs_xport_control(ocs->xport, OCS_XPORT_PORT_ONLINE); - + rc = ocs_xport_control(ocs->xport, OCS_XPORT_PORT_ONLINE); + if (rc) { + ocs_log_debug(ocs, "Failed to bring port online" + " : %d\n", rc); + } ocs_set_ccb_status(ccb, CAM_REQ_CMP); } else { ocs_set_ccb_status(ccb, CAM_REQ_CMP_ERR); Modified: head/sys/dev/ocs_fc/ocs_hw.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_hw.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/ocs_hw.c Wed Jan 23 17:34:01 2019 (r343349) @@ -242,10 +242,7 @@ ocs_hw_get_num_chutes(ocs_hw_t *hw) static ocs_hw_rtn_e ocs_hw_link_event_init(ocs_hw_t *hw) { - if (hw == NULL) { - ocs_log_err(hw->os, "bad parameter hw=%p\n", hw); - return OCS_HW_RTN_ERROR; - } + ocs_hw_assert(hw); hw->link.status = SLI_LINK_STATUS_MAX; hw->link.topology = SLI_LINK_TOPO_NONE; @@ -1757,6 +1754,7 @@ ocs_hw_get(ocs_hw_t *hw, ocs_hw_property_e prop, uint3 break; case OCS_HW_MAX_VPORTS: *value = sli_get_max_rsrc(&hw->sli, SLI_RSRC_FCOE_VPI); + break; default: ocs_log_test(hw->os, "unsupported property %#x\n", prop); rc = OCS_HW_RTN_ERROR; @@ -1996,6 +1994,7 @@ ocs_hw_set(ocs_hw_t *hw, ocs_hw_property_e prop, uint3 break; case OCS_ESOC: hw->config.esoc = value; + break; case OCS_HW_HIGH_LOGIN_MODE: rc = sli_set_hlm(&hw->sli, value); break; @@ -4395,7 +4394,7 @@ ocs_hw_send_frame(ocs_hw_t *hw, fc_header_le_t *hdr, u OCS_STAT(wq->use_count++); - return rc ? OCS_HW_RTN_ERROR : OCS_HW_RTN_SUCCESS; + return OCS_HW_RTN_SUCCESS; } ocs_hw_rtn_e @@ -4696,7 +4695,7 @@ ocs_hw_io_overflow_sgl(ocs_hw_t *hw, ocs_hw_io_t *io) } /* fail if we don't have an overflow SGL registered */ - if (io->ovfl_sgl == NULL) { + if (io->ovfl_io == NULL || io->ovfl_sgl == NULL) { return OCS_HW_RTN_ERROR; } @@ -6321,6 +6320,11 @@ ocs_hw_config_watchdog_timer(ocs_hw_t *hw) ocs_hw_rtn_e rc = OCS_HW_RTN_SUCCESS; uint8_t *buf = ocs_malloc(hw->os, SLI4_BMBX_SIZE, OCS_M_NOWAIT); + if (!buf) { + ocs_log_err(hw->os, "no buffer for command\n"); + return OCS_HW_RTN_NO_MEMORY; + } + sli4_cmd_lowlevel_set_watchdog(&hw->sli, buf, SLI4_BMBX_SIZE, hw->watchdog_timeout); rc = ocs_hw_command(hw, buf, OCS_CMD_NOWAIT, ocs_hw_cb_cfg_watchdog, NULL); if (rc) { @@ -8486,7 +8490,14 @@ ocs_hw_cq_process(ocs_hw_t *hw, hw_cq_t *cq) break; case SLI_QENTRY_WQ_RELEASE: { uint32_t wq_id = rid; - uint32_t index = ocs_hw_queue_hash_find(hw->wq_hash, wq_id); + int32_t index = ocs_hw_queue_hash_find(hw->wq_hash, wq_id); + + if (unlikely(index < 0)) { + ocs_log_err(hw->os, "unknown idx=%#x rid=%#x\n", + index, rid); + break; + } + hw_wq_t *wq = hw->hw_wq[index]; /* Submit any HW IOs that are on the WQ pending list */ @@ -9300,7 +9311,8 @@ ocs_hw_cb_link(void *ctx, void *e) hw->link.status = event->status; - for (i = 0; d = hw->domains[i], i < SLI4_MAX_FCFI; i++) { + for (i = 0; i < SLI4_MAX_FCFI; i++) { + d = hw->domains[i]; if (d != NULL && hw->callback.domain != NULL) { hw->callback.domain(hw->args.domain, OCS_HW_DOMAIN_LOST, d); @@ -9322,6 +9334,9 @@ ocs_hw_cb_fip(void *ctx, void *e) ocs_domain_t *domain = NULL; sli4_fip_event_t *event = e; + ocs_hw_assert(event); + ocs_hw_assert(hw); + /* Find the associated domain object */ if (event->type == SLI4_FCOE_FIP_FCF_CLEAR_VLINK) { ocs_domain_t *d = NULL; @@ -9330,7 +9345,8 @@ ocs_hw_cb_fip(void *ctx, void *e) /* Clear VLINK is different from the other FIP events as it passes back * a VPI instead of a FCF index. Check all attached SLI ports for a * matching VPI */ - for (i = 0; d = hw->domains[i], i < SLI4_MAX_FCFI; i++) { + for (i = 0; i < SLI4_MAX_FCFI; i++) { + d = hw->domains[i]; if (d != NULL) { ocs_sport_t *sport = NULL; @@ -11202,6 +11218,7 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t status, ocs_hw_io_t *io_next = NULL; uint64_t ticks_current = ocs_get_os_ticks(); uint32_t sec_elapsed; + ocs_hw_rtn_e rc; sli4_mbox_command_header_t *hdr = (sli4_mbox_command_header_t *)mqe; @@ -11213,34 +11230,39 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t status, /* loop through active WQE list and check for timeouts */ ocs_lock(&hw->io_lock); - ocs_list_foreach_safe(&hw->io_timed_wqe, io, io_next) { - sec_elapsed = ((ticks_current - io->submit_ticks) / ocs_get_os_tick_freq()); + ocs_list_foreach_safe(&hw->io_timed_wqe, io, io_next) { + sec_elapsed = ((ticks_current - io->submit_ticks) / ocs_get_os_tick_freq()); - /* - * If elapsed time > timeout, abort it. No need to check type since - * it wouldn't be on this list unless it was a target WQE - */ - if (sec_elapsed > io->tgt_wqe_timeout) { - ocs_log_test(hw->os, "IO timeout xri=0x%x tag=0x%x type=%d\n", - io->indicator, io->reqtag, io->type); + /* + * If elapsed time > timeout, abort it. No need to check type since + * it wouldn't be on this list unless it was a target WQE + */ + if (sec_elapsed > io->tgt_wqe_timeout) { + ocs_log_test(hw->os, "IO timeout xri=0x%x tag=0x%x type=%d\n", + io->indicator, io->reqtag, io->type); - /* remove from active_wqe list so won't try to abort again */ - ocs_list_remove(&hw->io_timed_wqe, io); + /* remove from active_wqe list so won't try to abort again */ + ocs_list_remove(&hw->io_timed_wqe, io); - /* save status of "timed out" for when abort completes */ - io->status_saved = 1; - io->saved_status = SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT; - io->saved_ext = 0; - io->saved_len = 0; + /* save status of "timed out" for when abort completes */ + io->status_saved = 1; + io->saved_status = SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT; + io->saved_ext = 0; + io->saved_len = 0; - /* now abort outstanding IO */ - ocs_hw_io_abort(hw, io, FALSE, NULL, NULL); + /* now abort outstanding IO */ + rc = ocs_hw_io_abort(hw, io, FALSE, NULL, NULL); + if (rc) { + ocs_log_test(hw->os, + "abort failed xri=%#x tag=%#x rc=%d\n", + io->indicator, io->reqtag, rc); } - /* - * need to go through entire list since each IO could have a - * different timeout value - */ } + /* + * need to go through entire list since each IO could have a + * different timeout value + */ + } ocs_unlock(&hw->io_lock); /* if we're not in the middle of shutting down, schedule next timer */ Modified: head/sys/dev/ocs_fc/ocs_hw_queues.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_hw_queues.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/ocs_hw_queues.c Wed Jan 23 17:34:01 2019 (r343349) @@ -149,13 +149,16 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) default_lengths[QTOP_CQ] = len; break; } + + if (!eq || !next_qt) { + goto fail; + } /* If this CQ is for MRQ, then delay the creation */ if (!use_mrq || next_qt->entry != QTOP_RQ) { cq = hw_new_cq(eq, len); if (cq == NULL) { - hw_queue_teardown(hw); - return OCS_HW_RTN_NO_MEMORY; + goto fail; } } break; @@ -173,11 +176,13 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) hw_queue_teardown(hw); return OCS_HW_RTN_NO_MEMORY; } + + if (cq == NULL) + goto fail; wq = hw_new_wq(cq, len, qt->class, hw->ulp_start + qt->ulp); if (wq == NULL) { - hw_queue_teardown(hw); - return OCS_HW_RTN_NO_MEMORY; + goto fail; } /* Place this WQ on the EQ WQ array */ @@ -249,10 +254,12 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) break; } + if (cq == NULL) + goto fail; + mq = hw_new_mq(cq, len); if (mq == NULL) { - hw_queue_teardown(hw); - return OCS_HW_RTN_NO_MEMORY; + goto fail; } break; @@ -332,6 +339,9 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) } return OCS_HW_RTN_SUCCESS; +fail: + hw_queue_teardown(hw); + return OCS_HW_RTN_NO_MEMORY; } @@ -737,8 +747,9 @@ error: for (i = 0; i < num_rq_pairs; i++) { if (rqs[i] != NULL) { if (rqs[i]->rq_tracker != NULL) { - ocs_free(hw->os, rq->rq_tracker, - sizeof(ocs_hw_sequence_t*) * rq->entry_count); + ocs_free(hw->os, rqs[i]->rq_tracker, + sizeof(ocs_hw_sequence_t*) * + rqs[i]->entry_count); } ocs_free(hw->os, rqs[i], sizeof(*rqs[i])); } @@ -861,9 +872,9 @@ hw_del_wq(hw_wq_t *wq) void hw_del_rq(hw_rq_t *rq) { - ocs_hw_t *hw = rq->cq->eq->hw; if (rq != NULL) { + ocs_hw_t *hw = rq->cq->eq->hw; /* Free RQ tracker */ if (rq->rq_tracker != NULL) { ocs_free(hw->os, rq->rq_tracker, sizeof(ocs_hw_sequence_t*) * rq->entry_count); Modified: head/sys/dev/ocs_fc/ocs_ioctl.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_ioctl.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/ocs_ioctl.c Wed Jan 23 17:34:01 2019 (r343349) @@ -243,9 +243,13 @@ ocs_process_mbx_ioctl(ocs_t *ocs, ocs_ioctl_elxu_mbox_ * 6. ioctl code releases the lock */ mtx_lock(&ocs->dbg_lock); - ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, - __ocs_ioctl_mbox_cb, ocs); - msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); + if (ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, + __ocs_ioctl_mbox_cb, ocs)) { + + device_printf(ocs->dev, "%s: command- %x failed\n", __func__, + ((sli4_mbox_command_header_t *)mcmd->payload)->command); + } + msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); mtx_unlock(&ocs->dbg_lock); if( SLI4_MBOX_COMMAND_SLI_CONFIG == ((sli4_mbox_command_header_t *)mcmd->payload)->command Modified: head/sys/dev/ocs_fc/ocs_mgmt.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:34:01 2019 (r343349) @@ -2129,7 +2129,7 @@ set_port_protocol(ocs_t *ocs, char *name, char *value) if (ocs_sem_p(&(result.semaphore), OCS_SEM_FOREVER) != 0) { /* Undefined failure */ ocs_log_err(ocs, "ocs_sem_p failed\n"); - rc = -ENXIO; + return -ENXIO; } if (result.status == 0) { /* Success. */ @@ -2321,7 +2321,7 @@ set_active_profile(ocs_t *ocs, char *name, char *value if (ocs_sem_p(&(result.semaphore), OCS_SEM_FOREVER) != 0) { /* Undefined failure */ ocs_log_err(ocs, "ocs_sem_p failed\n"); - rc = -ENXIO; + return -ENXIO; } if (result.status == 0) { /* Success. */ @@ -2527,8 +2527,8 @@ set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) char *wwpn_p = NULL; char *wwnn_p = NULL; int32_t rc = -1; - int wwpn; - int wwnn; + int wwpn = 0; + int wwnn = 0; int i; /* This is a read-modify-write operation, so first we have to read @@ -2556,8 +2556,13 @@ set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) wwnn_p = wwn_p; } - wwpn = ocs_strcmp(wwpn_p, "NA"); - wwnn = ocs_strcmp(wwnn_p, "NA"); + if (wwpn_p != NULL) { + wwpn = ocs_strcmp(wwpn_p, "NA"); + } + + if (wwnn_p != NULL) { + wwnn = ocs_strcmp(wwnn_p, "NA"); + } /* Parse the new WWPN */ if ((wwpn_p != NULL) && (wwpn != 0)) { Modified: head/sys/dev/ocs_fc/ocs_node.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_node.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/ocs_node.c Wed Jan 23 17:34:01 2019 (r343349) @@ -253,7 +253,7 @@ ocs_node_create_pool(ocs_t *ocs, uint32_t node_count) if (0 == ocs_hw_get(&ocs->hw, OCS_HW_MAX_SGE, &max_sge) && 0 == ocs_hw_get(&ocs->hw, OCS_HW_N_SGL, &num_sgl)) { - max_xfer_size = max_sge * num_sgl; + max_xfer_size = (max_sge * (uint64_t)num_sgl); } else { max_xfer_size = 65536; } Modified: head/sys/dev/ocs_fc/ocs_pci.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_pci.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/ocs_pci.c Wed Jan 23 17:34:01 2019 (r343349) @@ -591,7 +591,7 @@ ocs_device_detach(ocs_t *ocs) } ocs_cam_detach(ocs); - ocs_free(ocs, ocs->fcports, sizeof(ocs->fcports)); + ocs_free(ocs, ocs->fcports, sizeof(*(ocs->fcports))); for (i = 0; (io = ocs_io_get_instance(ocs, i)); i++) { if (bus_dmamap_destroy(ocs->buf_dmat, io->tgt_io.dmap)) { Modified: head/sys/dev/ocs_fc/ocs_xport.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_xport.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/ocs_xport.c Wed Jan 23 17:34:01 2019 (r343349) @@ -292,10 +292,6 @@ ocs_xport_attach_cleanup: ocs_node_free_pool(ocs); } - if (rq_threads_created) { - ocs_xport_rq_threads_teardown(xport); - } - return -1; } Modified: head/sys/dev/ocs_fc/sli4.c ============================================================================== --- head/sys/dev/ocs_fc/sli4.c Wed Jan 23 17:28:39 2019 (r343348) +++ head/sys/dev/ocs_fc/sli4.c Wed Jan 23 17:34:01 2019 (r343349) @@ -1867,10 +1867,7 @@ sli_cmd_common_create_cq(sli4_t *sli4, void *buf, size } } break; - default: - ocs_log_test(sli4->os, "unsupported IF_TYPE %d\n", if_type); - return -1; - } + } return (sli_config_off + cmd_size); } @@ -4637,6 +4634,8 @@ sli_cq_alloc_set(sli4_t *sli4, sli4_queue_t *qs[], uin return -1; } + memset(&dma, 0, sizeof(dma)); + /* Align the queue DMA memory */ for (i = 0; i < num_cqs; i++) { if (__sli_queue_init(sli4, qs[i], SLI_QTYPE_CQ, SLI4_CQE_BYTES, @@ -4886,7 +4885,7 @@ sli_queue_reset(sli4_t *sli4, sli4_queue_t *q) } if (q->dma.virt != NULL) { - ocs_memset(q->dma.virt, 0, (q->size * q->length)); + ocs_memset(q->dma.virt, 0, (q->size * (uint64_t)q->length)); } ocs_unlock(&q->lock); @@ -8479,6 +8478,8 @@ sli_fc_rq_set_alloc(sli4_t *sli4, uint32_t num_rq_pair ocs_dma_t dma; sli4_res_common_create_queue_set_t *rsp = NULL; sli4_req_fcoe_rq_create_v2_t *req = NULL; + + ocs_memset(&dma, 0, sizeof(dma)); for (i = 0; i < (num_rq_pairs * 2); i++) { if (__sli_queue_init(sli4, qs[i], SLI_QTYPE_RQ, SLI4_FCOE_RQE_SIZE, From owner-svn-src-head@freebsd.org Wed Jan 23 18:53:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 808E714AF876; Wed, 23 Jan 2019 18:53:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA87986248; Wed, 23 Jan 2019 18:53:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A10991CCA2; Wed, 23 Jan 2019 18:53:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NIrDVY047182; Wed, 23 Jan 2019 18:53:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NIrDWK047180; Wed, 23 Jan 2019 18:53:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901231853.x0NIrDWK047180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 23 Jan 2019 18:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343352 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 343352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA87986248 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 18:53:14 -0000 Author: hselasky Date: Wed Jan 23 18:53:13 2019 New Revision: 343352 URL: https://svnweb.freebsd.org/changeset/base/343352 Log: Add USB quirk. Submitted by: Gary Jennejohn MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Wed Jan 23 17:40:12 2019 (r343351) +++ head/sys/dev/usb/quirk/usb_quirk.c Wed Jan 23 18:53:13 2019 (r343352) @@ -278,6 +278,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(IOMEGA, ZIP100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_TEST_UNIT_READY), /* XXX ZIP drives can also use ATAPI */ + USB_QUIRK(JMICRON, JMS566, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(JMICRON, JMS567, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(JMICRON, JM20337, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Jan 23 17:40:12 2019 (r343351) +++ head/sys/dev/usb/usbdevs Wed Jan 23 18:53:13 2019 (r343352) @@ -2646,6 +2646,7 @@ product JATON EDA 0x5704 Ethernet product JETI SPC1201 0x04b2 FTDI compatible adapter /* JMicron products */ +product JMICRON JMS566 0x3569 USB to SATA 3.0Gb/s bridge product JMICRON JMS567 0x0567 USB to SATA 6.0Gb/s bridge product JMICRON JM20336 0x2336 USB to SATA Bridge product JMICRON JM20337 0x2338 USB to ATA/ATAPI Bridge From owner-svn-src-head@freebsd.org Wed Jan 23 18:57:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07F2414AF937; Wed, 23 Jan 2019 18:57:59 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16522863FC; Wed, 23 Jan 2019 18:57:57 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0NIvmup080006; Wed, 23 Jan 2019 10:57:48 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0NIvmbS080005; Wed, 23 Jan 2019 10:57:48 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901231857.x0NIvmbS080005@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343349 - head/sys/dev/ocs_fc In-Reply-To: <201901231734.x0NHY11I004644@repo.freebsd.org> To: Ram Kishore Vegesna Date: Wed, 23 Jan 2019 10:57:48 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 16522863FC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.93)[-0.934,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 18:57:59 -0000 > Author: ram > Date: Wed Jan 23 17:34:01 2019 > New Revision: 343349 > URL: https://svnweb.freebsd.org/changeset/base/343349 > > Log: > Fixed issues reported by coverity scan. The quality of this commit message is rather low, it should of at least included some details about what was wrong, why it was wrong, and how it was fixed. Thanks, Rod > > Approved by: mav > MFC after: 3 weeks > > Modified: > head/sys/dev/ocs_fc/ocs_cam.c > head/sys/dev/ocs_fc/ocs_hw.c > head/sys/dev/ocs_fc/ocs_hw_queues.c > head/sys/dev/ocs_fc/ocs_ioctl.c > head/sys/dev/ocs_fc/ocs_mgmt.c > head/sys/dev/ocs_fc/ocs_node.c > head/sys/dev/ocs_fc/ocs_pci.c > head/sys/dev/ocs_fc/ocs_xport.c > head/sys/dev/ocs_fc/sli4.c > > Modified: head/sys/dev/ocs_fc/ocs_cam.c > ============================================================================== > --- head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -1164,15 +1164,24 @@ ocs_scsi_del_target(ocs_node_t *node, ocs_scsi_del_tar > struct ocs_softc *ocs = node->ocs; > ocs_fcport *fcp = NULL; > ocs_fc_target_t *tgt = NULL; > - uint32_t tgt_id; > + int32_t tgt_id; > > + if (ocs == NULL) { > + ocs_log_err(ocs,"OCS is NULL \n"); > + return -1; > + } > + > fcp = node->sport->tgt_data; > if (fcp == NULL) { > ocs_log_err(ocs,"FCP is NULL \n"); > - return 0; > + return -1; > } > > tgt_id = ocs_tgt_find(fcp, node); > + if (tgt_id == -1) { > + ocs_log_err(ocs,"target is invalid\n"); > + return -1; > + } > > tgt = &fcp->tgt[tgt_id]; > > @@ -1781,13 +1790,9 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb *ccb > ocs_io_t *io = NULL; > ocs_scsi_sgl_t sgl[OCS_FC_MAX_SGL]; > int32_t sgl_count; > + ocs_fcport *fcp; > > - ocs_fcport *fcp = NULL; > fcp = FCPORT(ocs, cam_sim_bus(xpt_path_sim((ccb)->ccb_h.path))); > - if (fcp == NULL) { > - device_printf(ocs->dev, "%s: fcp is NULL\n", __func__); > - return -1; > - } > > if (fcp->tgt[ccb_h->target_id].state == OCS_TGT_STATE_LOST) { > device_printf(ocs->dev, "%s: device LOST %d\n", __func__, > @@ -2250,8 +2255,11 @@ ocs_action(struct cam_sim *sim, union ccb *ccb) > } > case XPT_RESET_BUS: > if (ocs_xport_control(ocs->xport, OCS_XPORT_PORT_OFFLINE) == 0) { > - ocs_xport_control(ocs->xport, OCS_XPORT_PORT_ONLINE); > - > + rc = ocs_xport_control(ocs->xport, OCS_XPORT_PORT_ONLINE); > + if (rc) { > + ocs_log_debug(ocs, "Failed to bring port online" > + " : %d\n", rc); > + } > ocs_set_ccb_status(ccb, CAM_REQ_CMP); > } else { > ocs_set_ccb_status(ccb, CAM_REQ_CMP_ERR); > > Modified: head/sys/dev/ocs_fc/ocs_hw.c > ============================================================================== > --- head/sys/dev/ocs_fc/ocs_hw.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/ocs_hw.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -242,10 +242,7 @@ ocs_hw_get_num_chutes(ocs_hw_t *hw) > static ocs_hw_rtn_e > ocs_hw_link_event_init(ocs_hw_t *hw) > { > - if (hw == NULL) { > - ocs_log_err(hw->os, "bad parameter hw=%p\n", hw); > - return OCS_HW_RTN_ERROR; > - } > + ocs_hw_assert(hw); > > hw->link.status = SLI_LINK_STATUS_MAX; > hw->link.topology = SLI_LINK_TOPO_NONE; > @@ -1757,6 +1754,7 @@ ocs_hw_get(ocs_hw_t *hw, ocs_hw_property_e prop, uint3 > break; > case OCS_HW_MAX_VPORTS: > *value = sli_get_max_rsrc(&hw->sli, SLI_RSRC_FCOE_VPI); > + break; > default: > ocs_log_test(hw->os, "unsupported property %#x\n", prop); > rc = OCS_HW_RTN_ERROR; > @@ -1996,6 +1994,7 @@ ocs_hw_set(ocs_hw_t *hw, ocs_hw_property_e prop, uint3 > break; > case OCS_ESOC: > hw->config.esoc = value; > + break; > case OCS_HW_HIGH_LOGIN_MODE: > rc = sli_set_hlm(&hw->sli, value); > break; > @@ -4395,7 +4394,7 @@ ocs_hw_send_frame(ocs_hw_t *hw, fc_header_le_t *hdr, u > > OCS_STAT(wq->use_count++); > > - return rc ? OCS_HW_RTN_ERROR : OCS_HW_RTN_SUCCESS; > + return OCS_HW_RTN_SUCCESS; > } > > ocs_hw_rtn_e > @@ -4696,7 +4695,7 @@ ocs_hw_io_overflow_sgl(ocs_hw_t *hw, ocs_hw_io_t *io) > } > > /* fail if we don't have an overflow SGL registered */ > - if (io->ovfl_sgl == NULL) { > + if (io->ovfl_io == NULL || io->ovfl_sgl == NULL) { > return OCS_HW_RTN_ERROR; > } > > @@ -6321,6 +6320,11 @@ ocs_hw_config_watchdog_timer(ocs_hw_t *hw) > ocs_hw_rtn_e rc = OCS_HW_RTN_SUCCESS; > uint8_t *buf = ocs_malloc(hw->os, SLI4_BMBX_SIZE, OCS_M_NOWAIT); > > + if (!buf) { > + ocs_log_err(hw->os, "no buffer for command\n"); > + return OCS_HW_RTN_NO_MEMORY; > + } > + > sli4_cmd_lowlevel_set_watchdog(&hw->sli, buf, SLI4_BMBX_SIZE, hw->watchdog_timeout); > rc = ocs_hw_command(hw, buf, OCS_CMD_NOWAIT, ocs_hw_cb_cfg_watchdog, NULL); > if (rc) { > @@ -8486,7 +8490,14 @@ ocs_hw_cq_process(ocs_hw_t *hw, hw_cq_t *cq) > break; > case SLI_QENTRY_WQ_RELEASE: { > uint32_t wq_id = rid; > - uint32_t index = ocs_hw_queue_hash_find(hw->wq_hash, wq_id); > + int32_t index = ocs_hw_queue_hash_find(hw->wq_hash, wq_id); > + > + if (unlikely(index < 0)) { > + ocs_log_err(hw->os, "unknown idx=%#x rid=%#x\n", > + index, rid); > + break; > + } > + > hw_wq_t *wq = hw->hw_wq[index]; > > /* Submit any HW IOs that are on the WQ pending list */ > @@ -9300,7 +9311,8 @@ ocs_hw_cb_link(void *ctx, void *e) > > hw->link.status = event->status; > > - for (i = 0; d = hw->domains[i], i < SLI4_MAX_FCFI; i++) { > + for (i = 0; i < SLI4_MAX_FCFI; i++) { > + d = hw->domains[i]; > if (d != NULL && > hw->callback.domain != NULL) { > hw->callback.domain(hw->args.domain, OCS_HW_DOMAIN_LOST, d); > @@ -9322,6 +9334,9 @@ ocs_hw_cb_fip(void *ctx, void *e) > ocs_domain_t *domain = NULL; > sli4_fip_event_t *event = e; > > + ocs_hw_assert(event); > + ocs_hw_assert(hw); > + > /* Find the associated domain object */ > if (event->type == SLI4_FCOE_FIP_FCF_CLEAR_VLINK) { > ocs_domain_t *d = NULL; > @@ -9330,7 +9345,8 @@ ocs_hw_cb_fip(void *ctx, void *e) > /* Clear VLINK is different from the other FIP events as it passes back > * a VPI instead of a FCF index. Check all attached SLI ports for a > * matching VPI */ > - for (i = 0; d = hw->domains[i], i < SLI4_MAX_FCFI; i++) { > + for (i = 0; i < SLI4_MAX_FCFI; i++) { > + d = hw->domains[i]; > if (d != NULL) { > ocs_sport_t *sport = NULL; > > @@ -11202,6 +11218,7 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t status, > ocs_hw_io_t *io_next = NULL; > uint64_t ticks_current = ocs_get_os_ticks(); > uint32_t sec_elapsed; > + ocs_hw_rtn_e rc; > > sli4_mbox_command_header_t *hdr = (sli4_mbox_command_header_t *)mqe; > > @@ -11213,34 +11230,39 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t status, > > /* loop through active WQE list and check for timeouts */ > ocs_lock(&hw->io_lock); > - ocs_list_foreach_safe(&hw->io_timed_wqe, io, io_next) { > - sec_elapsed = ((ticks_current - io->submit_ticks) / ocs_get_os_tick_freq()); > + ocs_list_foreach_safe(&hw->io_timed_wqe, io, io_next) { > + sec_elapsed = ((ticks_current - io->submit_ticks) / ocs_get_os_tick_freq()); > > - /* > - * If elapsed time > timeout, abort it. No need to check type since > - * it wouldn't be on this list unless it was a target WQE > - */ > - if (sec_elapsed > io->tgt_wqe_timeout) { > - ocs_log_test(hw->os, "IO timeout xri=0x%x tag=0x%x type=%d\n", > - io->indicator, io->reqtag, io->type); > + /* > + * If elapsed time > timeout, abort it. No need to check type since > + * it wouldn't be on this list unless it was a target WQE > + */ > + if (sec_elapsed > io->tgt_wqe_timeout) { > + ocs_log_test(hw->os, "IO timeout xri=0x%x tag=0x%x type=%d\n", > + io->indicator, io->reqtag, io->type); > > - /* remove from active_wqe list so won't try to abort again */ > - ocs_list_remove(&hw->io_timed_wqe, io); > + /* remove from active_wqe list so won't try to abort again */ > + ocs_list_remove(&hw->io_timed_wqe, io); > > - /* save status of "timed out" for when abort completes */ > - io->status_saved = 1; > - io->saved_status = SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT; > - io->saved_ext = 0; > - io->saved_len = 0; > + /* save status of "timed out" for when abort completes */ > + io->status_saved = 1; > + io->saved_status = SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT; > + io->saved_ext = 0; > + io->saved_len = 0; > > - /* now abort outstanding IO */ > - ocs_hw_io_abort(hw, io, FALSE, NULL, NULL); > + /* now abort outstanding IO */ > + rc = ocs_hw_io_abort(hw, io, FALSE, NULL, NULL); > + if (rc) { > + ocs_log_test(hw->os, > + "abort failed xri=%#x tag=%#x rc=%d\n", > + io->indicator, io->reqtag, rc); > } > - /* > - * need to go through entire list since each IO could have a > - * different timeout value > - */ > } > + /* > + * need to go through entire list since each IO could have a > + * different timeout value > + */ > + } > ocs_unlock(&hw->io_lock); > > /* if we're not in the middle of shutting down, schedule next timer */ > > Modified: head/sys/dev/ocs_fc/ocs_hw_queues.c > ============================================================================== > --- head/sys/dev/ocs_fc/ocs_hw_queues.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/ocs_hw_queues.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -149,13 +149,16 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) > default_lengths[QTOP_CQ] = len; > break; > } > + > + if (!eq || !next_qt) { > + goto fail; > + } > > /* If this CQ is for MRQ, then delay the creation */ > if (!use_mrq || next_qt->entry != QTOP_RQ) { > cq = hw_new_cq(eq, len); > if (cq == NULL) { > - hw_queue_teardown(hw); > - return OCS_HW_RTN_NO_MEMORY; > + goto fail; > } > } > break; > @@ -173,11 +176,13 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) > hw_queue_teardown(hw); > return OCS_HW_RTN_NO_MEMORY; > } > + > + if (cq == NULL) > + goto fail; > > wq = hw_new_wq(cq, len, qt->class, hw->ulp_start + qt->ulp); > if (wq == NULL) { > - hw_queue_teardown(hw); > - return OCS_HW_RTN_NO_MEMORY; > + goto fail; > } > > /* Place this WQ on the EQ WQ array */ > @@ -249,10 +254,12 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) > break; > } > > + if (cq == NULL) > + goto fail; > + > mq = hw_new_mq(cq, len); > if (mq == NULL) { > - hw_queue_teardown(hw); > - return OCS_HW_RTN_NO_MEMORY; > + goto fail; > } > break; > > @@ -332,6 +339,9 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) > } > > return OCS_HW_RTN_SUCCESS; > +fail: > + hw_queue_teardown(hw); > + return OCS_HW_RTN_NO_MEMORY; > > } > > @@ -737,8 +747,9 @@ error: > for (i = 0; i < num_rq_pairs; i++) { > if (rqs[i] != NULL) { > if (rqs[i]->rq_tracker != NULL) { > - ocs_free(hw->os, rq->rq_tracker, > - sizeof(ocs_hw_sequence_t*) * rq->entry_count); > + ocs_free(hw->os, rqs[i]->rq_tracker, > + sizeof(ocs_hw_sequence_t*) * > + rqs[i]->entry_count); > } > ocs_free(hw->os, rqs[i], sizeof(*rqs[i])); > } > @@ -861,9 +872,9 @@ hw_del_wq(hw_wq_t *wq) > void > hw_del_rq(hw_rq_t *rq) > { > - ocs_hw_t *hw = rq->cq->eq->hw; > > if (rq != NULL) { > + ocs_hw_t *hw = rq->cq->eq->hw; > /* Free RQ tracker */ > if (rq->rq_tracker != NULL) { > ocs_free(hw->os, rq->rq_tracker, sizeof(ocs_hw_sequence_t*) * rq->entry_count); > > Modified: head/sys/dev/ocs_fc/ocs_ioctl.c > ============================================================================== > --- head/sys/dev/ocs_fc/ocs_ioctl.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/ocs_ioctl.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -243,9 +243,13 @@ ocs_process_mbx_ioctl(ocs_t *ocs, ocs_ioctl_elxu_mbox_ > * 6. ioctl code releases the lock > */ > mtx_lock(&ocs->dbg_lock); > - ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, > - __ocs_ioctl_mbox_cb, ocs); > - msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); > + if (ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, > + __ocs_ioctl_mbox_cb, ocs)) { > + > + device_printf(ocs->dev, "%s: command- %x failed\n", __func__, > + ((sli4_mbox_command_header_t *)mcmd->payload)->command); > + } > + msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); > mtx_unlock(&ocs->dbg_lock); > > if( SLI4_MBOX_COMMAND_SLI_CONFIG == ((sli4_mbox_command_header_t *)mcmd->payload)->command > > Modified: head/sys/dev/ocs_fc/ocs_mgmt.c > ============================================================================== > --- head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -2129,7 +2129,7 @@ set_port_protocol(ocs_t *ocs, char *name, char *value) > if (ocs_sem_p(&(result.semaphore), OCS_SEM_FOREVER) != 0) { > /* Undefined failure */ > ocs_log_err(ocs, "ocs_sem_p failed\n"); > - rc = -ENXIO; > + return -ENXIO; > } > if (result.status == 0) { > /* Success. */ > @@ -2321,7 +2321,7 @@ set_active_profile(ocs_t *ocs, char *name, char *value > if (ocs_sem_p(&(result.semaphore), OCS_SEM_FOREVER) != 0) { > /* Undefined failure */ > ocs_log_err(ocs, "ocs_sem_p failed\n"); > - rc = -ENXIO; > + return -ENXIO; > } > if (result.status == 0) { > /* Success. */ > @@ -2527,8 +2527,8 @@ set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) > char *wwpn_p = NULL; > char *wwnn_p = NULL; > int32_t rc = -1; > - int wwpn; > - int wwnn; > + int wwpn = 0; > + int wwnn = 0; > int i; > > /* This is a read-modify-write operation, so first we have to read > @@ -2556,8 +2556,13 @@ set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) > wwnn_p = wwn_p; > } > > - wwpn = ocs_strcmp(wwpn_p, "NA"); > - wwnn = ocs_strcmp(wwnn_p, "NA"); > + if (wwpn_p != NULL) { > + wwpn = ocs_strcmp(wwpn_p, "NA"); > + } > + > + if (wwnn_p != NULL) { > + wwnn = ocs_strcmp(wwnn_p, "NA"); > + } > > /* Parse the new WWPN */ > if ((wwpn_p != NULL) && (wwpn != 0)) { > > Modified: head/sys/dev/ocs_fc/ocs_node.c > ============================================================================== > --- head/sys/dev/ocs_fc/ocs_node.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/ocs_node.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -253,7 +253,7 @@ ocs_node_create_pool(ocs_t *ocs, uint32_t node_count) > > if (0 == ocs_hw_get(&ocs->hw, OCS_HW_MAX_SGE, &max_sge) && > 0 == ocs_hw_get(&ocs->hw, OCS_HW_N_SGL, &num_sgl)) { > - max_xfer_size = max_sge * num_sgl; > + max_xfer_size = (max_sge * (uint64_t)num_sgl); > } else { > max_xfer_size = 65536; > } > > Modified: head/sys/dev/ocs_fc/ocs_pci.c > ============================================================================== > --- head/sys/dev/ocs_fc/ocs_pci.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/ocs_pci.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -591,7 +591,7 @@ ocs_device_detach(ocs_t *ocs) > } > > ocs_cam_detach(ocs); > - ocs_free(ocs, ocs->fcports, sizeof(ocs->fcports)); > + ocs_free(ocs, ocs->fcports, sizeof(*(ocs->fcports))); > > for (i = 0; (io = ocs_io_get_instance(ocs, i)); i++) { > if (bus_dmamap_destroy(ocs->buf_dmat, io->tgt_io.dmap)) { > > Modified: head/sys/dev/ocs_fc/ocs_xport.c > ============================================================================== > --- head/sys/dev/ocs_fc/ocs_xport.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/ocs_xport.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -292,10 +292,6 @@ ocs_xport_attach_cleanup: > ocs_node_free_pool(ocs); > } > > - if (rq_threads_created) { > - ocs_xport_rq_threads_teardown(xport); > - } > - > return -1; > } > > > Modified: head/sys/dev/ocs_fc/sli4.c > ============================================================================== > --- head/sys/dev/ocs_fc/sli4.c Wed Jan 23 17:28:39 2019 (r343348) > +++ head/sys/dev/ocs_fc/sli4.c Wed Jan 23 17:34:01 2019 (r343349) > @@ -1867,10 +1867,7 @@ sli_cmd_common_create_cq(sli4_t *sli4, void *buf, size > } > } > break; > - default: > - ocs_log_test(sli4->os, "unsupported IF_TYPE %d\n", if_type); > - return -1; > - } > + } > > return (sli_config_off + cmd_size); > } > @@ -4637,6 +4634,8 @@ sli_cq_alloc_set(sli4_t *sli4, sli4_queue_t *qs[], uin > return -1; > } > > + memset(&dma, 0, sizeof(dma)); > + > /* Align the queue DMA memory */ > for (i = 0; i < num_cqs; i++) { > if (__sli_queue_init(sli4, qs[i], SLI_QTYPE_CQ, SLI4_CQE_BYTES, > @@ -4886,7 +4885,7 @@ sli_queue_reset(sli4_t *sli4, sli4_queue_t *q) > } > > if (q->dma.virt != NULL) { > - ocs_memset(q->dma.virt, 0, (q->size * q->length)); > + ocs_memset(q->dma.virt, 0, (q->size * (uint64_t)q->length)); > } > > ocs_unlock(&q->lock); > @@ -8479,6 +8478,8 @@ sli_fc_rq_set_alloc(sli4_t *sli4, uint32_t num_rq_pair > ocs_dma_t dma; > sli4_res_common_create_queue_set_t *rsp = NULL; > sli4_req_fcoe_rq_create_v2_t *req = NULL; > + > + ocs_memset(&dma, 0, sizeof(dma)); > > for (i = 0; i < (num_rq_pairs * 2); i++) { > if (__sli_queue_init(sli4, qs[i], SLI_QTYPE_RQ, SLI4_FCOE_RQE_SIZE, > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Jan 23 18:58:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC63314AF964; Wed, 23 Jan 2019 18:58:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C7928651F; Wed, 23 Jan 2019 18:58:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22A3E1CCAE; Wed, 23 Jan 2019 18:58:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NIwG4Y047438; Wed, 23 Jan 2019 18:58:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NIwGjf047437; Wed, 23 Jan 2019 18:58:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901231858.x0NIwGjf047437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 23 Jan 2019 18:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343353 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 343353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C7928651F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 18:58:18 -0000 Author: markj Date: Wed Jan 23 18:58:15 2019 New Revision: 343353 URL: https://svnweb.freebsd.org/changeset/base/343353 Log: Correct uma_prealloc()'s use of domainset iterators after r339925. The iterator should be reinitialized after every successful slab allocation. A request to advance the iterator is interpreted as an allocation failure, so a sufficiently large preallocation would cause the iterator to believe that all domains were exhausted, resulting in a sleep with the keg lock held. [1] Also, keg_alloc_slab() should pass the unmodified wait flag to the item initialization routine, which may use it to perform allocations from other zones. Reported and tested by: slavah Diagnosed by: kib [1] Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Jan 23 18:53:13 2019 (r343352) +++ head/sys/vm/uma_core.c Wed Jan 23 18:58:15 2019 (r343353) @@ -241,7 +241,7 @@ static void *pcpu_page_alloc(uma_zone_t, vm_size_t, in static void *startup_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); static void page_free(void *, vm_size_t, uint8_t); static void pcpu_page_free(void *, vm_size_t, uint8_t); -static uma_slab_t keg_alloc_slab(uma_keg_t, uma_zone_t, int, int); +static uma_slab_t keg_alloc_slab(uma_keg_t, uma_zone_t, int, int, int); static void cache_drain(uma_zone_t); static void bucket_drain(uma_zone_t, uma_bucket_t); static void bucket_cache_drain(uma_zone_t zone); @@ -1049,20 +1049,22 @@ zone_drain(uma_zone_t zone) * otherwise the keg will be left unlocked. * * Arguments: - * wait Shall we wait? + * flags Wait flags for the item initialization routine + * aflags Wait flags for the slab allocation * * Returns: * The slab that was allocated or NULL if there is no memory and the * caller specified M_NOWAIT. */ static uma_slab_t -keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int domain, int wait) +keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int domain, int flags, + int aflags) { uma_alloc allocf; uma_slab_t slab; unsigned long size; uint8_t *mem; - uint8_t flags; + uint8_t sflags; int i; KASSERT(domain >= 0 && domain < vm_ndomains, @@ -1076,7 +1078,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom slab = NULL; mem = NULL; if (keg->uk_flags & UMA_ZONE_OFFPAGE) { - slab = zone_alloc_item(keg->uk_slabzone, NULL, domain, wait); + slab = zone_alloc_item(keg->uk_slabzone, NULL, domain, aflags); if (slab == NULL) goto out; } @@ -1089,16 +1091,16 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom */ if ((keg->uk_flags & UMA_ZONE_MALLOC) == 0) - wait |= M_ZERO; + aflags |= M_ZERO; else - wait &= ~M_ZERO; + aflags &= ~M_ZERO; if (keg->uk_flags & UMA_ZONE_NODUMP) - wait |= M_NODUMP; + aflags |= M_NODUMP; /* zone is passed for legacy reasons. */ size = keg->uk_ppera * PAGE_SIZE; - mem = allocf(zone, size, domain, &flags, wait); + mem = allocf(zone, size, domain, &sflags, aflags); if (mem == NULL) { if (keg->uk_flags & UMA_ZONE_OFFPAGE) zone_free_item(keg->uk_slabzone, slab, NULL, SKIP_NONE); @@ -1118,7 +1120,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom slab->us_keg = keg; slab->us_data = mem; slab->us_freecount = keg->uk_ipers; - slab->us_flags = flags; + slab->us_flags = sflags; slab->us_domain = domain; BIT_FILL(SLAB_SETSIZE, &slab->us_free); #ifdef INVARIANTS @@ -1128,7 +1130,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int dom if (keg->uk_init != NULL) { for (i = 0; i < keg->uk_ipers; i++) if (keg->uk_init(slab->us_data + (keg->uk_rsize * i), - keg->uk_size, wait) != 0) + keg->uk_size, flags) != 0) break; if (i != keg->uk_ipers) { keg_free_slab(keg, slab, i); @@ -2698,7 +2700,7 @@ restart: zone->uz_items <= zone->uz_max_items, ("%s: zone %p overflow", __func__, zone)); - slab = keg_alloc_slab(keg, zone, domain, aflags); + slab = keg_alloc_slab(keg, zone, domain, flags, aflags); /* * If we got a slab here it's safe to mark it partially used * and return. We assume that the caller is going to remove @@ -3548,24 +3550,34 @@ uma_prealloc(uma_zone_t zone, int items) uma_domain_t dom; uma_slab_t slab; uma_keg_t keg; - int domain, flags, slabs; + int aflags, domain, slabs; KEG_GET(zone, keg); KEG_LOCK(keg); slabs = items / keg->uk_ipers; if (slabs * keg->uk_ipers < items) slabs++; - flags = M_WAITOK; - vm_domainset_iter_policy_ref_init(&di, &keg->uk_dr, &domain, &flags); while (slabs-- > 0) { - slab = keg_alloc_slab(keg, zone, domain, flags); - if (slab == NULL) - return; - MPASS(slab->us_keg == keg); - dom = &keg->uk_domain[slab->us_domain]; - LIST_INSERT_HEAD(&dom->ud_free_slab, slab, us_link); - if (vm_domainset_iter_policy(&di, &domain) != 0) - break; + aflags = M_NOWAIT; + vm_domainset_iter_policy_ref_init(&di, &keg->uk_dr, &domain, + &aflags); + for (;;) { + slab = keg_alloc_slab(keg, zone, domain, M_WAITOK, + aflags); + if (slab != NULL) { + MPASS(slab->us_keg == keg); + dom = &keg->uk_domain[slab->us_domain]; + LIST_INSERT_HEAD(&dom->ud_free_slab, slab, + us_link); + break; + } + KEG_LOCK(keg); + if (vm_domainset_iter_policy(&di, &domain) != 0) { + KEG_UNLOCK(keg); + vm_wait_doms(&keg->uk_dr.dr_policy->ds_mask); + KEG_LOCK(keg); + } + } } KEG_UNLOCK(keg); } From owner-svn-src-head@freebsd.org Wed Jan 23 20:02:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F11814B1601; Wed, 23 Jan 2019 20:02:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14EC288D8E; Wed, 23 Jan 2019 20:02:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 080911D825; Wed, 23 Jan 2019 20:02:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NK2Hqu082969; Wed, 23 Jan 2019 20:02:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NK2HXQ082968; Wed, 23 Jan 2019 20:02:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901232002.x0NK2HXQ082968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 23 Jan 2019 20:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343354 - head/usr.bin/write X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/write X-SVN-Commit-Revision: 343354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 14EC288D8E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 20:02:18 -0000 Author: markj Date: Wed Jan 23 20:02:17 2019 New Revision: 343354 URL: https://svnweb.freebsd.org/changeset/base/343354 Log: Remove extraneous setutxent() calls in write(1). We already call setutxent() once during initialization. Furthermore, the subsequent calls occur after the process has entered capability mode, so they fail, and attempts to fetch database entries fail as a result. PR: 235096 Submitted by: fullermd@over-yonder.net MFC after: 3 days Modified: head/usr.bin/write/write.c Modified: head/usr.bin/write/write.c ============================================================================== --- head/usr.bin/write/write.c Wed Jan 23 18:58:15 2019 (r343353) +++ head/usr.bin/write/write.c Wed Jan 23 20:02:17 2019 (r343354) @@ -204,7 +204,6 @@ utmp_chk(char *user, char *tty) struct utmpx lu, *u; strncpy(lu.ut_line, tty, sizeof lu.ut_line); - setutxent(); while ((u = getutxline(&lu)) != NULL) if (u->ut_type == USER_PROCESS && strcmp(user, u->ut_user) == 0) { @@ -237,7 +236,6 @@ search_utmp(int devfd, char *user, char *tty, char *my bestatime = 0; user_is_me = 0; - setutxent(); while ((u = getutxent()) != NULL) if (u->ut_type == USER_PROCESS && strcmp(user, u->ut_user) == 0) { From owner-svn-src-head@freebsd.org Wed Jan 23 22:00:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B850D14B3CB1; Wed, 23 Jan 2019 22:00:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C6398D1D3; Wed, 23 Jan 2019 22:00:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 170731EBD9; Wed, 23 Jan 2019 22:00:18 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NM0INl041371; Wed, 23 Jan 2019 22:00:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NM0HIq041370; Wed, 23 Jan 2019 22:00:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201901232200.x0NM0HIq041370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Wed, 23 Jan 2019 22:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343362 - head/lib/libc/tests/sys X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libc/tests/sys X-SVN-Commit-Revision: 343362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3C6398D1D3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 22:00:24 -0000 Author: ngie Date: Wed Jan 23 22:00:17 2019 New Revision: 343362 URL: https://svnweb.freebsd.org/changeset/base/343362 Log: Add [initial] functional tests for sendfile(2) as lib/libc/sys/sendfile These testcases exercise a number of functional requirements for sendfile(2). The testcases use IPv4 and IPv6 domain sockets with TCP, and were confirmed functional on UFS and ZFS. UDP address family sockets cannot be used per the sendfile(2) contract, thus using UDP sockets is outside the scope of testing the syscall in positive cases. As seen in `:s_negative_udp_socket_test`, UDP is used to test the sendfile(2) contract to ensure that EINVAL is returned by sendfile(2). The testcases added explicitly avoid testing out `SF_SYNC` due to the complexity of verifying that support. However, this is a good next logical item to verify. The `hdtr_positive*` testcases work to a certain degree (the header testcases pass), but the trailer testcases do not work (it is an expected failure). In particular, the value received by the mock server doesn't match the expected value, and instead looks something like the following (using python array notation): `trailer[:]message[1:]` instead of: `message[:]trailer[:]` This makes me think there's a buffer overrun issue or problem with the offset somewhere in the sendfile(2) system call, but I need to do some other testing first to verify that the code is indeed sane, and my assumptions/code isn't buggy. The `sbytes_negative` testcases that check `sbytes` being set to an invalid value resulting in `EFAULT` fails today as the other change (which checks `copyout(9)`) has not been committed [1]. Thus, it should remain an expected failure (see bug 232210 for more details on this item). Next steps for testing sendfile(2): 1. Fix the header/trailer testcases so that they pass. 2. Setup if_tap interface and test with it, instead of using "localhost", per @asomers's suggestion. 3. Handle short recv(2)'s in `server_cat(..)`. 4. Add `SF_SYNC` support. 5. Add some more negative tests outside the scope of the functional contract. MFC after: 1 month Reviewed by: asomers Approved by: emaste (mentor) PR: 232210 Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D18625 Added: head/lib/libc/tests/sys/sendfile_test.c (contents, props changed) Modified: head/lib/libc/tests/sys/Makefile Modified: head/lib/libc/tests/sys/Makefile ============================================================================== --- head/lib/libc/tests/sys/Makefile Wed Jan 23 20:49:14 2019 (r343361) +++ head/lib/libc/tests/sys/Makefile Wed Jan 23 22:00:17 2019 (r343362) @@ -8,6 +8,7 @@ PACKAGE= tests ATF_TESTS_C+= brk_test .endif ATF_TESTS_C+= queue_test +ATF_TESTS_C+= sendfile_test # TODO: clone, lwp_create, lwp_ctl, posix_fadvise, recvmmsg, # swapcontext Added: head/lib/libc/tests/sys/sendfile_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/sys/sendfile_test.c Wed Jan 23 22:00:17 2019 (r343362) @@ -0,0 +1,1146 @@ +/*- + * Copyright (c) 2018 Enji Cooper. + * All rights reserved. + * + * 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 AUTHOR 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 AUTHOR 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +const char DETERMINISTIC_PATTERN[] = + "The past is already gone, the future is not yet here. There's only one moment for you to live.\n"; + +#define SOURCE_FILE "source" +#define DESTINATION_FILE "dest" + +#define PORTRANGE_FIRST "net.inet.ip.portrange.first" +#define PORTRANGE_LAST "net.inet.ip.portrange.last" + +static int portrange_first, portrange_last; + +static int +get_int_via_sysctlbyname(const char *oidname) +{ + size_t oldlen; + int int_value; + + ATF_REQUIRE_EQ_MSG(sysctlbyname(oidname, &int_value, &oldlen, NULL, 0), + 0, "sysctlbyname(%s, ...) failed: %s", oidname, strerror(errno)); + ATF_REQUIRE_EQ_MSG(sizeof(int_value), oldlen, "sanity check failed"); + + return (int_value); +} + +static int +generate_random_port(int seed) +{ + int random_port; + + printf("Generating a random port with seed=%d\n", seed); + if (portrange_first == 0) { + portrange_first = get_int_via_sysctlbyname(PORTRANGE_FIRST); + printf("Port range lower bound: %d\n", portrange_first); + } + + if (portrange_last == 0) { + portrange_last = get_int_via_sysctlbyname(PORTRANGE_LAST); + printf("Port range upper bound: %d\n", portrange_last); + } + + srand((unsigned)seed); + + random_port = rand() % (portrange_last - portrange_first) + + portrange_first; + + printf("Random port generated: %d\n", random_port); + return (random_port); +} + +static void +resolve_localhost(struct addrinfo **res, int domain, int type, int port) +{ + char *serv; + struct addrinfo hints; + int error; + + ATF_REQUIRE_MSG(domain == AF_INET || domain == AF_INET6, + "unhandled domain: %d", domain); + + ATF_REQUIRE_MSG(asprintf(&serv, "%d", port) >= 0, + "asprintf failed: %s", strerror(errno)); + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = domain; + hints.ai_flags = AI_ADDRCONFIG|AI_NUMERICSERV; + hints.ai_socktype = type; + + error = getaddrinfo("localhost", serv, &hints, res); + ATF_REQUIRE_EQ_MSG(error, 0, + "getaddrinfo failed: %s", gai_strerror(errno)); + free(serv); +} + +static int +make_socket(int domain, int type, int protocol) +{ + int sock; + + sock = socket(domain, type, protocol); + ATF_REQUIRE_MSG(sock != -1, "socket(%d, %d, 0) failed: %s", + domain, type, strerror(errno)); + + return (sock); +} + +static int +setup_client(int domain, int type, int port) +{ + struct addrinfo *res; + char host[NI_MAXHOST+1]; + int error, sock; + + resolve_localhost(&res, domain, type, port); + error = getnameinfo( + (const struct sockaddr*)res->ai_addr, res->ai_addrlen, + host, nitems(host) - 1, NULL, 0, NI_NUMERICHOST); + ATF_REQUIRE_EQ_MSG(error, 0, + "getnameinfo failed: %s", gai_strerror(error)); + printf( + "Will try to connect to host='%s', address_family=%d, " + "socket_type=%d\n", + host, res->ai_family, res->ai_socktype); + sock = make_socket(res->ai_family, res->ai_socktype, res->ai_protocol); + error = connect(sock, (struct sockaddr*)res->ai_addr, res->ai_addrlen); + freeaddrinfo(res); + ATF_REQUIRE_EQ_MSG(error, 0, "connect failed: %s", strerror(errno)); + return (sock); +} + +/* + * XXX: use linear probing to find a free port and eliminate `port` argument as + * a [const] int (it will need to be a pointer so it can be passed back out of + * the function and can influence which port `setup_client(..)` connects on. + */ +static int +setup_server(int domain, int type, int port) +{ + struct addrinfo *res; + char host[NI_MAXHOST+1]; + int error, sock; + + resolve_localhost(&res, domain, type, port); + sock = make_socket(res->ai_family, res->ai_socktype, res->ai_protocol); + + error = getnameinfo( + (const struct sockaddr*)res->ai_addr, res->ai_addrlen, + host, nitems(host) - 1, NULL, 0, NI_NUMERICHOST); + ATF_REQUIRE_EQ_MSG(error, 0, + "getnameinfo failed: %s", gai_strerror(error)); + printf( + "Will try to bind socket to host='%s', address_family=%d, " + "socket_type=%d\n", + host, res->ai_family, res->ai_socktype); + error = bind(sock, res->ai_addr, res->ai_addrlen); + freeaddrinfo(res); + ATF_REQUIRE_EQ_MSG(error, 0, "bind failed: %s", strerror(errno)); + error = listen(sock, 1); + ATF_REQUIRE_EQ_MSG(error, 0, "listen failed: %s", strerror(errno)); + + return (sock); +} + +/* + * This function is a helper routine for taking data being sent by `sendfile` via + * `server_sock`, and pushing the received stream out to a file, denoted by + * `dest_filename`. + */ +static void +server_cat(const char *dest_filename, int server_sock, size_t len) +{ + void *buffer; + int recv_sock; + ssize_t received_bytes; + + buffer = calloc(len + 1, sizeof(char)); + if (buffer == NULL) + err(1, "malloc failed"); + + recv_sock = accept(server_sock, NULL, 0); + if (recv_sock == -1) + err(1, "accept failed"); + + /* + * XXX: this assumes the simplest case where all data is received in a + * single recv(2) call. + */ + if (recv(recv_sock, buffer, len, 0) == -1) + err(1, "recv failed"); + + atf_utils_create_file(dest_filename, "%s", buffer); + + /* + * This recv(2) call helps ensure the amount of sent data is exactly + * what was specified by `len`. + */ + received_bytes = recv(recv_sock, buffer, len, 0); + switch (received_bytes) { + case -1: + err(1, "recv failed"); + case 0: + break; + default: + errx(1, "received unexpected data: %s", buffer); + } + + (void)close(recv_sock); + (void)close(server_sock); + free(buffer); +} + +static int +setup_tcp_server(int domain, int port) +{ + + return (setup_server(domain, SOCK_STREAM, port)); +} + +static int +setup_tcp_client(int domain, int port) +{ + + return (setup_client(domain, SOCK_STREAM, port)); +} + +static off_t +file_size_from_fd(int fd) +{ + struct stat st; + + ATF_REQUIRE_EQ_MSG(0, fstat(fd, &st), + "fstat failed: %s", strerror(errno)); + + return (st.st_size); +} + +/* + * NB: `nbytes` == 0 has special connotations given the sendfile(2) API + * contract. In short, "send the whole file" (paraphrased). + */ +static void +verify_source_and_dest(const char* dest_filename, int src_fd, off_t offset, + size_t nbytes) +{ + void *dest_pointer, *src_pointer; + off_t dest_file_size, src_file_size; + size_t length; + int dest_fd; + + atf_utils_cat_file(dest_filename, "dest_file: "); + + dest_fd = open(dest_filename, O_RDONLY); + ATF_REQUIRE_MSG(dest_fd != -1, "open failed"); + + dest_file_size = file_size_from_fd(dest_fd); + src_file_size = file_size_from_fd(src_fd); + + /* + * Per sendfile(2), "send the whole file" (paraphrased). This means + * that we need to grab the file size, as passing in length = 0 with + * mmap(2) will result in a failure with EINVAL (length = 0 is invalid). + */ + length = (nbytes == 0) ? (size_t)(src_file_size - offset) : nbytes; + + ATF_REQUIRE_EQ_MSG(dest_file_size, length, + "number of bytes written out to %s (%ju) doesn't match the " + "expected number of bytes (%ju)", dest_filename, dest_file_size, + length); + + ATF_REQUIRE_EQ_MSG(0, lseek(src_fd, offset, SEEK_SET), + "lseek failed: %s", strerror(errno)); + + dest_pointer = mmap(NULL, length, PROT_READ, MAP_PRIVATE, dest_fd, 0); + ATF_REQUIRE_MSG(dest_pointer != MAP_FAILED, "mmap failed: %s", + strerror(errno)); + + printf("Will mmap in the source file from offset=%jd to length=%zu\n", + offset, length); + + src_pointer = mmap(NULL, length, PROT_READ, MAP_PRIVATE, src_fd, offset); + ATF_REQUIRE_MSG(src_pointer != MAP_FAILED, "mmap failed: %s", + strerror(errno)); + + ATF_REQUIRE_EQ_MSG(0, memcmp(src_pointer, dest_pointer, length), + "Contents of source and destination do not match. '%s' != '%s'", + src_pointer, dest_pointer); + + (void)munmap(src_pointer, length); + (void)munmap(dest_pointer, length); + (void)close(dest_fd); +} + +static void +fd_positive_file_test(int domain) +{ + off_t offset; + size_t nbytes, pattern_size; + int client_sock, error, fd, port, server_sock; + pid_t server_pid; + + pattern_size = strlen(DETERMINISTIC_PATTERN); + + atf_utils_create_file(SOURCE_FILE, "%s", DETERMINISTIC_PATTERN); + fd = open(SOURCE_FILE, O_RDONLY); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + + port = generate_random_port(__LINE__ + domain); + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + server_pid = atf_utils_fork(); + if (server_pid == 0) { + (void)close(client_sock); + server_cat(DESTINATION_FILE, server_sock, pattern_size); + _exit(0); + } else + (void)close(server_sock); + + nbytes = 0; + offset = 0; + error = sendfile(fd, client_sock, offset, nbytes, NULL, NULL, + SF_FLAGS(0, 0)); + ATF_REQUIRE_EQ_MSG(0, error, "sendfile failed: %s", strerror(errno)); + (void)close(client_sock); + + atf_utils_wait(server_pid, 0, "", ""); + verify_source_and_dest(DESTINATION_FILE, fd, offset, nbytes); + + (void)close(fd); +} + +ATF_TC(fd_positive_file_v4); +ATF_TC_HEAD(fd_positive_file_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify regular file as file descriptor support (IPv4)"); +} +ATF_TC_BODY(fd_positive_file_v4, tc) +{ + + fd_positive_file_test(AF_INET); +} + +ATF_TC(fd_positive_file_v6); +ATF_TC_HEAD(fd_positive_file_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify regular file as file descriptor support (IPv6)"); +} +ATF_TC_BODY(fd_positive_file_v6, tc) +{ + + fd_positive_file_test(AF_INET6); +} + +static void +fd_positive_shm_test(int domain) +{ + void *shm_pointer; + off_t offset; + size_t nbytes, pattern_size; + pid_t server_pid; + int client_sock, error, fd, port, server_sock; + + pattern_size = strlen(DETERMINISTIC_PATTERN); + + printf("pattern size: %zu\n", pattern_size); + + fd = shm_open(SHM_ANON, O_RDWR|O_CREAT, 0600); + ATF_REQUIRE_MSG(fd != -1, "shm_open failed: %s", strerror(errno)); + ATF_REQUIRE_EQ_MSG(0, ftruncate(fd, pattern_size), + "ftruncate failed: %s", strerror(errno)); + shm_pointer = mmap(NULL, pattern_size, PROT_READ|PROT_WRITE, + MAP_SHARED, fd, 0); + ATF_REQUIRE_MSG(shm_pointer != MAP_FAILED, + "mmap failed: %s", strerror(errno)); + memcpy(shm_pointer, DETERMINISTIC_PATTERN, pattern_size); + ATF_REQUIRE_EQ_MSG(0, + memcmp(shm_pointer, DETERMINISTIC_PATTERN, pattern_size), + "memcmp showed data mismatch: '%s' != '%s'", + DETERMINISTIC_PATTERN, shm_pointer); + + port = generate_random_port(__LINE__ + domain); + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + server_pid = atf_utils_fork(); + if (server_pid == 0) { + (void)close(client_sock); + server_cat(DESTINATION_FILE, server_sock, pattern_size); + _exit(0); + } else + (void)close(server_sock); + + nbytes = 0; + offset = 0; + error = sendfile(fd, client_sock, offset, nbytes, NULL, NULL, + SF_FLAGS(0, 0)); + ATF_REQUIRE_EQ_MSG(0, error, "sendfile failed: %s", strerror(errno)); + (void)close(client_sock); + + atf_utils_wait(server_pid, 0, "", ""); + verify_source_and_dest(DESTINATION_FILE, fd, offset, nbytes); + + (void)munmap(shm_pointer, sizeof(DETERMINISTIC_PATTERN)); + (void)close(fd); +} + +ATF_TC(fd_positive_shm_v4); +ATF_TC_HEAD(fd_positive_shm_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify shared memory as file descriptor support (IPv4)"); +} +ATF_TC_BODY(fd_positive_shm_v4, tc) +{ + + fd_positive_shm_test(AF_INET); +} + +ATF_TC(fd_positive_shm_v6); +ATF_TC_HEAD(fd_positive_shm_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify shared memory as file descriptor support (IPv6))"); +} +ATF_TC_BODY(fd_positive_shm_v6, tc) +{ + + fd_positive_shm_test(AF_INET6); +} + +static void +fd_negative_bad_fd_test(int domain) +{ + int client_sock, error, fd, port, server_sock; + + port = generate_random_port(__LINE__ + domain); + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + fd = -1; + + error = sendfile(fd, client_sock, 0, 0, NULL, NULL, SF_FLAGS(0, 0)); + ATF_REQUIRE_ERRNO(EBADF, error == -1); + + (void)close(client_sock); + (void)close(server_sock); +} + +ATF_TC(fd_negative_bad_fd_v4); +ATF_TC_HEAD(fd_negative_bad_fd_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify bad file descriptor returns EBADF (IPv4)"); +} +ATF_TC_BODY(fd_negative_bad_fd_v4, tc) +{ + + fd_negative_bad_fd_test(AF_INET); +} + +ATF_TC(fd_negative_bad_fd_v6); +ATF_TC_HEAD(fd_negative_bad_fd_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify bad file descriptor returns EBADF (IPv6)"); +} +ATF_TC_BODY(fd_negative_bad_fd_v6, tc) +{ + + fd_negative_bad_fd_test(AF_INET6); +} + +static void +flags_test(int domain) +{ + off_t offset; + size_t nbytes, pattern_size; + int client_sock, error, fd, i, port, server_sock; + pid_t server_pid; + int16_t number_pages = 10; + + pattern_size = strlen(DETERMINISTIC_PATTERN); + + struct testcase { + int16_t readahead_pages, flags; + } testcases[] = { + /* This is covered in `:fd_positive_file` */ +#if 0 + { + .readahead_pages = 0, + .flags = 0 + }, +#endif + { + .readahead_pages = 0, + .flags = SF_NOCACHE + }, +#ifdef SF_USER_READAHEAD + { + .readahead_pages = 0, + .flags = SF_NOCACHE|SF_USER_READAHEAD + }, + { + .readahead_pages = 0, + .flags = SF_USER_READAHEAD + }, +#endif + { + .readahead_pages = number_pages, + .flags = 0 + }, + { + .readahead_pages = number_pages, + .flags = SF_NOCACHE + }, +#ifdef SF_USER_READAHEAD + { + .readahead_pages = number_pages, + .flags = SF_NOCACHE|SF_USER_READAHEAD + }, +#endif + { + .readahead_pages = number_pages, + .flags = SF_NOCACHE + }, + { + .readahead_pages = number_pages, + .flags = SF_NODISKIO + } + }; + + atf_utils_create_file(SOURCE_FILE, "%s", DETERMINISTIC_PATTERN); + for (i = 0; i < nitems(testcases); i++) { + fd = open(SOURCE_FILE, O_RDONLY); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + + port = generate_random_port(i * __LINE__ + domain); + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + server_pid = atf_utils_fork(); + if (server_pid == 0) { + (void)close(client_sock); + server_cat(DESTINATION_FILE, server_sock, pattern_size); + _exit(0); + } else + (void)close(server_sock); + + nbytes = 0; + offset = 0; + error = sendfile(fd, client_sock, offset, nbytes, NULL, NULL, + SF_FLAGS(testcases[i].readahead_pages, testcases[i].flags)); + ATF_CHECK_EQ_MSG(error, 0, "sendfile testcase #%d failed: %s", + i, strerror(errno)); + (void)close(client_sock); + + atf_utils_wait(server_pid, 0, "", ""); + verify_source_and_dest(DESTINATION_FILE, fd, offset, nbytes); + + (void)close(fd); + } +} + +ATF_TC(flags_v4); +ATF_TC_HEAD(flags_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", "Verify flags functionality (IPv4)"); +} +ATF_TC_BODY(flags_v4, tc) +{ + + flags_test(AF_INET); +} + +ATF_TC(flags_v6); +ATF_TC_HEAD(flags_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", "Verify flags functionality (IPv6)"); +} +ATF_TC_BODY(flags_v6, tc) +{ + + flags_test(AF_INET6); +} + +static void +hdtr_positive_test(int domain) +{ + struct iovec headers[1], trailers[1]; + struct testcase { + bool include_headers, include_trailers; + } testcases[] = { + /* This is covered in `:fd_positive_file` */ +#if 0 + { + .include_headers = false, + .include_trailers = false + }, +#endif + { + .include_headers = true, + .include_trailers = false + }, + { + .include_headers = false, + .include_trailers = true + }, + { + .include_headers = true, + .include_trailers = true + } + }; + off_t offset; + size_t nbytes; + int client_sock, error, fd, fd2, i, port, rc, server_sock; + pid_t server_pid; + + headers[0].iov_base = "This is a header"; + headers[0].iov_len = strlen(headers[0].iov_base); + trailers[0].iov_base = "This is a trailer"; + trailers[0].iov_len = strlen(trailers[0].iov_base); + offset = 0; + nbytes = 0; + + atf_tc_expect_fail( + "The header/trailer testcases fail today with a data mismatch; " + "bug # 234809"); + + for (i = 0; i < nitems(testcases); i++) { + struct sf_hdtr hdtr; + char *pattern; + + if (testcases[i].include_headers) { + hdtr.headers = headers; + hdtr.hdr_cnt = nitems(headers); + } else { + hdtr.headers = NULL; + hdtr.hdr_cnt = 0; + } + + if (testcases[i].include_trailers) { + hdtr.trailers = trailers; + hdtr.trl_cnt = nitems(trailers); + } else { + hdtr.trailers = NULL; + hdtr.trl_cnt = 0; + } + + port = generate_random_port(i * __LINE__ + domain); + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + rc = asprintf(&pattern, "%s%s%s", + testcases[i].include_headers ? headers[0].iov_base : "", + DETERMINISTIC_PATTERN, + testcases[i].include_trailers ? trailers[0].iov_base : ""); + ATF_REQUIRE_MSG(rc != -1, "asprintf failed: %s", strerror(errno)); + + atf_utils_create_file(SOURCE_FILE ".full", "%s", pattern); + atf_utils_create_file(SOURCE_FILE, "%s", DETERMINISTIC_PATTERN); + + fd = open(SOURCE_FILE, O_RDONLY); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + + fd2 = open(SOURCE_FILE ".full", O_RDONLY); + ATF_REQUIRE_MSG(fd2 != -1, "open failed: %s", strerror(errno)); + + server_pid = atf_utils_fork(); + if (server_pid == 0) { + (void)close(client_sock); + server_cat(DESTINATION_FILE, server_sock, + strlen(pattern)); + _exit(0); + } else + (void)close(server_sock); + + error = sendfile(fd, client_sock, offset, nbytes, &hdtr, + NULL, SF_FLAGS(0, 0)); + ATF_CHECK_EQ_MSG(error, 0, "sendfile testcase #%d failed: %s", + i, strerror(errno)); + (void)close(client_sock); + + atf_utils_wait(server_pid, 0, "", ""); + verify_source_and_dest(DESTINATION_FILE, fd2, offset, nbytes); + + (void)close(fd); + (void)close(fd2); + free(pattern); + pattern = NULL; + } +} + +ATF_TC(hdtr_positive_v4); +ATF_TC_HEAD(hdtr_positive_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify positive hdtr functionality (IPv4)"); +} +ATF_TC_BODY(hdtr_positive_v4, tc) +{ + + hdtr_positive_test(AF_INET); +} + +ATF_TC(hdtr_positive_v6); +ATF_TC_HEAD(hdtr_positive_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify positive hdtr functionality (IPv6)"); +} +ATF_TC_BODY(hdtr_positive_v6, tc) +{ + + hdtr_positive_test(AF_INET); +} + +static void +hdtr_negative_bad_pointers_test(int domain) +{ + int client_sock, error, fd, port, server_sock; + struct sf_hdtr *hdtr1, hdtr2, hdtr3; + + port = generate_random_port(__LINE__ + domain); + + hdtr1 = (struct sf_hdtr*)-1; + + memset(&hdtr2, 0, sizeof(hdtr2)); + hdtr2.hdr_cnt = 1; + hdtr2.headers = (struct iovec*)-1; + + memset(&hdtr3, 0, sizeof(hdtr3)); + hdtr3.trl_cnt = 1; + hdtr3.trailers = (struct iovec*)-1; + + fd = open(SOURCE_FILE, O_CREAT|O_RDWR); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + error = sendfile(fd, client_sock, 0, 0, hdtr1, NULL, SF_FLAGS(0, 0)); + ATF_CHECK_ERRNO(EFAULT, error == -1); + + error = sendfile(fd, client_sock, 0, 0, &hdtr2, NULL, SF_FLAGS(0, 0)); + ATF_CHECK_ERRNO(EFAULT, error == -1); + + error = sendfile(fd, client_sock, 0, 0, &hdtr3, NULL, SF_FLAGS(0, 0)); + ATF_CHECK_ERRNO(EFAULT, error == -1); + + (void)close(fd); + (void)close(client_sock); + (void)close(server_sock); +} + +ATF_TC(hdtr_negative_bad_pointers_v4); +ATF_TC_HEAD(hdtr_negative_bad_pointers_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify that bad pointers for hdtr storage result in EFAULT (IPv4)"); +} +ATF_TC_BODY(hdtr_negative_bad_pointers_v4, tc) +{ + + hdtr_negative_bad_pointers_test(AF_INET); +} + +ATF_TC(hdtr_negative_bad_pointers_v6); +ATF_TC_HEAD(hdtr_negative_bad_pointers_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify that bad pointers for hdtr storage result in EFAULT (IPv6)"); +} +ATF_TC_BODY(hdtr_negative_bad_pointers_v6, tc) +{ + + hdtr_negative_bad_pointers_test(AF_INET6); +} + +static void +offset_negative_value_less_than_zero_test(int domain) +{ + int client_sock, error, fd, port, server_sock; + + port = generate_random_port(__LINE__ + domain); + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + fd = open(SOURCE_FILE, O_CREAT|O_RDWR); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + + error = sendfile(fd, client_sock, -1, 0, NULL, NULL, SF_FLAGS(0, 0)); + ATF_REQUIRE_ERRNO(EINVAL, error == -1); + + (void)close(fd); + (void)close(client_sock); + (void)close(server_sock); +} + +ATF_TC(offset_negative_value_less_than_zero_v4); +ATF_TC_HEAD(offset_negative_value_less_than_zero_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify that a negative offset results in EINVAL (IPv4)"); +} +ATF_TC_BODY(offset_negative_value_less_than_zero_v4, tc) +{ + + offset_negative_value_less_than_zero_test(AF_INET); +} + +ATF_TC(offset_negative_value_less_than_zero_v6); +ATF_TC_HEAD(offset_negative_value_less_than_zero_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify that a negative offset results in EINVAL (IPv6)"); +} +ATF_TC_BODY(offset_negative_value_less_than_zero_v6, tc) +{ + + offset_negative_value_less_than_zero_test(AF_INET6); +} + +static void +sbytes_positive_test(int domain) +{ + size_t pattern_size = strlen(DETERMINISTIC_PATTERN); + off_t sbytes; + int client_sock, error, fd, port, server_sock; + + port = generate_random_port(__LINE__ + domain); + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + atf_utils_create_file(SOURCE_FILE, "%s", DETERMINISTIC_PATTERN); + fd = open(SOURCE_FILE, O_RDONLY); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + + error = sendfile(fd, client_sock, 0, 0, NULL, &sbytes, SF_FLAGS(0, 0)); + ATF_CHECK_EQ_MSG(error, 0, "sendfile failed: %s", strerror(errno)); + + (void)close(fd); + (void)close(client_sock); + (void)close(server_sock); + + ATF_CHECK_EQ_MSG(pattern_size, sbytes, + "the value returned by sbytes does not match the expected pattern " + "size"); +} + +ATF_TC(sbytes_positive_v4); +ATF_TC_HEAD(sbytes_positive_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify positive `sbytes` functionality (IPv4)"); +} +ATF_TC_BODY(sbytes_positive_v4, tc) +{ + + sbytes_positive_test(AF_INET); +} + +ATF_TC(sbytes_positive_v6); +ATF_TC_HEAD(sbytes_positive_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify positive `sbytes` functionality (IPv6)"); +} +ATF_TC_BODY(sbytes_positive_v6, tc) +{ + + sbytes_positive_test(AF_INET6); +} + +static void +sbytes_negative_test(int domain) +{ + off_t *sbytes_p = (off_t*)-1; + int client_sock, error, fd, port, server_sock; + + port = generate_random_port(__LINE__ + domain); + server_sock = setup_tcp_server(domain, port); + client_sock = setup_tcp_client(domain, port); + + atf_utils_create_file(SOURCE_FILE, "%s", DETERMINISTIC_PATTERN); + fd = open(SOURCE_FILE, O_RDONLY); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + + atf_tc_expect_fail( + "bug 232210: EFAULT assert fails because copyout(9) call is not checked"); + + error = sendfile(fd, client_sock, 0, 0, NULL, sbytes_p, SF_FLAGS(0, 0)); + ATF_REQUIRE_ERRNO(EFAULT, error == -1); + + (void)close(fd); + (void)close(client_sock); + (void)close(server_sock); +} + +ATF_TC(sbytes_negative_v4); +ATF_TC_HEAD(sbytes_negative_v4, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify negative `sbytes` functionality (IPv4)"); +} +ATF_TC_BODY(sbytes_negative_v4, tc) +{ + + sbytes_negative_test(AF_INET); +} + +ATF_TC(sbytes_negative_v6); +ATF_TC_HEAD(sbytes_negative_v6, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "Verify negative `sbytes` functionality (IPv6)"); +} +ATF_TC_BODY(sbytes_negative_v6, tc) +{ + + sbytes_negative_test(AF_INET6); +} + +static void +s_negative_not_connected_socket_test(int domain) +{ + int client_sock, error, fd, port; + + port = generate_random_port(__LINE__ + domain); + client_sock = setup_tcp_server(domain, port); + + fd = open(SOURCE_FILE, O_CREAT|O_RDWR); + ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); + + error = sendfile(fd, client_sock, 0, 0, NULL, NULL, SF_FLAGS(0, 0)); + ATF_REQUIRE_ERRNO(ENOTCONN, error == -1); + + (void)close(fd); + (void)close(client_sock); +} + +ATF_TC(s_negative_not_connected_socket_v4); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jan 23 22:18:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 870EA14B4255; Wed, 23 Jan 2019 22:18:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D7B28DCEE; Wed, 23 Jan 2019 22:18:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FEA01EF45; Wed, 23 Jan 2019 22:18:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NMIN7V051614; Wed, 23 Jan 2019 22:18:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NMIN0e051612; Wed, 23 Jan 2019 22:18:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901232218.x0NMIN0e051612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 23 Jan 2019 22:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343363 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 343363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2D7B28DCEE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 22:18:24 -0000 Author: markj Date: Wed Jan 23 22:18:23 2019 New Revision: 343363 URL: https://svnweb.freebsd.org/changeset/base/343363 Log: Fix an LLE lookup race. After the afdata read lock was converted to epoch(9), readers could observe a linked LLE and block on the LLE while a thread was unlinking the LLE. The writer would then release the lock and schedule the LLE for deferred free, allowing readers to continue and potentially schedule the LLE timer. By the point the timer fires, the structure is freed, typically resulting in a crash in the callout subsystem. Fix the problem by modifying the lookup path to check for the LLE_LINKED flag upon acquiring the LLE lock. If it's not set, the lookup fails. PR: 234296 Reviewed by: bz Tested by: sbruno, Victor , Mike Andrews MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18906 Modified: head/sys/netinet/in.c head/sys/netinet6/in6.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Wed Jan 23 22:00:17 2019 (r343362) +++ head/sys/netinet/in.c Wed Jan 23 22:18:23 2019 (r343363) @@ -1399,6 +1399,17 @@ in_lltable_lookup(struct lltable *llt, u_int flags, co else LLE_RLOCK(lle); + /* + * If the afdata lock is not held, the LLE may have been unlinked while + * we were blocked on the LLE lock. Check for this case. + */ + if (__predict_false((lle->la_flags & LLE_LINKED) == 0)) { + if (flags & LLE_EXCLUSIVE) + LLE_WUNLOCK(lle); + else + LLE_RUNLOCK(lle); + return (NULL); + } return (lle); } Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Wed Jan 23 22:00:17 2019 (r343362) +++ head/sys/netinet6/in6.c Wed Jan 23 22:18:23 2019 (r343363) @@ -2342,6 +2342,18 @@ in6_lltable_lookup(struct lltable *llt, u_int flags, LLE_WLOCK(lle); else LLE_RLOCK(lle); + + /* + * If the afdata lock is not held, the LLE may have been unlinked while + * we were blocked on the LLE lock. Check for this case. + */ + if (__predict_false((lle->la_flags & LLE_LINKED) == 0)) { + if (flags & LLE_EXCLUSIVE) + LLE_WUNLOCK(lle); + else + LLE_RUNLOCK(lle); + return (NULL); + } return (lle); } From owner-svn-src-head@freebsd.org Wed Jan 23 22:19:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B6FA14B434C; Wed, 23 Jan 2019 22:19:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 330B38DEC3; Wed, 23 Jan 2019 22:19:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2533B1EF6C; Wed, 23 Jan 2019 22:19:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NMJoCd051730; Wed, 23 Jan 2019 22:19:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NMJnCa051729; Wed, 23 Jan 2019 22:19:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901232219.x0NMJnCa051729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 23 Jan 2019 22:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343364 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 343364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 330B38DEC3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 22:19:50 -0000 Author: markj Date: Wed Jan 23 22:19:49 2019 New Revision: 343364 URL: https://svnweb.freebsd.org/changeset/base/343364 Log: Style. Reviewed by: bz MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/netinet/in.c head/sys/netinet6/in6.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Wed Jan 23 22:18:23 2019 (r343363) +++ head/sys/netinet/in.c Wed Jan 23 22:19:49 2019 (r343364) @@ -1382,15 +1382,13 @@ in_lltable_lookup(struct lltable *llt, u_int flags, co IF_AFDATA_LOCK_ASSERT(llt->llt_ifp); KASSERT(l3addr->sa_family == AF_INET, ("sin_family %d", l3addr->sa_family)); - lle = in_lltable_find_dst(llt, sin->sin_addr); + KASSERT((flags & (LLE_UNLOCKED | LLE_EXCLUSIVE)) != + (LLE_UNLOCKED | LLE_EXCLUSIVE), + ("wrong lle request flags: %#x", flags)); + lle = in_lltable_find_dst(llt, sin->sin_addr); if (lle == NULL) return (NULL); - - KASSERT((flags & (LLE_UNLOCKED|LLE_EXCLUSIVE)) != - (LLE_UNLOCKED|LLE_EXCLUSIVE),("wrong lle request flags: 0x%X", - flags)); - if (flags & LLE_UNLOCKED) return (lle); Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Wed Jan 23 22:18:23 2019 (r343363) +++ head/sys/netinet6/in6.c Wed Jan 23 22:19:49 2019 (r343364) @@ -2325,16 +2325,13 @@ in6_lltable_lookup(struct lltable *llt, u_int flags, IF_AFDATA_LOCK_ASSERT(llt->llt_ifp); KASSERT(l3addr->sa_family == AF_INET6, ("sin_family %d", l3addr->sa_family)); + KASSERT((flags & (LLE_UNLOCKED | LLE_EXCLUSIVE)) != + (LLE_UNLOCKED | LLE_EXCLUSIVE), + ("wrong lle request flags: %#x", flags)); lle = in6_lltable_find_dst(llt, &sin6->sin6_addr); - if (lle == NULL) return (NULL); - - KASSERT((flags & (LLE_UNLOCKED|LLE_EXCLUSIVE)) != - (LLE_UNLOCKED|LLE_EXCLUSIVE),("wrong lle request flags: 0x%X", - flags)); - if (flags & LLE_UNLOCKED) return (lle); From owner-svn-src-head@freebsd.org Wed Jan 23 23:06:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A20A14B50BA; Wed, 23 Jan 2019 23:06:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3E398F6D8; Wed, 23 Jan 2019 23:06:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B77671F802; Wed, 23 Jan 2019 23:06:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NN6dHN077570; Wed, 23 Jan 2019 23:06:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NN6dJ0077569; Wed, 23 Jan 2019 23:06:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201901232306.x0NN6dJ0077569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Wed, 23 Jan 2019 23:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343365 - head/lib/libc/tests/sys X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libc/tests/sys X-SVN-Commit-Revision: 343365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C3E398F6D8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 23:06:40 -0000 Author: ngie Date: Wed Jan 23 23:06:39 2019 New Revision: 343365 URL: https://svnweb.freebsd.org/changeset/base/343365 Log: Unbreak the gcc build with sendfile_test after r343362 gcc 8.x is more pedantic than clang 7.x with format strings and the tests passed `void*` variables while supplying `%s` (which is technically incorrect). Make the affected `void*` variables use `char*` storage instead to address this issue, as the compiler will upcast the values to `char*`. MFC after: 1 month MFC with: r343362 Approved by: emaste (mentor; implicit) Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D18934 Modified: head/lib/libc/tests/sys/sendfile_test.c Modified: head/lib/libc/tests/sys/sendfile_test.c ============================================================================== --- head/lib/libc/tests/sys/sendfile_test.c Wed Jan 23 22:19:49 2019 (r343364) +++ head/lib/libc/tests/sys/sendfile_test.c Wed Jan 23 23:06:39 2019 (r343365) @@ -195,7 +195,7 @@ setup_server(int domain, int type, int port) static void server_cat(const char *dest_filename, int server_sock, size_t len) { - void *buffer; + char *buffer; int recv_sock; ssize_t received_bytes; @@ -268,7 +268,7 @@ static void verify_source_and_dest(const char* dest_filename, int src_fd, off_t offset, size_t nbytes) { - void *dest_pointer, *src_pointer; + char *dest_pointer, *src_pointer; off_t dest_file_size, src_file_size; size_t length; int dest_fd; @@ -384,7 +384,7 @@ ATF_TC_BODY(fd_positive_file_v6, tc) static void fd_positive_shm_test(int domain) { - void *shm_pointer; + char *shm_pointer; off_t offset; size_t nbytes, pattern_size; pid_t server_pid; @@ -687,9 +687,9 @@ hdtr_positive_test(int domain) client_sock = setup_tcp_client(domain, port); rc = asprintf(&pattern, "%s%s%s", - testcases[i].include_headers ? headers[0].iov_base : "", + testcases[i].include_headers ? (char *)headers[0].iov_base : "", DETERMINISTIC_PATTERN, - testcases[i].include_trailers ? trailers[0].iov_base : ""); + testcases[i].include_trailers ? (char *)trailers[0].iov_base : ""); ATF_REQUIRE_MSG(rc != -1, "asprintf failed: %s", strerror(errno)); atf_utils_create_file(SOURCE_FILE ".full", "%s", pattern); From owner-svn-src-head@freebsd.org Wed Jan 23 23:25:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A98214B5752; Wed, 23 Jan 2019 23:25:43 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3985C681E8; Wed, 23 Jan 2019 23:25:43 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 267481FB88; Wed, 23 Jan 2019 23:25:43 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NNPhlS087978; Wed, 23 Jan 2019 23:25:43 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NNPgNE087977; Wed, 23 Jan 2019 23:25:42 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201901232325.x0NNPgNE087977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 23 Jan 2019 23:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343366 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 343366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3985C681E8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 23:25:43 -0000 Author: brooks Date: Wed Jan 23 23:25:42 2019 New Revision: 343366 URL: https://svnweb.freebsd.org/changeset/base/343366 Log: Remove documentation for the nonexistant cred_update_thread(9). This was a tangential change submitted as part of D18930. Submitted by: jack@gandi.net Modified: head/share/man/man9/Makefile head/share/man/man9/ucred.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Jan 23 23:06:39 2019 (r343365) +++ head/share/man/man9/Makefile Wed Jan 23 23:25:42 2019 (r343366) @@ -2095,8 +2095,7 @@ MLINKS+=timeout.9 callout.9 \ timeout.9 callout_stop.9 \ timeout.9 callout_when.9 \ timeout.9 untimeout.9 -MLINKS+=ucred.9 cred_update_thread.9 \ - ucred.9 crcopy.9 \ +MLINKS+=ucred.9 crcopy.9 \ ucred.9 crcopysafe.9 \ ucred.9 crdup.9 \ ucred.9 crfree.9 \ Modified: head/share/man/man9/ucred.9 ============================================================================== --- head/share/man/man9/ucred.9 Wed Jan 23 23:06:39 2019 (r343365) +++ head/share/man/man9/ucred.9 Wed Jan 23 23:25:42 2019 (r343366) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 27, 2017 +.Dd January 23, 2019 .Dt UCRED 9 .Os .Sh NAME @@ -36,8 +36,7 @@ .Nm crfree , .Nm crcopy , .Nm crdup , -.Nm cru2x , -.Nm cred_update_thread +.Nm cru2x .Nd "functions related to user credentials" .Sh SYNOPSIS .In sys/param.h @@ -58,8 +57,6 @@ .Fn crsetgroups "struct ucred *cr" "int ngrp" "gid_t *groups" .Ft void .Fn cru2x "struct ucred *cr" "struct xucred *xcr" -.Ft void -.Fn cred_update_thread "struct thread *td" .Sh DESCRIPTION The .Nm @@ -147,11 +144,6 @@ the former (e.g., .Va cr_version ) . .Pp -The -.Fn cred_update_thread -function sets the credentials of -.Fa td -to that of its process, freeing its old credential if required. .Sh RETURN VALUES .Fn crget , .Fn crhold , From owner-svn-src-head@freebsd.org Wed Jan 23 23:30:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8265814B58E1; Wed, 23 Jan 2019 23:30:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2ADF5684A0; Wed, 23 Jan 2019 23:30:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E7431FBD0; Wed, 23 Jan 2019 23:30:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NNUuJ3088964; Wed, 23 Jan 2019 23:30:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NNUtDI088963; Wed, 23 Jan 2019 23:30:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201901232330.x0NNUtDI088963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Wed, 23 Jan 2019 23:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343367 - head/lib/libc/tests/sys X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libc/tests/sys X-SVN-Commit-Revision: 343367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2ADF5684A0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 23:30:56 -0000 Author: ngie Date: Wed Jan 23 23:30:55 2019 New Revision: 343367 URL: https://svnweb.freebsd.org/changeset/base/343367 Log: Unbreak the build on architectures where size_t isn't synonymous with uintmax_t I should have used `%zu` instead of `%ju` with `size_t` types. MFC after: 1 month MFC with: r343362, r343365 Approved by: emaste (mentor; implicit) Reviewed by: asomers Pointyhat to: ngie Submitted by: asomers Differential Revision: https://reviews.freebsd.org/D18935 Modified: head/lib/libc/tests/sys/sendfile_test.c Modified: head/lib/libc/tests/sys/sendfile_test.c ============================================================================== --- head/lib/libc/tests/sys/sendfile_test.c Wed Jan 23 23:25:42 2019 (r343366) +++ head/lib/libc/tests/sys/sendfile_test.c Wed Jan 23 23:30:55 2019 (r343367) @@ -289,8 +289,8 @@ verify_source_and_dest(const char* dest_filename, int length = (nbytes == 0) ? (size_t)(src_file_size - offset) : nbytes; ATF_REQUIRE_EQ_MSG(dest_file_size, length, - "number of bytes written out to %s (%ju) doesn't match the " - "expected number of bytes (%ju)", dest_filename, dest_file_size, + "number of bytes written out to %s (%zu) doesn't match the " + "expected number of bytes (%zu)", dest_filename, dest_file_size, length); ATF_REQUIRE_EQ_MSG(0, lseek(src_fd, offset, SEEK_SET), From owner-svn-src-head@freebsd.org Wed Jan 23 23:34:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2DEB14B5B00; Wed, 23 Jan 2019 23:34:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BDCD69C90; Wed, 23 Jan 2019 23:34:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x62a.google.com with SMTP id t13so1927383ply.13; Wed, 23 Jan 2019 15:34:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=+PhVpyd8AnSzQI2fm9DLqRURgLFfgtAtoMvxIggaWBo=; b=Ej7U4G7JlzjjxQFhHA1b0LJb8/TBYFs2gm9SeGmfgzDHPV+Pl87uFit4zgbR1u9N29 lAYpcwYpFomEkWynifl5KgHFQx40u2fMqCpRJn2RGA94XFhj5ffefVwHrzVEjvbzhe3j vEMMrYeYMdSvLDFVC+iEMGgI8MnMXDkcwFxrxtpKXHGTM13PTpNNPgGejBd7fAEAf22G G17Gc4waDArisGoqZc2Dyz69IhTgUbUjfHOeiWrTQjh/ZBheR67RysJTYls6R6aYzfTe 3UsqBO1Pq0Q8oHCaFnL0Zju+XkIXb3wXN5z86o2DvyRcE61L5zF/7gCurx0PXRjxknMz zGbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=+PhVpyd8AnSzQI2fm9DLqRURgLFfgtAtoMvxIggaWBo=; b=aqpQV7XOdM7jpaH+2q+Jhph2PuJWw79xg+wbppYW+4x59uvBOKK67MRmv3ojhI6E3l Ze/oZebvAI0XZlNBc+Wftuc80vhJ/msvpOSKDFDfmWYyeDNbEU0YcyfqrQsP4yWGQVb2 ycPft8RkaUsBoRIqttu5ggWcAwT9ah4MIyLgowvVTxdzVdN3obrQkIn/XcLIvMLPc5aR 2Mj1spBzdPIqOflMkkMMXTd6RABKXESFSUHmQ6ooK98HAKTXMHEl/Gr95ndRfn+0p2Kv JJWtd8hLOlhF03d6VGwjOYIS+O7feBuzOtudLfVbm33CnAbR3s5Y+/ZEQN6abURVRms1 tNNg== X-Gm-Message-State: AJcUukfABoFxWkjeKYi6mtsTTXPpnCnKK/+hoH7pdeayaruIpddTXSdF RKAXWpHXBTt+9M82+R0nQcaUAF+s X-Google-Smtp-Source: ALg8bN7eXWJbnfOVx2wDtnUrUTU9Zke+33bZr9S4mYdIkCc+4TycMI13fPhmWc3ZxicwOkSssuSP+w== X-Received: by 2002:a17:902:8a91:: with SMTP id p17mr4263897plo.316.1548286453066; Wed, 23 Jan 2019 15:34:13 -0800 (PST) Received: from [192.168.2.101] (c-24-56-255-165.customer.broadstripe.net. [24.56.255.165]) by smtp.gmail.com with ESMTPSA id v9sm27608948pfg.144.2019.01.23.15.34.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 15:34:12 -0800 (PST) From: Enji Cooper Message-Id: Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r343367 - head/lib/libc/tests/sys Date: Wed, 23 Jan 2019 15:34:11 -0800 In-Reply-To: <201901232330.x0NNUtDI088963@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Enji Cooper References: <201901232330.x0NNUtDI088963@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 6BDCD69C90 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.985,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 23:34:15 -0000 > On Jan 23, 2019, at 3:30 PM, Enji Cooper wrote: >=20 > Author: ngie > Date: Wed Jan 23 23:30:55 2019 > New Revision: 343367 > URL: https://svnweb.freebsd.org/changeset/base/343367 >=20 > Log: > Unbreak the build on architectures where size_t isn't synonymous with = uintmax_t >=20 > I should have used `%zu` instead of `%ju` with `size_t` types. = https://reviews.freebsd.org/file/data/2cgpmriicvbknz4wmobq/PHID-FILE-boydx= wdwmlcyuxwurofm/bart-simpson-run-make-universe.gif = (caption: Bart = Simpson against chalkboard with 'I will run "make universe=E2=80=9D = before committing to src=E2=80=99 written repeatedly on the chalkboard). -Enji= From owner-svn-src-head@freebsd.org Wed Jan 23 23:48:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7D6D14B6084; Wed, 23 Jan 2019 23:48:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80F0C6A6E3; Wed, 23 Jan 2019 23:48:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74E101FF21; Wed, 23 Jan 2019 23:48:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0NNmvLN098256; Wed, 23 Jan 2019 23:48:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0NNmvO5098255; Wed, 23 Jan 2019 23:48:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201901232348.x0NNmvO5098255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Wed, 23 Jan 2019 23:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343368 - head/lib/libc/tests/sys X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libc/tests/sys X-SVN-Commit-Revision: 343368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 80F0C6A6E3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 23:48:58 -0000 Author: ngie Date: Wed Jan 23 23:48:57 2019 New Revision: 343368 URL: https://svnweb.freebsd.org/changeset/base/343368 Log: Fix up r343367 I should have only changed the format qualifier with the `size_t` value, `length`, not the other [`off_t`] value, `dest_file_size`. MFC after: 1 month MFC with: r343362, r343365, r343367 Approved by: emaste (mentor; implicit) Reported by: gcc 8.x Modified: head/lib/libc/tests/sys/sendfile_test.c Modified: head/lib/libc/tests/sys/sendfile_test.c ============================================================================== --- head/lib/libc/tests/sys/sendfile_test.c Wed Jan 23 23:30:55 2019 (r343367) +++ head/lib/libc/tests/sys/sendfile_test.c Wed Jan 23 23:48:57 2019 (r343368) @@ -289,7 +289,7 @@ verify_source_and_dest(const char* dest_filename, int length = (nbytes == 0) ? (size_t)(src_file_size - offset) : nbytes; ATF_REQUIRE_EQ_MSG(dest_file_size, length, - "number of bytes written out to %s (%zu) doesn't match the " + "number of bytes written out to %s (%ju) doesn't match the " "expected number of bytes (%zu)", dest_filename, dest_file_size, length); From owner-svn-src-head@freebsd.org Wed Jan 23 23:52:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D91F214B6266; Wed, 23 Jan 2019 23:51:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5265F6AAC1; Wed, 23 Jan 2019 23:51:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x430.google.com with SMTP id b85so2008316pfc.3; Wed, 23 Jan 2019 15:51:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=2hejBC73BbVZejQDbUVB6KS6N8Bnn7jx592PNcQ22hU=; b=RU2WSmWTDd3nfbt5ZwgDw74G6qC0o5tkEjdFTxUxFpLDdII4RaUiRsSLaIYODsZpTX 9uXc6CRamir71TLByI1LT26S0mH2LqMcpABA9d0EguJbjbows7T7Ppgzw7YQOxHD+5EC QuF5yif6fPbhAvI4bGJlK4tghsGUYJrSNjqYmLu7I9VmkZmseiq6ADR8YzPStVcBoTRr We96UrDyamEY/IfVpiHE3L6leEsK/JIEHbFL3fPlDjehGe2ezepaq/ljRcr4Th6HQFcB B7YQUxYB3Vm+KImtcOBYbx9ziEhN7gMlAFNDhhfhV2P8O0KFEz8E4mieTpYPl7x6Lkbc sT2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=2hejBC73BbVZejQDbUVB6KS6N8Bnn7jx592PNcQ22hU=; b=RkadDMBLRupOoEfgIs5I9jfCF73PAbgFRs0KVyP1O5BAz20jTMloP02efkB4xC5vIZ boSR+1pqIn0Rp83gpzAPp2OTknIqF2txMbHVQHc5TgkgMpZ67gj1FlOIbgt+8rbjNyYL NjWETsaYDF453ofExyjUlFe5K22BWNggooJUDu9IIPhbE6kmpKtJZbVeDFB66zY4CzDM A/k7oVspjLI0I7q1RCRxeIVnJ2jGYlDOvQK5duCH6QL/NwQfh4bmQqHpGAT69tTx5aOJ TtEptK2He8UvgLrUpYy6ktCVvTHzGayc+BtpZchT8390ZItPAYArF6Y4cPbxCx20i7vg 70LA== X-Gm-Message-State: AJcUukeceQ5k/grni6I10Hijh49fx4alP3Or+hnaaSITL4emAAA5+5GF NoHGMD/pr7dF5T7GZ1BEhVFE0ne3 X-Google-Smtp-Source: ALg8bN6pNTAKCmeFcGdK0M0j0/db5ByWKZCFreMva9jfDR2ArmOvza4d57BjA3oohUNK0mMPvW3PcA== X-Received: by 2002:a63:955a:: with SMTP id t26mr3875745pgn.449.1548287517831; Wed, 23 Jan 2019 15:51:57 -0800 (PST) Received: from [192.168.2.101] (c-24-56-255-165.customer.broadstripe.net. [24.56.255.165]) by smtp.gmail.com with ESMTPSA id w88sm45512002pfk.11.2019.01.23.15.51.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 15:51:57 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: svn commit: r343368 - head/lib/libc/tests/sys From: Enji Cooper In-Reply-To: <201901232348.x0NNmvO5098255@repo.freebsd.org> Date: Wed, 23 Jan 2019 15:51:56 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201901232348.x0NNmvO5098255@repo.freebsd.org> To: Enji Cooper X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 5265F6AAC1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 23:52:00 -0000 > On Jan 23, 2019, at 3:48 PM, Enji Cooper wrote: >=20 > Author: ngie > Date: Wed Jan 23 23:48:57 2019 > New Revision: 343368 > URL: https://svnweb.freebsd.org/changeset/base/343368 >=20 > Log: > Fix up r343367 >=20 > I should have only changed the format qualifier with the `size_t` = value, > `length`, not the other [`off_t`] value, `dest_file_size`. >=20 > MFC after: 1 month > MFC with: r343362, r343365, r343367 > Approved by: emaste (mentor; implicit) > Reported by: gcc 8.x Lessons to learn from this: is, again, always run =E2=80=9Cmake = universe=E2=80=9D beforehand on the releng machines. I swore I did this = before, but I can=E2=80=99t remember (and I didn=E2=80=99t run it before = committing the code). Trying to figure out a reasonable way to use my GitHub fork and = do work with svn =E2=80=94 the workflow is extremely error prone right = now (this is just one symptom of that issue). Thank you for your patience, everyone. It=E2=80=99s been far too = long since I=E2=80=99ve earned pointyhats :/. Cheers, -Enji= From owner-svn-src-head@freebsd.org Thu Jan 24 01:03:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEA1514B8059; Thu, 24 Jan 2019 01:03:02 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51A346DD4A; Thu, 24 Jan 2019 01:03:02 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42A8D20CC7; Thu, 24 Jan 2019 01:03:02 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O132q1041730; Thu, 24 Jan 2019 01:03:02 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O130xi041721; Thu, 24 Jan 2019 01:03:00 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201901240103.x0O130xi041721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 24 Jan 2019 01:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343369 - in head/sys/dev: e1000 ixgbe ixl X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in head/sys/dev: e1000 ixgbe ixl X-SVN-Commit-Revision: 343369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 51A346DD4A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 01:03:03 -0000 Author: erj Date: Thu Jan 24 01:03:00 2019 New Revision: 343369 URL: https://svnweb.freebsd.org/changeset/base/343369 Log: intel iflib drivers: correct initialization of tx_cidx_processed From Jake: In r341156 ("Fix first-packet completion", 2018-11-28) a hack to work around a delta calculation determining how many descriptors were used was added to ixl_isc_tx_credits_update_dwb. The same fix was also applied to the em and igb drivers in r340310, and to ix in r341156. The hack checked the case where prev and cur were equal, and then added one. This works, because by the time we do the delta check, we already know there is at least one packet available, so the delta should be at least one. However, it's not a complete fix, and as indicated by the comment is really a hack to work around the real bug. The real problem is that the first time that we transmit a packet, tx_cidx_processed will be set to point to the start of the ring. Ultimately, the credits_update function expects it to point to the *last* descriptor that was processed. Since we haven't yet processed any descriptors, pointing it to 0 results in this incorrect calculation. Fix the initialization code to have it point to the end of the ring instead. One way to think about this, is that we are setting the value to be one prior to the first available descriptor. Doing so, corrects the delta calculation in all cases. The original fix only works if the first packet has exactly one descriptor. Otherwise, we will report 1 less than the correct value. As part of this fix, also update the MPASS assertions to match the real expectations. First, ensure that prev is not equal to cur, since this should never happen. Second, remove the assertion about prev==0 || delta != 0. It looks like that originated from when the em driver was converted to iflib. It seems like it was supposed to ensure that delta was non-zero. However, because we originally returned 0 delta for the first calculation, the "prev == 0" was tacked on. Instead, replace this with a check that delta is greater than zero, after the correction necessary when the ring pointers wrap around. This new solution should fix the same bug as r341156 did, but in a more robust way. Submitted by: Jacob Keller Reviewed by: shurd@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D18545 Modified: head/sys/dev/e1000/em_txrx.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/igb_txrx.c head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixgbe/ix_txrx.c head/sys/dev/ixl/ixl_txrx.c Modified: head/sys/dev/e1000/em_txrx.c ============================================================================== --- head/sys/dev/e1000/em_txrx.c Wed Jan 23 23:48:57 2019 (r343368) +++ head/sys/dev/e1000/em_txrx.c Thu Jan 24 01:03:00 2019 (r343369) @@ -457,16 +457,11 @@ em_isc_txd_credits_update(void *arg, uint16_t txqid, b prev = txr->tx_cidx_processed; ntxd = scctx->isc_ntxd[0]; do { + MPASS(prev != cur); delta = (int32_t)cur - (int32_t)prev; - /* - * XXX This appears to be a hack for first-packet. - * A correct fix would prevent prev == cur in the first place. - */ - MPASS(prev == 0 || delta != 0); - if (prev == 0 && cur == 0) - delta += 1; if (delta < 0) delta += ntxd; + MPASS(delta > 0); DPRINTF(iflib_get_dev(adapter->ctx), "%s: cidx_processed=%u cur=%u clear=%d delta=%d\n", __FUNCTION__, prev, cur, clear, delta); Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Jan 23 23:48:57 2019 (r343368) +++ head/sys/dev/e1000/if_em.c Thu Jan 24 01:03:00 2019 (r343369) @@ -1208,6 +1208,7 @@ static void em_if_init(if_ctx_t ctx) { struct adapter *adapter = iflib_get_softc(ctx); + if_softc_ctx_t scctx = adapter->shared; struct ifnet *ifp = iflib_get_ifp(ctx); struct em_tx_queue *tx_que; int i; @@ -1240,7 +1241,14 @@ em_if_init(if_ctx_t ctx) for (i = 0, tx_que = adapter->tx_queues; i < adapter->tx_num_queues; i++, tx_que++) { struct tx_ring *txr = &tx_que->txr; - txr->tx_rs_cidx = txr->tx_rs_pidx = txr->tx_cidx_processed = 0; + txr->tx_rs_cidx = txr->tx_rs_pidx; + + /* Initialize the last processed descriptor to be the end of + * the ring, rather than the start, so that we avoid an + * off-by-one error when calculating how many descriptors are + * done in the credits_update function. + */ + txr->tx_cidx_processed = scctx->isc_ntxd[0] - 1; } /* Setup VLAN support, basic and offload if available */ Modified: head/sys/dev/e1000/igb_txrx.c ============================================================================== --- head/sys/dev/e1000/igb_txrx.c Wed Jan 23 23:48:57 2019 (r343368) +++ head/sys/dev/e1000/igb_txrx.c Thu Jan 24 01:03:00 2019 (r343369) @@ -332,16 +332,11 @@ igb_isc_txd_credits_update(void *arg, uint16_t txqid, prev = txr->tx_cidx_processed; ntxd = scctx->isc_ntxd[0]; do { + MPASS(prev != cur); delta = (int32_t)cur - (int32_t)prev; - /* - * XXX This appears to be a hack for first-packet. - * A correct fix would prevent prev == cur in the first place. - */ - MPASS(prev == 0 || delta != 0); - if (prev == 0 && cur == 0) - delta += 1; if (delta < 0) delta += ntxd; + MPASS(delta > 0); processed += delta; prev = cur; Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Wed Jan 23 23:48:57 2019 (r343368) +++ head/sys/dev/ixgbe/if_ix.c Thu Jan 24 01:03:00 2019 (r343369) @@ -806,7 +806,8 @@ ixgbe_initialize_transmit_units(if_ctx_t ctx) IXGBE_WRITE_REG(hw, IXGBE_TDT(j), 0); /* Cache the tail address */ - txr->tx_rs_cidx = txr->tx_rs_pidx = txr->tx_cidx_processed = 0; + txr->tx_rs_cidx = txr->tx_rs_pidx; + txr->tx_cidx_processed = scctx->isc_ntxd[0] - 1; for (int k = 0; k < scctx->isc_ntxd[0]; k++) txr->tx_rsq[k] = QIDX_INVALID; Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Wed Jan 23 23:48:57 2019 (r343368) +++ head/sys/dev/ixgbe/if_ixv.c Thu Jan 24 01:03:00 2019 (r343369) @@ -1228,7 +1228,13 @@ ixv_initialize_transmit_units(if_ctx_t ctx) /* Set Tx Tail register */ txr->tail = IXGBE_VFTDT(j); - txr->tx_rs_cidx = txr->tx_rs_pidx = txr->tx_cidx_processed = 0; + txr->tx_rs_cidx = txr->tx_rs_pidx; + /* Initialize the last processed descriptor to be the end of + * the ring, rather than the start, so that we avoid an + * off-by-one error when calculating how many descriptors are + * done in the credits_update function. + */ + txr->tx_cidx_processed = scctx->isc_ntxd[0] - 1; for (int k = 0; k < scctx->isc_ntxd[0]; k++) txr->tx_rsq[k] = QIDX_INVALID; Modified: head/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- head/sys/dev/ixgbe/ix_txrx.c Wed Jan 23 23:48:57 2019 (r343368) +++ head/sys/dev/ixgbe/ix_txrx.c Thu Jan 24 01:03:00 2019 (r343369) @@ -296,11 +296,11 @@ ixgbe_isc_txd_credits_update(void *arg, uint16_t txqid prev = txr->tx_cidx_processed; ntxd = scctx->isc_ntxd[0]; do { + MPASS(prev != cur); delta = (int32_t)cur - (int32_t)prev; - if (prev == 0 && cur == 0) - delta += 1; if (delta < 0) delta += ntxd; + MPASS(delta > 0); processed += delta; prev = cur; Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Wed Jan 23 23:48:57 2019 (r343368) +++ head/sys/dev/ixl/ixl_txrx.c Thu Jan 24 01:03:00 2019 (r343369) @@ -515,16 +515,11 @@ ixl_isc_txd_credits_update_dwb(void *arg, uint16_t txq prev = txr->tx_cidx_processed; ntxd = scctx->isc_ntxd[0]; do { + MPASS(prev != cur); delta = (int32_t)cur - (int32_t)prev; - /* - * XXX This appears to be a hack for first-packet. - * A correct fix would prevent prev == cur in the first place. - */ - MPASS(prev == 0 || delta != 0); - if (prev == 0 && cur == 0) - delta += 1; if (delta < 0) delta += ntxd; + MPASS(delta > 0); #if 0 device_printf(iflib_get_dev(vsi->ctx), "%s: (q%d) cidx_processed=%u cur=%u clear=%d delta=%d\n", @@ -793,8 +788,15 @@ ixl_init_tx_rsqs(struct ixl_vsi *vsi) for (i = 0, tx_que = vsi->tx_queues; i < vsi->num_tx_queues; i++, tx_que++) { struct tx_ring *txr = &tx_que->txr; - txr->tx_rs_cidx = txr->tx_rs_pidx = txr->tx_cidx_processed = 0; + txr->tx_rs_cidx = txr->tx_rs_pidx; + /* Initialize the last processed descriptor to be the end of + * the ring, rather than the start, so that we avoid an + * off-by-one error when calculating how many descriptors are + * done in the credits_update function. + */ + txr->tx_cidx_processed = scctx->isc_ntxd[0] - 1; + for (j = 0; j < scctx->isc_ntxd[0]; j++) txr->tx_rsq[j] = QIDX_INVALID; } @@ -803,13 +805,14 @@ ixl_init_tx_rsqs(struct ixl_vsi *vsi) void ixl_init_tx_cidx(struct ixl_vsi *vsi) { + if_softc_ctx_t scctx = vsi->shared; struct ixl_tx_queue *tx_que; int i; for (i = 0, tx_que = vsi->tx_queues; i < vsi->num_tx_queues; i++, tx_que++) { struct tx_ring *txr = &tx_que->txr; - txr->tx_cidx_processed = 0; + txr->tx_cidx_processed = scctx->isc_ntxd[0] - 1; } } From owner-svn-src-head@freebsd.org Thu Jan 24 01:08:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7902414B82A9; Thu, 24 Jan 2019 01:08:38 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AA476E29B; Thu, 24 Jan 2019 01:08:38 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A56020CE5; Thu, 24 Jan 2019 01:08:38 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O18bEX042078; Thu, 24 Jan 2019 01:08:37 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O18bqL042077; Thu, 24 Jan 2019 01:08:37 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201901240108.x0O18bqL042077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 24 Jan 2019 01:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343372 - head/sys/dev/ixl X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/ixl X-SVN-Commit-Revision: 343372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1AA476E29B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 01:08:38 -0000 Author: erj Date: Thu Jan 24 01:08:37 2019 New Revision: 343372 URL: https://svnweb.freebsd.org/changeset/base/343372 Log: ixl(4): Fix handling data passed with ioctl from NVM update tool From Krzysztof: Ensure that the entire data buffer passed from the NVM update tool is copied in to kernel space and copied back out to user space using copyin() and copyout(). PR: 234104 Submitted by: Krzysztof Galazka Reported by: Finn MFC after: 5 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D18817 Modified: head/sys/dev/ixl/ixl_pf_main.c Modified: head/sys/dev/ixl/ixl_pf_main.c ============================================================================== --- head/sys/dev/ixl/ixl_pf_main.c Thu Jan 24 01:04:23 2019 (r343371) +++ head/sys/dev/ixl/ixl_pf_main.c Thu Jan 24 01:08:37 2019 (r343372) @@ -3663,23 +3663,34 @@ ixl_handle_nvmupd_cmd(struct ixl_pf *pf, struct ifdrv struct i40e_nvm_access *nvma; device_t dev = pf->dev; enum i40e_status_code status = 0; - int perrno; + size_t nvma_size, ifd_len, exp_len; + int err, perrno; DEBUGFUNC("ixl_handle_nvmupd_cmd"); /* Sanity checks */ - if (ifd->ifd_len < sizeof(struct i40e_nvm_access) || + nvma_size = sizeof(struct i40e_nvm_access); + ifd_len = ifd->ifd_len; + + if (ifd_len < nvma_size || ifd->ifd_data == NULL) { device_printf(dev, "%s: incorrect ifdrv length or data pointer\n", __func__); device_printf(dev, "%s: ifdrv length: %zu, sizeof(struct i40e_nvm_access): %zu\n", - __func__, ifd->ifd_len, sizeof(struct i40e_nvm_access)); + __func__, ifd_len, nvma_size); device_printf(dev, "%s: data pointer: %p\n", __func__, ifd->ifd_data); return (EINVAL); } - nvma = (struct i40e_nvm_access *)ifd->ifd_data; + nvma = malloc(ifd_len, M_DEVBUF, M_WAITOK); + err = copyin(ifd->ifd_data, nvma, ifd_len); + if (err) { + device_printf(dev, "%s: Cannot get request from user space\n", + __func__); + free(nvma, M_DEVBUF); + return (err); + } if (pf->dbg_mask & IXL_DBG_NVMUPD) ixl_print_nvm_cmd(dev, nvma); @@ -3693,13 +3704,49 @@ ixl_handle_nvmupd_cmd(struct ixl_pf *pf, struct ifdrv } } - if (!(pf->state & IXL_PF_STATE_ADAPTER_RESETTING)) { - // TODO: Might need a different lock here - // IXL_PF_LOCK(pf); - status = i40e_nvmupd_command(hw, nvma, nvma->data, &perrno); - // IXL_PF_UNLOCK(pf); - } else { - perrno = -EBUSY; + if (pf->state & IXL_PF_STATE_ADAPTER_RESETTING) { + free(nvma, M_DEVBUF); + return (-EBUSY); + } + + if (nvma->data_size < 1 || nvma->data_size > 4096) { + device_printf(dev, "%s: invalid request, data size not in supported range\n", + __func__); + free(nvma, M_DEVBUF); + return (EINVAL); + } + + /* + * Older versions of the NVM update tool don't set ifd_len to the size + * of the entire buffer passed to the ioctl. Check the data_size field + * in the contained i40e_nvm_access struct and ensure everything is + * copied in from userspace. + */ + exp_len = nvma_size + nvma->data_size - 1; /* One byte is kept in struct */ + + if (ifd_len < exp_len) { + ifd_len = exp_len; + nvma = realloc(nvma, ifd_len, M_DEVBUF, M_WAITOK); + err = copyin(ifd->ifd_data, nvma, ifd_len); + if (err) { + device_printf(dev, "%s: Cannot get request from user space\n", + __func__); + free(nvma, M_DEVBUF); + return (err); + } + } + + // TODO: Might need a different lock here + // IXL_PF_LOCK(pf); + status = i40e_nvmupd_command(hw, nvma, nvma->data, &perrno); + // IXL_PF_UNLOCK(pf); + + err = copyout(nvma, ifd->ifd_data, ifd_len); + free(nvma, M_DEVBUF); + if (err) { + device_printf(dev, "%s: Cannot return data to user space\n", + __func__); + return (err); } /* Let the nvmupdate report errors, show them only when debug is enabled */ From owner-svn-src-head@freebsd.org Thu Jan 24 03:42:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC26914BFEC3; Thu, 24 Jan 2019 03:42:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 840BE75932; Thu, 24 Jan 2019 03:42:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77ED622C12; Thu, 24 Jan 2019 03:42:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3gOgp025417; Thu, 24 Jan 2019 03:42:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3gOp0025415; Thu, 24 Jan 2019 03:42:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240342.x0O3gOp0025415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343375 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 840BE75932 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:42:25 -0000 Author: kevans Date: Thu Jan 24 03:42:23 2019 New Revision: 343375 URL: https://svnweb.freebsd.org/changeset/base/343375 Log: if_iwm - Move iwm_read_firmware() call into iwm_attach(). * We should load the firmware exactly once before the driver really initializes the hardware the first time, and unload it at detach time. There is no need to retrieve the firmware during execution of iwm_mvm_load_ucode_wait_alive(), we should make sure we already have the firmware data at hand before that. * The existing sc_preinit_hook code fails to deal with the case where if_iwm is loaded by the loader (or is statically linked) and the firmware needs to be loaded from disk. So we can just call iwm_read_firmware() from iwm_attach() directly. * A separate solution will have to be added to properly defer the firmware loading during bootup, until the necessary filesystem is mounted. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (0104ee1f4cb6a2313c00c2526c6ae98d42e5041d) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:41:44 2019 (r343374) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:42:23 2019 (r343375) @@ -245,7 +245,7 @@ static int iwm_firmware_store_section(struct iwm_softc const uint8_t *, size_t); static int iwm_set_default_calib(struct iwm_softc *, const void *); static void iwm_fw_info_free(struct iwm_fw_info *); -static int iwm_read_firmware(struct iwm_softc *, enum iwm_ucode_type); +static int iwm_read_firmware(struct iwm_softc *); static int iwm_alloc_fwmem(struct iwm_softc *); static int iwm_alloc_sched(struct iwm_softc *); static int iwm_alloc_kw(struct iwm_softc *); @@ -536,12 +536,11 @@ iwm_fw_info_free(struct iwm_fw_info *fw) { firmware_put(fw->fw_fp, FIRMWARE_UNLOAD); fw->fw_fp = NULL; - /* don't touch fw->fw_status */ memset(fw->fw_sects, 0, sizeof(fw->fw_sects)); } static int -iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) +iwm_read_firmware(struct iwm_softc *sc) { struct iwm_fw_info *fw = &sc->sc_fw; const struct iwm_tlv_ucode_header *uhdr; @@ -558,24 +557,11 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode int error = 0; size_t len; - if (fw->fw_status == IWM_FW_STATUS_DONE && - ucode_type != IWM_UCODE_INIT) - return 0; - - while (fw->fw_status == IWM_FW_STATUS_INPROGRESS) - msleep(&sc->sc_fw, &sc->sc_mtx, 0, "iwmfwp", 0); - fw->fw_status = IWM_FW_STATUS_INPROGRESS; - - if (fw->fw_fp != NULL) - iwm_fw_info_free(fw); - /* * Load firmware into driver memory. * fw_fp will be set. */ - IWM_UNLOCK(sc); fwp = firmware_get(sc->cfg->fw_name); - IWM_LOCK(sc); if (fwp == NULL) { device_printf(sc->sc_dev, "could not read firmware %s (error %d)\n", @@ -634,9 +620,8 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode case IWM_UCODE_TLV_PROBE_MAX_LEN: if (tlv_len != sizeof(uint32_t)) { device_printf(sc->sc_dev, - "%s: PROBE_MAX_LEN (%d) != sizeof(uint32_t)\n", - __func__, - (int) tlv_len); + "%s: PROBE_MAX_LEN (%u) != sizeof(uint32_t)\n", + __func__, tlv_len); error = EINVAL; goto parse_out; } @@ -655,9 +640,8 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode case IWM_UCODE_TLV_PAN: if (tlv_len) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TLV_PAN: tlv_len (%d) > 0\n", - __func__, - (int) tlv_len); + "%s: IWM_UCODE_TLV_PAN: tlv_len (%u) > 0\n", + __func__, tlv_len); error = EINVAL; goto parse_out; } @@ -666,17 +650,15 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode case IWM_UCODE_TLV_FLAGS: if (tlv_len < sizeof(uint32_t)) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TLV_FLAGS: tlv_len (%d) < sizeof(uint32_t)\n", - __func__, - (int) tlv_len); + "%s: IWM_UCODE_TLV_FLAGS: tlv_len (%u) < sizeof(uint32_t)\n", + __func__, tlv_len); error = EINVAL; goto parse_out; } if (tlv_len % sizeof(uint32_t)) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TLV_FLAGS: tlv_len (%d) %% sizeof(uint32_t)\n", - __func__, - (int) tlv_len); + "%s: IWM_UCODE_TLV_FLAGS: tlv_len (%u) %% sizeof(uint32_t)\n", + __func__, tlv_len); error = EINVAL; goto parse_out; } @@ -698,17 +680,15 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode tlv_data, tlv_len)) != 0) { device_printf(sc->sc_dev, "%s: iwm_store_cscheme(): returned %d\n", - __func__, - error); + __func__, error); goto parse_out; } break; case IWM_UCODE_TLV_NUM_OF_CPU: if (tlv_len != sizeof(uint32_t)) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TLV_NUM_OF_CPU: tlv_len (%d) != sizeof(uint32_t)\n", - __func__, - (int) tlv_len); + "%s: IWM_UCODE_TLV_NUM_OF_CPU: tlv_len (%u) != sizeof(uint32_t)\n", + __func__, tlv_len); error = EINVAL; goto parse_out; } @@ -733,8 +713,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode IWM_UCODE_REGULAR, tlv_data, tlv_len)) != 0) { device_printf(sc->sc_dev, "%s: IWM_UCODE_REGULAR: iwm_firmware_store_section() failed; %d\n", - __func__, - error); + __func__, error); goto parse_out; } break; @@ -743,8 +722,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode IWM_UCODE_INIT, tlv_data, tlv_len)) != 0) { device_printf(sc->sc_dev, "%s: IWM_UCODE_INIT: iwm_firmware_store_section() failed; %d\n", - __func__, - error); + __func__, error); goto parse_out; } break; @@ -753,26 +731,23 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode IWM_UCODE_WOWLAN, tlv_data, tlv_len)) != 0) { device_printf(sc->sc_dev, "%s: IWM_UCODE_WOWLAN: iwm_firmware_store_section() failed; %d\n", - __func__, - error); + __func__, error); goto parse_out; } break; case IWM_UCODE_TLV_DEF_CALIB: if (tlv_len != sizeof(struct iwm_tlv_calib_data)) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TLV_DEV_CALIB: tlv_len (%d) < sizeof(iwm_tlv_calib_data) (%d)\n", - __func__, - (int) tlv_len, - (int) sizeof(struct iwm_tlv_calib_data)); + "%s: IWM_UCODE_TLV_DEV_CALIB: tlv_len (%u) < sizeof(iwm_tlv_calib_data) (%zu)\n", + __func__, tlv_len, + sizeof(struct iwm_tlv_calib_data)); error = EINVAL; goto parse_out; } if ((error = iwm_set_default_calib(sc, tlv_data)) != 0) { device_printf(sc->sc_dev, "%s: iwm_set_default_calib() failed: %d\n", - __func__, - error); + __func__, error); goto parse_out; } break; @@ -780,9 +755,8 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode if (tlv_len != sizeof(uint32_t)) { error = EINVAL; device_printf(sc->sc_dev, - "%s: IWM_UCODE_TLV_PHY_SKU: tlv_len (%d) < sizeof(uint32_t)\n", - __func__, - (int) tlv_len); + "%s: IWM_UCODE_TLV_PHY_SKU: tlv_len (%u) < sizeof(uint32_t)\n", + __func__, tlv_len); goto parse_out; } sc->sc_fw.phy_config = @@ -907,12 +881,9 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode out: if (error) { - fw->fw_status = IWM_FW_STATUS_NONE; if (fw->fw_fp != NULL) iwm_fw_info_free(fw); - } else - fw->fw_status = IWM_FW_STATUS_DONE; - wakeup(&sc->sc_fw); + } return error; } @@ -2858,11 +2829,6 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, int error; static const uint16_t alive_cmd[] = { IWM_MVM_ALIVE }; - if ((error = iwm_read_firmware(sc, ucode_type)) != 0) { - device_printf(sc->sc_dev, "iwm_read_firmware: failed %d\n", - error); - return error; - } fw = &sc->sc_fw.fw_sects[ucode_type]; sc->cur_ucode = ucode_type; sc->ucode_loaded = FALSE; @@ -5849,7 +5815,7 @@ iwm_attach(device_t dev) sc->sc_wantresp = -1; - /* Check device type */ + /* Match device id */ error = iwm_dev_check(dev); if (error != 0) goto fail; @@ -5987,18 +5953,30 @@ iwm_attach(device_t dev) /* Max RSSI */ sc->sc_max_rssi = IWM_MAX_DBM - IWM_MIN_DBM; - sc->sc_preinit_hook.ich_func = iwm_preinit; - sc->sc_preinit_hook.ich_arg = sc; - if (config_intrhook_establish(&sc->sc_preinit_hook) != 0) { - device_printf(dev, "config_intrhook_establish failed\n"); - goto fail; - } - #ifdef IWM_DEBUG SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "debug", CTLFLAG_RW, &sc->sc_debug, 0, "control debugging"); #endif + + error = iwm_read_firmware(sc); + if (error) { + goto fail; + } else if (sc->sc_fw.fw_fp == NULL) { + /* + * XXX Add a solution for properly deferring firmware load + * during bootup. + */ + goto fail; + } else { + sc->sc_preinit_hook.ich_func = iwm_preinit; + sc->sc_preinit_hook.ich_arg = sc; + if (config_intrhook_establish(&sc->sc_preinit_hook) != 0) { + device_printf(dev, + "config_intrhook_establish failed\n"); + goto fail; + } + } IWM_DPRINTF(sc, IWM_DEBUG_RESET | IWM_DEBUG_TRACE, "<-%s\n", __func__); Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:41:44 2019 (r343374) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:42:23 2019 (r343375) @@ -139,15 +139,6 @@ struct iwm_tx_radiotap_header { #define IWM_UCODE_SECTION_MAX 16 -/* - * fw_status is used to determine if we've already parsed the firmware file - * - * In addition to the following, status < 0 ==> -error - */ -#define IWM_FW_STATUS_NONE 0 -#define IWM_FW_STATUS_INPROGRESS 1 -#define IWM_FW_STATUS_DONE 2 - /** * enum iwm_ucode_type * @@ -197,7 +188,6 @@ struct iwm_fw_desc { struct iwm_fw_info { const struct firmware *fw_fp; - int fw_status; struct iwm_fw_sects { struct iwm_fw_desc fw_sect[IWM_UCODE_SECTION_MAX]; From owner-svn-src-head@freebsd.org Thu Jan 24 03:41:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DCA414BFE81; Thu, 24 Jan 2019 03:41:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5CD7757CE; Thu, 24 Jan 2019 03:41:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D854622BD9; Thu, 24 Jan 2019 03:41:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3fi0X022177; Thu, 24 Jan 2019 03:41:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3fiVl022176; Thu, 24 Jan 2019 03:41:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240341.x0O3fiVl022176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343374 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E5CD7757CE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:41:45 -0000 Author: kevans Date: Thu Jan 24 03:41:44 2019 New Revision: 343374 URL: https://svnweb.freebsd.org/changeset/base/343374 Log: if_iwm - The iwm_prepare_card_hw() in iwm_attach() is only needed on 8K hw. * Doing the iwm_prepare_card_hw() call in iwm_attach() only on Family 8000 hardware matches the code in Linux iwlwifi. * While there remove DEFAULT_MAX_TX_POWER definition which is unused, and has a value different from IWL_DEFAULT_MAX_TX_POWER in iwlwifi. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (e8560f8dc58df12a7c79a6bb4e6ccb156e001085) Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:41:09 2019 (r343373) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:41:44 2019 (r343374) @@ -1912,8 +1912,6 @@ enum nvm_sku_bits { #define IWM_NVM_RF_CFG_TX_ANT_MSK_8000(x) ((x >> 24) & 0xF) #define IWM_NVM_RF_CFG_RX_ANT_MSK_8000(x) ((x >> 28) & 0xF) -#define DEFAULT_MAX_TX_POWER 16 - /** * enum iwm_nvm_channel_flags - channel flags in NVM * @IWM_NVM_CHANNEL_VALID: channel is usable for this SKU/geo @@ -5863,18 +5861,17 @@ iwm_attach(device_t dev) * "dash" value). To keep hw_rev backwards compatible - we'll store it * in the old format. */ - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) - sc->sc_hw_rev = (sc->sc_hw_rev & 0xfff0) | - (IWM_CSR_HW_REV_STEP(sc->sc_hw_rev << 2) << 2); - - if (iwm_prepare_card_hw(sc) != 0) { - device_printf(dev, "could not initialize hardware\n"); - goto fail; - } - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { int ret; uint32_t hw_step; + + sc->sc_hw_rev = (sc->sc_hw_rev & 0xfff0) | + (IWM_CSR_HW_REV_STEP(sc->sc_hw_rev << 2) << 2); + + if (iwm_prepare_card_hw(sc) != 0) { + device_printf(dev, "could not initialize hardware\n"); + goto fail; + } /* * In order to recognize C step the driver should read the From owner-svn-src-head@freebsd.org Thu Jan 24 03:45:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0603614C01A2; Thu, 24 Jan 2019 03:45:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3952975F54; Thu, 24 Jan 2019 03:45:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D95622C2E; Thu, 24 Jan 2019 03:45:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3jPnS025794; Thu, 24 Jan 2019 03:45:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3jOMx025793; Thu, 24 Jan 2019 03:45:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240345.x0O3jOMx025793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343380 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3952975F54 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:45:26 -0000 Author: kevans Date: Thu Jan 24 03:45:24 2019 New Revision: 343380 URL: https://svnweb.freebsd.org/changeset/base/343380 Log: if_iwm - Add firmware API definitions for TX power commands. * While there remove unused IWM_UCODE_TLV_CAPA_LMAC_UPLOAD definition, which isn't defined in iwlwifi. Taken-From: Linux iwlwifi Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (fd4f9de8bc72ea961e50829b45b59d0549040b7d) Modified: head/sys/dev/iwm/if_iwm_config.h head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwm_config.h ============================================================================== --- head/sys/dev/iwm/if_iwm_config.h Thu Jan 24 03:44:48 2019 (r343379) +++ head/sys/dev/iwm/if_iwm_config.h Thu Jan 24 03:45:24 2019 (r343380) @@ -80,6 +80,8 @@ enum iwm_device_family { IWM_DEVICE_FAMILY_8000, }; +#define IWM_DEFAULT_MAX_TX_POWER 22 + /* Antenna presence definitions */ #define IWM_ANT_NONE 0x0 #define IWM_ANT_A (1 << 0) Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:44:48 2019 (r343379) +++ head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:45:24 2019 (r343380) @@ -702,8 +702,9 @@ enum iwm_ucode_tlv_api { * @IWM_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG: support getting more shared * memory addresses from the firmware. * @IWM_UCODE_TLV_CAPA_LQM_SUPPORT: supports Link Quality Measurement - * @IWM_UCODE_TLV_CAPA_LMAC_UPLOAD: supports upload mode in lmac (1=supported, - * 0=no support) + * @IWM_UCODE_TLV_CAPA_TX_POWER_ACK: reduced TX power API has larger + * command size (command version 4) that supports toggling ACK TX + * power reduction. * * @IWM_NUM_UCODE_TLV_CAPA: number of bits used */ @@ -744,9 +745,9 @@ enum iwm_ucode_tlv_capa { IWM_UCODE_TLV_CAPA_TEMP_THS_REPORT_SUPPORT = 75, IWM_UCODE_TLV_CAPA_CTDP_SUPPORT = 76, IWM_UCODE_TLV_CAPA_USNIFFER_UNIFIED = 77, - IWM_UCODE_TLV_CAPA_LMAC_UPLOAD = 79, IWM_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG = 80, IWM_UCODE_TLV_CAPA_LQM_SUPPORT = 81, + IWM_UCODE_TLV_CAPA_TX_POWER_ACK = 84, IWM_NUM_UCODE_TLV_CAPA = 128 }; @@ -1916,6 +1917,51 @@ struct iwm_reduce_tx_power_cmd { uint8_t mac_context_id; uint16_t pwr_restriction; } __packed; /* IWM_TX_REDUCED_POWER_API_S_VER_1 */ + +enum iwm_dev_tx_power_cmd_mode { + IWM_TX_POWER_MODE_SET_MAC = 0, + IWM_TX_POWER_MODE_SET_DEVICE = 1, + IWM_TX_POWER_MODE_SET_CHAINS = 2, + IWM_TX_POWER_MODE_SET_ACK = 3, +}; /* TX_POWER_REDUCED_FLAGS_TYPE_API_E_VER_4 */; + +#define IWM_NUM_CHAIN_LIMITS 2 +#define IWM_NUM_SUB_BANDS 5 + +/** + * struct iwm_dev_tx_power_cmd - TX power reduction command + * @set_mode: see &enum iwl_dev_tx_power_cmd_mode + * @mac_context_id: id of the mac ctx for which we are reducing TX power. + * @pwr_restriction: TX power restriction in 1/8 dBms. + * @dev_24: device TX power restriction in 1/8 dBms + * @dev_52_low: device TX power restriction upper band - low + * @dev_52_high: device TX power restriction upper band - high + * @per_chain_restriction: per chain restrictions + */ +struct iwm_dev_tx_power_cmd_v3 { + uint32_t set_mode; + uint32_t mac_context_id; + uint16_t pwr_restriction; + uint16_t dev_24; + uint16_t dev_52_low; + uint16_t dev_52_high; + uint16_t per_chain_restriction[IWM_NUM_CHAIN_LIMITS][IWM_NUM_SUB_BANDS]; +} __packed; /* TX_REDUCED_POWER_API_S_VER_3 */ + +#define IWM_DEV_MAX_TX_POWER 0x7FFF + +/** + * struct iwm_dev_tx_power_cmd - TX power reduction command + * @v3: version 3 of the command, embedded here for easier software handling + * @enable_ack_reduction: enable or disable close range ack TX power + * reduction. + */ +struct iwm_dev_tx_power_cmd { + /* v4 is just an extension of v3 - keep this here */ + struct iwm_dev_tx_power_cmd_v3 v3; + uint8_t enable_ack_reduction; + uint8_t reserved[3]; +} __packed; /* TX_REDUCED_POWER_API_S_VER_4 */ /* * Calibration control struct. From owner-svn-src-head@freebsd.org Thu Jan 24 03:45:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E2A714C025E; Thu, 24 Jan 2019 03:45:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D214B7609C; Thu, 24 Jan 2019 03:45:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4C0D22C32; Thu, 24 Jan 2019 03:45:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3juSv025862; Thu, 24 Jan 2019 03:45:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3ju9i025858; Thu, 24 Jan 2019 03:45:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240345.x0O3ju9i025858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343381 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D214B7609C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:45:57 -0000 Author: kevans Date: Thu Jan 24 03:45:55 2019 New Revision: 343381 URL: https://svnweb.freebsd.org/changeset/base/343381 Log: iwm - Track firmware state better, and improve handling in iwm_newstate(). * This avoids firmware resets in all the cases in iwm_newstate(). Instead iwm_bring_down_firmware() is called, which tears down all the STA connection state, according to the sc->sc_firmware_state value. * Improve the behaviour of the LED blinking a bit, so it only blinks when there really is a wireless scan going on. * Print the newstate arg in debug output of iwm_newstate(), to help in debugging. This is inspired by the firmware state maintaining change in OpenBSD's iwm, by stsp@openbsd.org (OpenBSD Git 0ddb056fb7370664b1d4b84392697cb17d1a414a). Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (8a41b10ac639d0609878696808387a6799d39b57) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_mac_ctxt.c head/sys/dev/iwm/if_iwm_sta.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:45:24 2019 (r343380) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:45:55 2019 (r343381) @@ -350,7 +350,6 @@ static int iwm_raw_xmit(struct ieee80211_node *, struc const struct ieee80211_bpf_params *); static int iwm_mvm_update_quotas(struct iwm_softc *, struct iwm_vap *); static int iwm_auth(struct ieee80211vap *, struct iwm_softc *); -static int iwm_release(struct iwm_softc *, struct iwm_node *); static struct ieee80211_node * iwm_node_alloc(struct ieee80211vap *, const uint8_t[IEEE80211_ADDR_LEN]); @@ -1263,6 +1262,7 @@ iwm_stop_device(struct iwm_softc *sc) iv->phy_ctxt = NULL; iv->is_uploaded = 0; } + sc->sc_firmware_state = 0; /* device going down, Stop using ICT table */ sc->sc_flags &= ~IWM_FLAG_USE_ICT; @@ -3951,8 +3951,11 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s __func__, vap, ni); + IWM_DPRINTF(sc, IWM_DEBUG_STATE, "%s: Current node bssid: %s\n", + __func__, ether_sprintf(ni->ni_bssid)); in->in_assoc = 0; + iv->iv_auth = 1; /* * Firmware bug - it'll crash if the beacon interval is less @@ -4004,6 +4007,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s goto out; } } + sc->sc_firmware_state = 1; if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], in->in_ni.ni_chan, 1, 1)) != 0) { @@ -4018,6 +4022,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s "%s: binding update cmd\n", __func__); goto out; } + sc->sc_firmware_state = 2; /* * Authentication becomes unreliable when powersaving is left enabled * here. Powersaving will be activated again when association has @@ -4037,6 +4042,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s "%s: failed to add sta\n", __func__); goto out; } + sc->sc_firmware_state = 3; /* * Prevent the FW from wandering off channel during association @@ -4049,81 +4055,12 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s error = 0; out: + if (error != 0) + iv->iv_auth = 0; ieee80211_free_node(ni); return (error); } -static int -iwm_release(struct iwm_softc *sc, struct iwm_node *in) -{ - uint32_t tfd_msk; - - /* - * Ok, so *technically* the proper set of calls for going - * from RUN back to SCAN is: - * - * iwm_mvm_power_mac_disable(sc, in); - * iwm_mvm_mac_ctxt_changed(sc, vap); - * iwm_mvm_rm_sta(sc, in); - * iwm_mvm_update_quotas(sc, NULL); - * iwm_mvm_mac_ctxt_changed(sc, in); - * iwm_mvm_binding_remove_vif(sc, IWM_VAP(in->in_ni.ni_vap)); - * iwm_mvm_mac_ctxt_remove(sc, in); - * - * However, that freezes the device not matter which permutations - * and modifications are attempted. Obviously, this driver is missing - * something since it works in the Linux driver, but figuring out what - * is missing is a little more complicated. Now, since we're going - * back to nothing anyway, we'll just do a complete device reset. - * Up your's, device! - */ - /* - * Just using 0xf for the queues mask is fine as long as we only - * get here from RUN state. - */ - tfd_msk = 0xf; - iwm_xmit_queue_drain(sc); - iwm_mvm_flush_tx_path(sc, tfd_msk, IWM_CMD_SYNC); - /* - * We seem to get away with just synchronously sending the - * IWM_TXPATH_FLUSH command. - */ -// iwm_trans_wait_tx_queue_empty(sc, tfd_msk); - iwm_stop_device(sc); - iwm_init_hw(sc); - if (in) - in->in_assoc = 0; - return 0; - -#if 0 - int error; - - iwm_mvm_power_mac_disable(sc, in); - - if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) { - device_printf(sc->sc_dev, "mac ctxt change fail 1 %d\n", error); - return error; - } - - if ((error = iwm_mvm_rm_sta(sc, in)) != 0) { - device_printf(sc->sc_dev, "sta remove fail %d\n", error); - return error; - } - error = iwm_mvm_rm_sta(sc, in); - in->in_assoc = 0; - iwm_mvm_update_quotas(sc, NULL); - if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) { - device_printf(sc->sc_dev, "mac ctxt change fail 2 %d\n", error); - return error; - } - iwm_mvm_binding_remove_vif(sc, IWM_VAP(in->in_ni.ni_vap)); - - iwm_mvm_mac_ctxt_remove(sc, in); - - return error; -#endif -} - static struct ieee80211_node * iwm_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) { @@ -4282,7 +4219,98 @@ iwm_media_change(struct ifnet *ifp) return error; } +static void +iwm_bring_down_firmware(struct iwm_softc *sc, struct ieee80211vap *vap) +{ + struct iwm_vap *ivp = IWM_VAP(vap); + int error; + ivp->iv_auth = 0; + if (sc->sc_firmware_state == 3) { + iwm_xmit_queue_drain(sc); +// iwm_mvm_flush_tx_path(sc, 0xf, IWM_CMD_SYNC); + error = iwm_mvm_rm_sta(sc, vap, TRUE); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to remove station: %d\n", + __func__, error); + } + } + if (sc->sc_firmware_state == 3) { + error = iwm_mvm_mac_ctxt_changed(sc, vap); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to change mac context: %d\n", + __func__, error); + } + } + if (sc->sc_firmware_state == 3) { + error = iwm_mvm_sf_update(sc, vap, FALSE); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to update smart FIFO: %d\n", + __func__, error); + } + } + if (sc->sc_firmware_state == 3) { + error = iwm_mvm_rm_sta_id(sc, vap); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to remove station id: %d\n", + __func__, error); + } + } + if (sc->sc_firmware_state == 3) { + error = iwm_mvm_update_quotas(sc, NULL); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to update PHY quota: %d\n", + __func__, error); + } + } + if (sc->sc_firmware_state == 3) { + /* XXX Might need to specify bssid correctly. */ + error = iwm_mvm_mac_ctxt_changed(sc, vap); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to change mac context: %d\n", + __func__, error); + } + } + if (sc->sc_firmware_state == 3) { + sc->sc_firmware_state = 2; + } + if (sc->sc_firmware_state > 1) { + error = iwm_mvm_binding_remove_vif(sc, ivp); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to remove channel ctx: %d\n", + __func__, error); + } + } + if (sc->sc_firmware_state > 1) { + sc->sc_firmware_state = 1; + } + ivp->phy_ctxt = NULL; + if (sc->sc_firmware_state > 0) { + error = iwm_mvm_mac_ctxt_changed(sc, vap); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to change mac context: %d\n", + __func__, error); + } + } + if (sc->sc_firmware_state > 0) { + error = iwm_mvm_power_update_mac(sc); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: failed to update power management\n", + __func__); + } + } + sc->sc_firmware_state = 0; +} + static int iwm_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { @@ -4293,115 +4321,64 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ int error; IWM_DPRINTF(sc, IWM_DEBUG_STATE, - "switching state %s -> %s\n", + "switching state %s -> %s arg=0x%x\n", ieee80211_state_name[vap->iv_state], - ieee80211_state_name[nstate]); + ieee80211_state_name[nstate], + arg); + IEEE80211_UNLOCK(ic); IWM_LOCK(sc); - if (vap->iv_state == IEEE80211_S_SCAN && nstate != vap->iv_state) + if ((sc->sc_flags & IWM_FLAG_SCAN_RUNNING) && + (nstate == IEEE80211_S_AUTH || + nstate == IEEE80211_S_ASSOC || + nstate == IEEE80211_S_RUN)) { + /* Stop blinking for a scan, when authenticating. */ iwm_led_blink_stop(sc); + } - /* disable beacon filtering if we're hopping out of RUN */ - if (vap->iv_state == IEEE80211_S_RUN && nstate != vap->iv_state) { + if (vap->iv_state == IEEE80211_S_RUN && nstate != IEEE80211_S_RUN) { + iwm_mvm_led_disable(sc); + /* disable beacon filtering if we're hopping out of RUN */ iwm_mvm_disable_beacon_filter(sc); - if (((in = IWM_NODE(vap->iv_bss)) != NULL)) in->in_assoc = 0; + } - if (nstate == IEEE80211_S_INIT) { - IWM_UNLOCK(sc); - IEEE80211_LOCK(ic); - error = ivp->iv_newstate(vap, nstate, arg); - IEEE80211_UNLOCK(ic); - IWM_LOCK(sc); - iwm_release(sc, NULL); - IWM_UNLOCK(sc); - IEEE80211_LOCK(ic); - return error; - } - + if ((vap->iv_state == IEEE80211_S_RUN || + vap->iv_state == IEEE80211_S_ASSOC) && + nstate == IEEE80211_S_INIT) { /* - * It's impossible to directly go RUN->SCAN. If we iwm_release() - * above then the card will be completely reinitialized, - * so the driver must do everything necessary to bring the card - * from INIT to SCAN. - * - * Additionally, upon receiving deauth frame from AP, - * OpenBSD 802.11 stack puts the driver in IEEE80211_S_AUTH - * state. This will also fail with this driver, so bring the FSM - * from IEEE80211_S_RUN to IEEE80211_S_SCAN in this case as well. - * - * XXX TODO: fix this for FreeBSD! + * In this case, iv_newstate() wants to send an 80211 frame on + * the network that we are leaving. So we need to call it, + * before tearing down all the firmware state. */ - if (nstate == IEEE80211_S_SCAN || - nstate == IEEE80211_S_AUTH || - nstate == IEEE80211_S_ASSOC) { - IWM_DPRINTF(sc, IWM_DEBUG_STATE, - "Force transition to INIT; MGT=%d\n", arg); - IWM_UNLOCK(sc); - IEEE80211_LOCK(ic); - /* Always pass arg as -1 since we can't Tx right now. */ - /* - * XXX arg is just ignored anyway when transitioning - * to IEEE80211_S_INIT. - */ - vap->iv_newstate(vap, IEEE80211_S_INIT, -1); - IWM_DPRINTF(sc, IWM_DEBUG_STATE, - "Going INIT->SCAN\n"); - nstate = IEEE80211_S_SCAN; - IEEE80211_UNLOCK(ic); - IWM_LOCK(sc); - } + IWM_UNLOCK(sc); + IEEE80211_LOCK(ic); + ivp->iv_newstate(vap, nstate, arg); + IEEE80211_UNLOCK(ic); + IWM_LOCK(sc); + iwm_bring_down_firmware(sc, vap); + IWM_UNLOCK(sc); + IEEE80211_LOCK(ic); + return 0; } switch (nstate) { case IEEE80211_S_INIT: case IEEE80211_S_SCAN: - if (vap->iv_state == IEEE80211_S_AUTH || - vap->iv_state == IEEE80211_S_ASSOC) { - int myerr; - IWM_UNLOCK(sc); - IEEE80211_LOCK(ic); - myerr = ivp->iv_newstate(vap, nstate, arg); - IEEE80211_UNLOCK(ic); - IWM_LOCK(sc); - error = iwm_mvm_rm_sta(sc, vap, FALSE); - if (error) { - device_printf(sc->sc_dev, - "%s: Failed to remove station: %d\n", - __func__, error); - } - error = iwm_mvm_mac_ctxt_changed(sc, vap); - if (error) { - device_printf(sc->sc_dev, - "%s: Failed to change mac context: %d\n", - __func__, error); - } - error = iwm_mvm_binding_remove_vif(sc, ivp); - if (error) { - device_printf(sc->sc_dev, - "%s: Failed to remove channel ctx: %d\n", - __func__, error); - } - ivp->phy_ctxt = NULL; - error = iwm_mvm_power_update_mac(sc); - if (error != 0) { - device_printf(sc->sc_dev, - "%s: failed to update power management\n", - __func__); - } - IWM_UNLOCK(sc); - IEEE80211_LOCK(ic); - return myerr; - } break; case IEEE80211_S_AUTH: + iwm_bring_down_firmware(sc, vap); if ((error = iwm_auth(vap, sc)) != 0) { device_printf(sc->sc_dev, "%s: could not move to auth state: %d\n", __func__, error); + iwm_bring_down_firmware(sc, vap); + IWM_UNLOCK(sc); + IEEE80211_LOCK(ic); + return 1; } break; @@ -5566,6 +5543,8 @@ iwm_intr(void *arg) device_printf(sc->sc_dev, " 802.11 state %d\n", (vap == NULL) ? -1 : vap->iv_state); + /* Reset our firmware state tracking. */ + sc->sc_firmware_state = 0; /* Don't stop the device; just do a VAP restart */ IWM_UNLOCK(sc); Modified: head/sys/dev/iwm/if_iwm_mac_ctxt.c ============================================================================== --- head/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Jan 24 03:45:24 2019 (r343380) +++ head/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Jan 24 03:45:55 2019 (r343381) @@ -309,7 +309,12 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_softc *sc, stru * iwm_mvm_mac_ctxt_changed() when already authenticating or * associating, ni->ni_bssid should always make sense here. */ - IEEE80211_ADDR_COPY(cmd->bssid_addr, ni->ni_bssid); + if (ivp->iv_auth) { + IEEE80211_ADDR_COPY(cmd->bssid_addr, ni->ni_bssid); + } else { + /* XXX Or maybe all zeroes address? */ + IEEE80211_ADDR_COPY(cmd->bssid_addr, ieee80211broadcastaddr); + } #endif /* Modified: head/sys/dev/iwm/if_iwm_sta.c ============================================================================== --- head/sys/dev/iwm/if_iwm_sta.c Thu Jan 24 03:45:24 2019 (r343380) +++ head/sys/dev/iwm/if_iwm_sta.c Thu Jan 24 03:45:55 2019 (r343381) @@ -286,7 +286,7 @@ iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211v for (ac = 0; ac < WME_NUM_AC; ac++) { tfd_queue_msk |= htole32(1 << iwm_mvm_ac_to_tx_fifo[ac]); } - ret = iwm_mvm_flush_tx_path(sc, tfd_queue_msk, 0); + ret = iwm_mvm_flush_tx_path(sc, tfd_queue_msk, IWM_CMD_SYNC); if (ret) return ret; #ifdef notyet /* function not yet implemented */ Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:45:24 2019 (r343380) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:45:55 2019 (r343381) @@ -365,6 +365,7 @@ struct iwm_bf_data { struct iwm_vap { struct ieee80211vap iv_vap; int is_uploaded; + int iv_auth; int (*iv_newstate)(struct ieee80211vap *, enum ieee80211_state, int); @@ -558,6 +559,9 @@ struct iwm_softc { boolean_t sc_ps_disabled; int sc_ltr_enabled; + + /* Track firmware state for STA association. */ + int sc_firmware_state; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-head@freebsd.org Thu Jan 24 03:43:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7760214C0014; Thu, 24 Jan 2019 03:43:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1608475A39; Thu, 24 Jan 2019 03:43:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0233F22C21; Thu, 24 Jan 2019 03:43:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3gx1o025482; Thu, 24 Jan 2019 03:42:59 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3gxRB025481; Thu, 24 Jan 2019 03:42:59 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240342.x0O3gxRB025481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343376 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1608475A39 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:43:00 -0000 Author: kevans Date: Thu Jan 24 03:42:59 2019 New Revision: 343376 URL: https://svnweb.freebsd.org/changeset/base/343376 Log: if_iwm - Check sc->sc_attached flag in suspend/resume callbacks. * There is (almost) nothing to do in suspend/resume if if_iwm has failed during initialization (e.g. because of firmware load failure) and was already uninitialized by iwm_detach_local(). Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (67b5e090efb225654815fed91020db6cfc16bb19) Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:42:23 2019 (r343375) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:42:59 2019 (r343376) @@ -6301,6 +6301,10 @@ iwm_resume(device_t dev) * PCI Tx retries from interfering with C3 CPU state. */ pci_write_config(dev, PCI_CFG_RETRY_TIMEOUT, 0x00, 1); + + if (!sc->sc_attached) + return 0; + iwm_init_task(device_get_softc(dev)); IWM_LOCK(sc); @@ -6323,6 +6327,9 @@ iwm_suspend(device_t dev) struct iwm_softc *sc = device_get_softc(dev); do_stop = !! (sc->sc_ic.ic_nrunning > 0); + + if (!sc->sc_attached) + return (0); ieee80211_suspend_all(&sc->sc_ic); From owner-svn-src-head@freebsd.org Thu Jan 24 03:50:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85B1214C0864; Thu, 24 Jan 2019 03:50:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28FD976DA7; Thu, 24 Jan 2019 03:50:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B7CF22C47; Thu, 24 Jan 2019 03:50:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3oRLC026481; Thu, 24 Jan 2019 03:50:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3oReE026480; Thu, 24 Jan 2019 03:50:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240350.x0O3oReE026480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343390 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 28FD976DA7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:50:28 -0000 Author: kevans Date: Thu Jan 24 03:50:27 2019 New Revision: 343390 URL: https://svnweb.freebsd.org/changeset/base/343390 Log: iwm - Remove unused TX_CMD_NEXT_FRAME_* Taken-From: Linux git b1e06c65fb69c5e3fddcd91987561e225eaa9bfa Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (b0c6116f364a121ab6b9d634ca1997d4167fa747) Modified: head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:50:03 2019 (r343389) +++ head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:50:27 2019 (r343390) @@ -4283,30 +4283,7 @@ enum iwm_tx_pm_timeouts { #define IWM_TX_CMD_SEC_WEP_KEY_IDX_MSK 0xc0 #define IWM_TX_CMD_SEC_KEY128 0x08 -/* TODO: how does these values are OK with only 16 bit variable??? */ /* - * TX command next frame info - * - * bits 0:2 - security control (IWM_TX_CMD_SEC_*) - * bit 3 - immediate ACK required - * bit 4 - rate is taken from STA table - * bit 5 - frame belongs to BA stream - * bit 6 - immediate BA response expected - * bit 7 - unused - * bits 8:15 - Station ID - * bits 16:31 - rate - */ -#define IWM_TX_CMD_NEXT_FRAME_ACK_MSK (0x8) -#define IWM_TX_CMD_NEXT_FRAME_STA_RATE_MSK (0x10) -#define IWM_TX_CMD_NEXT_FRAME_BA_MSK (0x20) -#define IWM_TX_CMD_NEXT_FRAME_IMM_BA_RSP_MSK (0x40) -#define IWM_TX_CMD_NEXT_FRAME_FLAGS_MSK (0xf8) -#define IWM_TX_CMD_NEXT_FRAME_STA_ID_MSK (0xff00) -#define IWM_TX_CMD_NEXT_FRAME_STA_ID_POS (8) -#define IWM_TX_CMD_NEXT_FRAME_RATE_MSK (0xffff0000) -#define IWM_TX_CMD_NEXT_FRAME_RATE_POS (16) - -/* * TX command Frame life time in us - to be written in pm_frame_timeout */ #define IWM_TX_CMD_LIFE_TIME_INFINITE 0xFFFFFFFF @@ -4343,7 +4320,7 @@ enum iwm_tx_pm_timeouts { * @initial_rate_index: index into the rate table for initial TX attempt. * Applied if IWM_TX_CMD_FLG_STA_RATE_MSK is set, normally 0 for data frames. * @key: security key - * @next_frame_flags: IWM_TX_CMD_SEC_* and IWM_TX_CMD_NEXT_FRAME_* + * @reserved3: reserved * @life_time: frame life time (usecs??) * @dram_lsb_ptr: Physical address of scratch area in the command (try_cnt + * btkill_cnd + reserved), first 32 bits. "0" disables usage. From owner-svn-src-head@freebsd.org Thu Jan 24 03:48:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC5B314C063C; Thu, 24 Jan 2019 03:48:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 763A97677A; Thu, 24 Jan 2019 03:48:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69AC922C3D; Thu, 24 Jan 2019 03:48:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3mRwm026147; Thu, 24 Jan 2019 03:48:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3mR4O026146; Thu, 24 Jan 2019 03:48:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240348.x0O3mR4O026146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343385 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 763A97677A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:48:27 -0000 Author: kevans Date: Thu Jan 24 03:48:27 2019 New Revision: 343385 URL: https://svnweb.freebsd.org/changeset/base/343385 Log: iwm - Always clear watchdog timer, when bringing down firmware state. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (8abdc2b36a45c4e9c95fc8263ca532ea26633dcb) Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:47:47 2019 (r343384) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:48:27 2019 (r343385) @@ -4225,6 +4225,9 @@ iwm_bring_down_firmware(struct iwm_softc *sc, struct i struct iwm_vap *ivp = IWM_VAP(vap); int error; + /* Avoid Tx watchdog triggering, when transfers get dropped here. */ + sc->sc_tx_timer = 0; + ivp->iv_auth = 0; if (sc->sc_firmware_state == 3) { iwm_xmit_queue_drain(sc); @@ -4328,10 +4331,6 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ IEEE80211_UNLOCK(ic); IWM_LOCK(sc); - - /* Avoid Tx watchdog triggering, when a connectionm is dropped. */ - if (vap->iv_state == IEEE80211_S_RUN && nstate != IEEE80211_S_RUN) - sc->sc_tx_timer = 0; if ((sc->sc_flags & IWM_FLAG_SCAN_RUNNING) && (nstate == IEEE80211_S_AUTH || From owner-svn-src-head@freebsd.org Thu Jan 24 03:49:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B954C14C06CB; Thu, 24 Jan 2019 03:49:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6149E769FB; Thu, 24 Jan 2019 03:49:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5440922C3F; Thu, 24 Jan 2019 03:49:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3nC51026270; Thu, 24 Jan 2019 03:49:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3nC5i026268; Thu, 24 Jan 2019 03:49:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240349.x0O3nC5i026268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343387 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6149E769FB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:49:12 -0000 Author: kevans Date: Thu Jan 24 03:49:11 2019 New Revision: 343387 URL: https://svnweb.freebsd.org/changeset/base/343387 Log: iwm - Fix race during detach, where a callout is left after driver is gone. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (ba3b4ff9a1fc04a349df05d6d3449f4d9b15c4be) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_led.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:48:50 2019 (r343386) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:49:11 2019 (r343387) @@ -4829,6 +4829,9 @@ iwm_watchdog(void *arg) struct iwm_softc *sc = arg; struct ieee80211com *ic = &sc->sc_ic; + if (sc->sc_attached == 0) + return; + if (sc->sc_tx_timer > 0) { if (--sc->sc_tx_timer == 0) { device_printf(sc->sc_dev, "device timeout\n"); Modified: head/sys/dev/iwm/if_iwm_led.c ============================================================================== --- head/sys/dev/iwm/if_iwm_led.c Thu Jan 24 03:48:50 2019 (r343386) +++ head/sys/dev/iwm/if_iwm_led.c Thu Jan 24 03:49:11 2019 (r343387) @@ -162,6 +162,9 @@ iwm_led_blink_timeout(void *arg) { struct iwm_softc *sc = arg; + if (sc->sc_attached == 0) + return; + if (iwm_mvm_led_is_enabled(sc)) iwm_mvm_led_disable(sc); else From owner-svn-src-head@freebsd.org Thu Jan 24 03:44:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DED9B14C00D0; Thu, 24 Jan 2019 03:44:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85BAD75CB2; Thu, 24 Jan 2019 03:44:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7671F22C28; Thu, 24 Jan 2019 03:44:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3iLP1025651; Thu, 24 Jan 2019 03:44:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3iLOj025650; Thu, 24 Jan 2019 03:44:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240344.x0O3iLOj025650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343378 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 85BAD75CB2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:44:22 -0000 Author: kevans Date: Thu Jan 24 03:44:20 2019 New Revision: 343378 URL: https://svnweb.freebsd.org/changeset/base/343378 Log: if_iwm - Update struct iwm_scan_results_notif. Remove old/unused definitions * Remove outdated notifications IWM_SCAN_ABORT_CMD, IWM_SCAN_START_NOTIFICATION and IWM_SCAN_RESULTS_NOTIFICATION. * Remove unused enum iwm_scan_complete_status. * Use the updated FW Api version 3 of struct iwm_scan_results_notif. * No functional change, since struct iwm_scan_results_notif is never accessed in iwm at the moment. Taken-From: Linux iwlwifi commits 1083fd7391e989be52022f0f338e9dadc048b063 and 75118fdb63496e4611ab50380499ddd62b9de69f. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (c947b0b8dc96dabefd63f7b70d53695e36c7b64f) Modified: head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:43:45 2019 (r343377) +++ head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:44:20 2019 (r343378) @@ -1794,11 +1794,6 @@ enum { /* Thermal Throttling*/ IWM_REPLY_THERMAL_MNG_BACKOFF = 0x7e, - /* Scanning */ - IWM_SCAN_ABORT_CMD = 0x81, - IWM_SCAN_START_NOTIFICATION = 0x82, - IWM_SCAN_RESULTS_NOTIFICATION = 0x83, - /* NVM */ IWM_NVM_ACCESS_CMD = 0x88, @@ -4952,50 +4947,14 @@ struct iwm_periodic_scan_complete { uint32_t reserved; } __packed; -/* How many statistics are gathered for each channel */ -#define IWM_SCAN_RESULTS_STATISTICS 1 - /** - * enum iwm_scan_complete_status - status codes for scan complete notifications - * @IWM_SCAN_COMP_STATUS_OK: scan completed successfully - * @IWM_SCAN_COMP_STATUS_ABORT: scan was aborted by user - * @IWM_SCAN_COMP_STATUS_ERR_SLEEP: sending null sleep packet failed - * @IWM_SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT: timeout before channel is ready - * @IWM_SCAN_COMP_STATUS_ERR_PROBE: sending probe request failed - * @IWM_SCAN_COMP_STATUS_ERR_WAKEUP: sending null wakeup packet failed - * @IWM_SCAN_COMP_STATUS_ERR_ANTENNAS: invalid antennas chosen at scan command - * @IWM_SCAN_COMP_STATUS_ERR_INTERNAL: internal error caused scan abort - * @IWM_SCAN_COMP_STATUS_ERR_COEX: medium was lost ot WiMax - * @IWM_SCAN_COMP_STATUS_P2P_ACTION_OK: P2P public action frame TX was successful - * (not an error!) - * @IWM_SCAN_COMP_STATUS_ITERATION_END: indicates end of one repeatition the driver - * asked for - * @IWM_SCAN_COMP_STATUS_ERR_ALLOC_TE: scan could not allocate time events -*/ -enum iwm_scan_complete_status { - IWM_SCAN_COMP_STATUS_OK = 0x1, - IWM_SCAN_COMP_STATUS_ABORT = 0x2, - IWM_SCAN_COMP_STATUS_ERR_SLEEP = 0x3, - IWM_SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT = 0x4, - IWM_SCAN_COMP_STATUS_ERR_PROBE = 0x5, - IWM_SCAN_COMP_STATUS_ERR_WAKEUP = 0x6, - IWM_SCAN_COMP_STATUS_ERR_ANTENNAS = 0x7, - IWM_SCAN_COMP_STATUS_ERR_INTERNAL = 0x8, - IWM_SCAN_COMP_STATUS_ERR_COEX = 0x9, - IWM_SCAN_COMP_STATUS_P2P_ACTION_OK = 0xA, - IWM_SCAN_COMP_STATUS_ITERATION_END = 0x0B, - IWM_SCAN_COMP_STATUS_ERR_ALLOC_TE = 0x0C, -}; - -/** - * struct iwm_scan_results_notif - scan results for one channel - * ( IWM_SCAN_RESULTS_NOTIFICATION = 0x83 ) + * struct iwm_scan_results_notif - scan results for one channel - + * SCAN_RESULT_NTF_API_S_VER_3 * @channel: which channel the results are from * @band: 0 for 5.2 GHz, 1 for 2.4 GHz * @probe_status: IWM_SCAN_PROBE_STATUS_*, indicates success of probe request * @num_probe_not_sent: # of request that weren't sent due to not enough time * @duration: duration spent in channel, in usecs - * @statistics: statistics gathered for this channel */ struct iwm_scan_results_notif { uint8_t channel; @@ -5003,8 +4962,7 @@ struct iwm_scan_results_notif { uint8_t probe_status; uint8_t num_probe_not_sent; uint32_t duration; - uint32_t statistics[IWM_SCAN_RESULTS_STATISTICS]; -} __packed; /* IWM_SCAN_RESULT_NTF_API_S_VER_2 */ +} __packed; enum iwm_scan_framework_client { IWM_SCAN_CLIENT_SCHED_SCAN = (1 << 0), From owner-svn-src-head@freebsd.org Thu Jan 24 03:44:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FBB714C013B; Thu, 24 Jan 2019 03:44:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EADB775E1A; Thu, 24 Jan 2019 03:44:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCD7422C2B; Thu, 24 Jan 2019 03:44:49 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3in6M025715; Thu, 24 Jan 2019 03:44:49 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3inie025711; Thu, 24 Jan 2019 03:44:49 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240344.x0O3inie025711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343379 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EADB775E1A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:44:50 -0000 Author: kevans Date: Thu Jan 24 03:44:48 2019 New Revision: 343379 URL: https://svnweb.freebsd.org/changeset/base/343379 Log: if_iwm - Configure the PCIe LTR, fix PCI express capability accesses. Taken-From: Linux iwlwifi Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (08a7ad5a5ff65aaaf2df6a609be7a4e1df43efc3) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_pcie_trans.c head/sys/dev/iwm/if_iwmreg.h head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:44:20 2019 (r343378) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:44:48 2019 (r343379) @@ -320,6 +320,7 @@ static int iwm_send_phy_cfg_cmd(struct iwm_softc *); static int iwm_mvm_load_ucode_wait_alive(struct iwm_softc *, enum iwm_ucode_type); static int iwm_run_init_mvm_ucode(struct iwm_softc *, int); +static int iwm_mvm_config_ltr(struct iwm_softc *sc); static int iwm_rx_addbuf(struct iwm_softc *, int, int); static int iwm_mvm_get_signal_strength(struct iwm_softc *, struct iwm_rx_phy_info *); @@ -3000,6 +3001,19 @@ out: return ret; } +static int +iwm_mvm_config_ltr(struct iwm_softc *sc) +{ + struct iwm_ltr_config_cmd cmd = { + .flags = htole32(IWM_LTR_CFG_FLAG_FEATURE_ENABLE), + }; + + if (!sc->sc_ltr_enabled) + return 0; + + return iwm_mvm_send_cmd_pdu(sc, IWM_LTR_CONFIG, 0, sizeof(cmd), &cmd); +} + /* * receive side */ @@ -4665,6 +4679,9 @@ iwm_init_hw(struct iwm_softc *sc) if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) iwm_mvm_tt_tx_backoff(sc, 0); + if (iwm_mvm_config_ltr(sc) != 0) + device_printf(sc->sc_dev, "PCIe LTR configuration failed\n"); + error = iwm_mvm_power_update_device(sc); if (error) goto error; @@ -5292,6 +5309,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) case IWM_MAC_CONTEXT_CMD: case IWM_REPLY_SF_CFG_CMD: case IWM_POWER_TABLE_CMD: + case IWM_LTR_CONFIG: case IWM_PHY_CONTEXT_CMD: case IWM_BINDING_CONTEXT_CMD: case IWM_TIME_EVENT_CMD: Modified: head/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Jan 24 03:44:20 2019 (r343378) +++ head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Jan 24 03:44:48 2019 (r343379) @@ -406,18 +406,39 @@ iwm_prepare_card_hw(struct iwm_softc *sc) void iwm_apm_config(struct iwm_softc *sc) { - uint16_t reg; + uint16_t lctl, cap; + int pcie_ptr; - reg = pci_read_config(sc->sc_dev, PCIER_LINK_CTL, sizeof(reg)); - if (reg & PCIEM_LINK_CTL_ASPMC_L1) { - /* Um the Linux driver prints "Disabling L0S for this one ... */ + /* + * HW bug W/A for instability in PCIe bus L0S->L1 transition. + * Check if BIOS (or OS) enabled L1-ASPM on this device. + * If so (likely), disable L0S, so device moves directly L0->L1; + * costs negligible amount of power savings. + * If not (unlikely), enable L0S, so there is at least some + * power savings, even without L1. + */ + int error; + + error = pci_find_cap(sc->sc_dev, PCIY_EXPRESS, &pcie_ptr); + if (error != 0) + return; + lctl = pci_read_config(sc->sc_dev, pcie_ptr + PCIER_LINK_CTL, + sizeof(lctl)); + if (lctl & PCIEM_LINK_CTL_ASPMC_L1) { IWM_SETBITS(sc, IWM_CSR_GIO_REG, IWM_CSR_GIO_REG_VAL_L0S_ENABLED); } else { - /* ... and "Enabling" here */ IWM_CLRBITS(sc, IWM_CSR_GIO_REG, IWM_CSR_GIO_REG_VAL_L0S_ENABLED); } + + cap = pci_read_config(sc->sc_dev, pcie_ptr + PCIER_DEVICE_CTL2, + sizeof(cap)); + sc->sc_ltr_enabled = (cap & PCIEM_CTL2_LTR_ENABLE) ? 1 : 0; + IWM_DPRINTF(sc, IWM_DEBUG_RESET | IWM_DEBUG_PWRSAVE, + "L1 %sabled - LTR %sabled\n", + (lctl & PCIEM_LINK_CTL_ASPMC_L1) ? "En" : "Dis", + sc->sc_ltr_enabled ? "En" : "Dis"); } /* Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:44:20 2019 (r343378) +++ head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:44:48 2019 (r343379) @@ -1790,6 +1790,7 @@ enum { /* Power - legacy power table command */ IWM_POWER_TABLE_CMD = 0x77, IWM_PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78, + IWM_LTR_CONFIG = 0xee, /* Thermal Throttling*/ IWM_REPLY_THERMAL_MNG_BACKOFF = 0x7e, @@ -3521,6 +3522,57 @@ struct iwm_nonqos_seq_query_cmd { */ /* Power Management Commands, Responses, Notifications */ + +/** + * enum iwm_ltr_config_flags - masks for LTR config command flags + * @IWM_LTR_CFG_FLAG_FEATURE_ENABLE: Feature operational status + * @IWM_LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS: allow LTR change on shadow + * memory access + * @IWM_LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH: allow LTR msg send on ANY LTR + * reg change + * @IWM_LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3: allow LTR msg send on transition from + * D0 to D3 + * @IWM_LTR_CFG_FLAG_SW_SET_SHORT: fixed static short LTR register + * @IWM_LTR_CFG_FLAG_SW_SET_LONG: fixed static short LONG register + * @IWM_LTR_CFG_FLAG_DENIE_C10_ON_PD: allow going into C10 on PD + */ +enum iwm_ltr_config_flags { + IWM_LTR_CFG_FLAG_FEATURE_ENABLE = (1 << 0), + IWM_LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS = (1 << 1), + IWM_LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH = (1 << 2), + IWM_LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3 = (1 << 3), + IWM_LTR_CFG_FLAG_SW_SET_SHORT = (1 << 4), + IWM_LTR_CFG_FLAG_SW_SET_LONG = (1 << 5), + IWM_LTR_CFG_FLAG_DENIE_C10_ON_PD = (1 << 6), +}; + +/** + * struct iwm_ltr_config_cmd_v1 - configures the LTR + * @flags: See %enum iwm_ltr_config_flags + */ +struct iwm_ltr_config_cmd_v1 { + uint32_t flags; + uint32_t static_long; + uint32_t static_short; +} __packed; /* LTR_CAPABLE_API_S_VER_1 */ + +#define IWM_LTR_VALID_STATES_NUM 4 + +/** + * struct iwm_ltr_config_cmd - configures the LTR + * @flags: See %enum iwm_ltr_config_flags + * @static_long: + * @static_short: + * @ltr_cfg_values: + * @ltr_short_idle_timeout: + */ +struct iwm_ltr_config_cmd { + uint32_t flags; + uint32_t static_long; + uint32_t static_short; + uint32_t ltr_cfg_values[IWM_LTR_VALID_STATES_NUM]; + uint32_t ltr_short_idle_timeout; +} __packed; /* LTR_CAPABLE_API_S_VER_2 */ /* Radio LP RX Energy Threshold measured in dBm */ #define IWM_POWER_LPRX_RSSI_THRESHOLD 75 Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:44:20 2019 (r343378) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:44:48 2019 (r343379) @@ -556,6 +556,8 @@ struct iwm_softc { /* Indicate if device power save is allowed */ boolean_t sc_ps_disabled; + + int sc_ltr_enabled; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-head@freebsd.org Thu Jan 24 03:47:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A676614C03B0; Thu, 24 Jan 2019 03:47:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BED37636F; Thu, 24 Jan 2019 03:47:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10B3522C39; Thu, 24 Jan 2019 03:47:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3l5ie026004; Thu, 24 Jan 2019 03:47:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3l5V6026000; Thu, 24 Jan 2019 03:47:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240347.x0O3l5V6026000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343383 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1BED37636F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:47:06 -0000 Author: kevans Date: Thu Jan 24 03:47:04 2019 New Revision: 343383 URL: https://svnweb.freebsd.org/changeset/base/343383 Log: iwm - Improve firmware Time Event handling. * This is a mix of the OpenBSD Git 7fd9664469d1b717a307eebd74aeececbd3c41cc change, and syncing with the Linux iwlwifi code. Taken-From: Linux iwlwifi, and OpenBSD Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (706a3044afd27c3fecfdf57bec1695310e53e228) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_debug.h head/sys/dev/iwm/if_iwm_time_event.c head/sys/dev/iwm/if_iwm_time_event.h head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:46:35 2019 (r343382) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:47:04 2019 (r343383) @@ -1263,6 +1263,7 @@ iwm_stop_device(struct iwm_softc *sc) iv->is_uploaded = 0; } sc->sc_firmware_state = 0; + sc->sc_flags &= ~IWM_FLAG_TE_ACTIVE; /* device going down, Stop using ICT table */ sc->sc_flags &= ~IWM_FLAG_USE_ICT; @@ -4050,8 +4051,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s */ /* XXX duration is in units of TU, not MS */ duration = IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS; - iwm_mvm_protect_session(sc, iv, duration, 500 /* XXX magic number */); - DELAY(100); + iwm_mvm_protect_session(sc, iv, duration, 500 /* XXX magic number */, TRUE); error = 0; out: @@ -4347,6 +4347,15 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ iwm_mvm_disable_beacon_filter(sc); if (((in = IWM_NODE(vap->iv_bss)) != NULL)) in->in_assoc = 0; + } + + if ((vap->iv_state == IEEE80211_S_AUTH || + vap->iv_state == IEEE80211_S_ASSOC || + vap->iv_state == IEEE80211_S_RUN) && + (nstate == IEEE80211_S_INIT || + nstate == IEEE80211_S_SCAN || + nstate == IEEE80211_S_AUTH)) { + iwm_mvm_stop_session_protection(sc, ivp); } if ((vap->iv_state == IEEE80211_S_RUN || Modified: head/sys/dev/iwm/if_iwm_debug.h ============================================================================== --- head/sys/dev/iwm/if_iwm_debug.h Thu Jan 24 03:46:35 2019 (r343382) +++ head/sys/dev/iwm/if_iwm_debug.h Thu Jan 24 03:47:04 2019 (r343383) @@ -44,6 +44,7 @@ enum { IWM_DEBUG_TEMP = 0x00100000, /* Thermal Sensor handling */ IWM_DEBUG_FW = 0x00200000, /* Firmware management */ IWM_DEBUG_LAR = 0x00400000, /* Location Aware Regulatory */ + IWM_DEBUG_TE = 0x00800000, /* Time Event handling */ IWM_DEBUG_REGISTER = 0x20000000, /* print chipset register */ IWM_DEBUG_TRACE = 0x40000000, /* Print begin and start driver function */ IWM_DEBUG_FATAL = 0x80000000, /* fatal errors */ Modified: head/sys/dev/iwm/if_iwm_time_event.c ============================================================================== --- head/sys/dev/iwm/if_iwm_time_event.c Thu Jan 24 03:46:35 2019 (r343382) +++ head/sys/dev/iwm/if_iwm_time_event.c Thu Jan 24 03:47:04 2019 (r343383) @@ -155,6 +155,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -166,31 +167,132 @@ __FBSDID("$FreeBSD$"); #define IWM_MVM_ROC_TE_TYPE_MGMT_TX IWM_TE_P2P_CLIENT_ASSOC static int +iwm_mvm_te_notif(struct iwm_softc *sc, struct iwm_rx_packet *pkt, + void *data) +{ + struct iwm_time_event_notif *resp; + int resp_len = iwm_rx_packet_payload_len(pkt); + + if (pkt->hdr.code != IWM_TIME_EVENT_NOTIFICATION || + resp_len != sizeof(*resp)) { + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "Invalid TIME_EVENT_NOTIFICATION response\n"); + return 1; + } + + resp = (void *)pkt->data; + + /* te_data->uid is already set in the TIME_EVENT_CMD response */ + if (le32toh(resp->unique_id) != sc->sc_time_event_uid) + return false; + + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "TIME_EVENT_NOTIFICATION response - UID = 0x%x\n", + sc->sc_time_event_uid); + if (!resp->status) { + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "TIME_EVENT_NOTIFICATION received but not executed\n"); + } + + return 1; +} + +static int +iwm_mvm_time_event_response(struct iwm_softc *sc, struct iwm_rx_packet *pkt, + void *data) +{ + struct iwm_time_event_resp *resp; + int resp_len = iwm_rx_packet_payload_len(pkt); + + if (pkt->hdr.code != IWM_TIME_EVENT_CMD || + resp_len != sizeof(*resp)) { + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "Invalid TIME_EVENT_CMD response\n"); + return 1; + } + + resp = (void *)pkt->data; + + /* we should never get a response to another TIME_EVENT_CMD here */ + if (le32toh(resp->id) != IWM_TE_BSS_STA_AGGRESSIVE_ASSOC) { + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "Got TIME_EVENT_CMD response with wrong id: %d\n", + le32toh(resp->id)); + return 0; + } + + sc->sc_time_event_uid = le32toh(resp->unique_id); + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "TIME_EVENT_CMD response - UID = 0x%x\n", sc->sc_time_event_uid); + return 1; +} + + +/* XXX Use the te_data function argument properly, like in iwlwifi's code. */ + +static int iwm_mvm_time_event_send_add(struct iwm_softc *sc, struct iwm_vap *ivp, void *te_data, struct iwm_time_event_cmd *te_cmd) { + static const uint16_t time_event_response[] = { IWM_TIME_EVENT_CMD }; + struct iwm_notification_wait wait_time_event; int ret; - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + IWM_DPRINTF(sc, IWM_DEBUG_TE, "Add new TE, duration %d TU\n", le32toh(te_cmd->duration)); - ret = iwm_mvm_send_cmd_pdu(sc, IWM_TIME_EVENT_CMD, IWM_CMD_SYNC, - sizeof(*te_cmd), te_cmd); + /* + * Use a notification wait, which really just processes the + * command response and doesn't wait for anything, in order + * to be able to process the response and get the UID inside + * the RX path. Using CMD_WANT_SKB doesn't work because it + * stores the buffer and then wakes up this thread, by which + * time another notification (that the time event started) + * might already be processed unsuccessfully. + */ + iwm_init_notification_wait(sc->sc_notif_wait, &wait_time_event, + time_event_response, + nitems(time_event_response), + iwm_mvm_time_event_response, /*te_data*/NULL); + + ret = iwm_mvm_send_cmd_pdu(sc, IWM_TIME_EVENT_CMD, 0, sizeof(*te_cmd), + te_cmd); if (ret) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + IWM_DPRINTF(sc, IWM_DEBUG_TE, "%s: Couldn't send IWM_TIME_EVENT_CMD: %d\n", __func__, ret); + iwm_remove_notification(sc->sc_notif_wait, &wait_time_event); + return ret; } + /* No need to wait for anything, so just pass 1 (0 isn't valid) */ + IWM_UNLOCK(sc); + ret = iwm_wait_notification(sc->sc_notif_wait, &wait_time_event, 1); + IWM_LOCK(sc); + /* should never fail */ + if (ret) { + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "%s: Failed to get response for IWM_TIME_EVENT_CMD: %d\n", + __func__, ret); + } + return ret; } +#define TU_TO_HZ(tu) (((uint64_t)(tu) * 1024 * hz) / 1000000) + void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_vap *ivp, - uint32_t duration, uint32_t max_delay) + uint32_t duration, uint32_t max_delay, boolean_t wait_for_notif) { + const uint16_t te_notif_response[] = { IWM_TIME_EVENT_NOTIFICATION }; + struct iwm_notification_wait wait_te_notif; struct iwm_time_event_cmd time_cmd = {}; + /* Do nothing if a time event is already scheduled. */ + if (sc->sc_flags & IWM_FLAG_TE_ACTIVE) + return; + time_cmd.action = htole32(IWM_FW_CTXT_ACTION_ADD); time_cmd.id_and_color = htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, ivp->color)); @@ -209,5 +311,58 @@ iwm_mvm_protect_session(struct iwm_softc *sc, struct i IWM_TE_V2_NOTIF_HOST_EVENT_END | IWM_T2_V2_START_IMMEDIATELY); - iwm_mvm_time_event_send_add(sc, ivp, /*te_data*/NULL, &time_cmd); + if (!wait_for_notif) { + iwm_mvm_time_event_send_add(sc, ivp, /*te_data*/NULL, &time_cmd); + DELAY(100); + sc->sc_flags |= IWM_FLAG_TE_ACTIVE; + return; + } + + /* + * Create notification_wait for the TIME_EVENT_NOTIFICATION to use + * right after we send the time event + */ + iwm_init_notification_wait(sc->sc_notif_wait, &wait_te_notif, + te_notif_response, nitems(te_notif_response), + iwm_mvm_te_notif, /*te_data*/NULL); + + /* If TE was sent OK - wait for the notification that started */ + if (iwm_mvm_time_event_send_add(sc, ivp, /*te_data*/NULL, &time_cmd)) { + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "%s: Failed to add TE to protect session\n", __func__); + iwm_remove_notification(sc->sc_notif_wait, &wait_te_notif); + } else { + sc->sc_flags |= IWM_FLAG_TE_ACTIVE; + IWM_UNLOCK(sc); + if (iwm_wait_notification(sc->sc_notif_wait, &wait_te_notif, + TU_TO_HZ(max_delay))) { + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "%s: Failed to protect session until TE\n", + __func__); + } + IWM_LOCK(sc); + } +} + +void +iwm_mvm_stop_session_protection(struct iwm_softc *sc, struct iwm_vap *ivp) +{ + struct iwm_time_event_cmd time_cmd = {}; + + /* Do nothing if the time event has already ended. */ + if ((sc->sc_flags & IWM_FLAG_TE_ACTIVE) == 0) + return; + + time_cmd.id = htole32(sc->sc_time_event_uid); + time_cmd.action = htole32(IWM_FW_CTXT_ACTION_REMOVE); + time_cmd.id_and_color = + htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, ivp->color)); + + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "%s: Removing TE 0x%x\n", __func__, le32toh(time_cmd.id)); + if (iwm_mvm_send_cmd_pdu(sc, IWM_TIME_EVENT_CMD, 0, sizeof(time_cmd), + &time_cmd) == 0) + sc->sc_flags &= ~IWM_FLAG_TE_ACTIVE; + + DELAY(100); } Modified: head/sys/dev/iwm/if_iwm_time_event.h ============================================================================== --- head/sys/dev/iwm/if_iwm_time_event.h Thu Jan 24 03:46:35 2019 (r343382) +++ head/sys/dev/iwm/if_iwm_time_event.h Thu Jan 24 03:47:04 2019 (r343383) @@ -108,6 +108,8 @@ #define __IF_IWM_TIME_EVENT_H__ extern void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_vap *ivp, - uint32_t duration, uint32_t max_delay); + uint32_t duration, uint32_t max_delay, boolean_t wait_for_notif); +extern void iwm_mvm_stop_session_protection(struct iwm_softc *sc, + struct iwm_vap *ivp); #endif /* __IF_IWM_TIME_EVENT_H__ */ Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:46:35 2019 (r343382) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:47:04 2019 (r343383) @@ -434,6 +434,7 @@ struct iwm_softc { #define IWM_FLAG_BUSY (1 << 4) #define IWM_FLAG_SCANNING (1 << 5) #define IWM_FLAG_SCAN_RUNNING (1 << 6) +#define IWM_FLAG_TE_ACTIVE (1 << 7) struct intr_config_hook sc_preinit_hook; struct callout sc_watchdog_to; @@ -562,6 +563,9 @@ struct iwm_softc { /* Track firmware state for STA association. */ int sc_firmware_state; + + /* Unique ID (assigned by the firmware) of the current Time Event. */ + uint32_t sc_time_event_uid; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-head@freebsd.org Thu Jan 24 03:48:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD0B514C0694; Thu, 24 Jan 2019 03:48:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74C32768F7; Thu, 24 Jan 2019 03:48:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6863822C3E; Thu, 24 Jan 2019 03:48:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3mp1G026206; Thu, 24 Jan 2019 03:48:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3mpDA026205; Thu, 24 Jan 2019 03:48:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240348.x0O3mpDA026205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343386 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 74C32768F7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:48:52 -0000 Author: kevans Date: Thu Jan 24 03:48:50 2019 New Revision: 343386 URL: https://svnweb.freebsd.org/changeset/base/343386 Log: if_iwm - Stop iwm_watchdog callout when idle. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (6a8683b0e9d734f23bd9647e117da198c2b9a74e) Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:48:27 2019 (r343385) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:48:50 2019 (r343386) @@ -3814,6 +3814,8 @@ iwm_raw_xmit(struct ieee80211_node *ni, struct mbuf *m } else { error = iwm_tx(sc, m, ni, 0); } + if (sc->sc_tx_timer == 0) + callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, sc); sc->sc_tx_timer = 5; IWM_UNLOCK(sc); @@ -4754,7 +4756,6 @@ iwm_init(struct iwm_softc *sc) * Ok, firmware loaded and we are jogging */ sc->sc_flags |= IWM_FLAG_HW_INITED; - callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, sc); } static int @@ -4800,6 +4801,10 @@ iwm_start(struct iwm_softc *sc) ieee80211_free_node(ni); continue; } + if (sc->sc_tx_timer == 0) { + callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, + sc); + } sc->sc_tx_timer = 15; } IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TRACE, "<-%s\n", __func__); @@ -4834,8 +4839,8 @@ iwm_watchdog(void *arg) counter_u64_add(sc->sc_ic.ic_oerrors, 1); return; } + callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, sc); } - callout_reset(&sc->sc_watchdog_to, hz, iwm_watchdog, sc); } static void From owner-svn-src-head@freebsd.org Thu Jan 24 03:50:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C74DF14C07F9; Thu, 24 Jan 2019 03:50:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C69A76C94; Thu, 24 Jan 2019 03:50:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5855722C46; Thu, 24 Jan 2019 03:50:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3o4W0026422; Thu, 24 Jan 2019 03:50:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3o4jg026421; Thu, 24 Jan 2019 03:50:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240350.x0O3o4jg026421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343389 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C69A76C94 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:50:05 -0000 Author: kevans Date: Thu Jan 24 03:50:03 2019 New Revision: 343389 URL: https://svnweb.freebsd.org/changeset/base/343389 Log: iwm - Remove unused REPLY_MAX Taken-From: Linux git e4eb275ac5cfe71686612d929a9829345b2a4ada Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (92a727c99d6ec5abf14bb6853e95e3a187a0cd4e) Modified: head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:49:35 2019 (r343388) +++ head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:50:03 2019 (r343389) @@ -1866,8 +1866,6 @@ enum { IWM_NET_DETECT_PROFILES_CMD = 0x57, IWM_NET_DETECT_HOTSPOTS_CMD = 0x58, IWM_NET_DETECT_HOTSPOTS_QUERY_CMD = 0x59, - - IWM_REPLY_MAX = 0xff, }; enum iwm_phy_ops_subcmd_ids { From owner-svn-src-head@freebsd.org Thu Jan 24 03:41:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8BFA14BFE4C; Thu, 24 Jan 2019 03:41:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C30975560; Thu, 24 Jan 2019 03:41:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4071422AAC; Thu, 24 Jan 2019 03:41:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3fAZn022112; Thu, 24 Jan 2019 03:41:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3f9jX022110; Thu, 24 Jan 2019 03:41:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240341.x0O3f9jX022110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343373 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C30975560 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:41:11 -0000 Author: kevans Date: Thu Jan 24 03:41:09 2019 New Revision: 343373 URL: https://svnweb.freebsd.org/changeset/base/343373 Log: if_iwm - Update firmware rs table, instead of indexing the table in tx cmds. * Rather than providing a non-zero index into the firmware RS table, we should always use index 0 and update the firmware RS table whenever our chosen tx rate for data-frames changes. * Send IWM_LQ_CMD updates when the tx rate gets updated by the net80211 rate control (which is after we tell the tx status to the net80211 rate-control in iwm_mvm_rx_tx_cmd_single()). * Disregard frames transferred with a different tx rate than the currently selected rate for the rate-control calculations. This way we avoid counting management frames (which are sent at a slow, and fixed rate), as well as frames we added to the tx queue just before a new IWM_LQ_CMD update took effect. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (5d6b465e288ac5b52d7115688d4e6516acbbea1c) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 01:08:37 2019 (r343372) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:41:09 2019 (r343373) @@ -353,7 +353,9 @@ static int iwm_release(struct iwm_softc *, struct iwm_ static struct ieee80211_node * iwm_node_alloc(struct ieee80211vap *, const uint8_t[IEEE80211_ADDR_LEN]); -static void iwm_setrates(struct iwm_softc *, struct iwm_node *); +static uint8_t iwm_rate_from_ucode_rate(uint32_t); +static int iwm_rate2ridx(struct iwm_softc *, uint8_t); +static void iwm_setrates(struct iwm_softc *, struct iwm_node *, int); static int iwm_media_change(struct ifnet *); static int iwm_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void iwm_endscan_cb(void *, int); @@ -3317,7 +3319,11 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct struct iwm_mvm_tx_resp *tx_resp = (void *)pkt->data; struct ieee80211_ratectl_tx_status *txs = &sc->sc_txs; struct ieee80211_node *ni = &in->in_ni; + struct ieee80211vap *vap = ni->ni_vap; int status = le16toh(tx_resp->status.status) & IWM_TX_STATUS_MSK; + int new_rate, cur_rate = vap->iv_bss->ni_txrate; + boolean_t rate_matched; + uint8_t tx_resp_rate; KASSERT(tx_resp->frame_count == 1, ("too many frames")); @@ -3333,6 +3339,17 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct le32toh(tx_resp->initial_rate), (int) le16toh(tx_resp->wireless_media_time)); + tx_resp_rate = iwm_rate_from_ucode_rate(le32toh(tx_resp->initial_rate)); + + /* For rate control, ignore frames sent at different initial rate */ + rate_matched = (tx_resp_rate != 0 && tx_resp_rate == cur_rate); + + if (tx_resp_rate != 0 && cur_rate != 0 && !rate_matched) { + IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, + "tx_resp_rate doesn't match ni_txrate (tx_resp_rate=%u " + "ni_txrate=%d)\n", tx_resp_rate, cur_rate); + } + txs->flags = IEEE80211_RATECTL_STATUS_SHORT_RETRY | IEEE80211_RATECTL_STATUS_LONG_RETRY; txs->short_retries = tx_resp->failure_rts; @@ -3356,8 +3373,19 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct } else { txs->status = IEEE80211_RATECTL_TX_SUCCESS; } - ieee80211_ratectl_tx_complete(ni, txs); + if (rate_matched) { + ieee80211_ratectl_tx_complete(ni, txs); + + int rix = ieee80211_ratectl_rate(vap->iv_bss, NULL, 0); + new_rate = vap->iv_bss->ni_txrate; + if (new_rate != 0 && new_rate != cur_rate) { + struct iwm_node *in = IWM_NODE(vap->iv_bss); + iwm_setrates(sc, in, rix); + iwm_mvm_send_lq_cmd(sc, &in->in_lq, FALSE); + } + } + return (txs->status != IEEE80211_RATECTL_TX_SUCCESS); } @@ -3482,38 +3510,7 @@ iwm_update_sched(struct iwm_softc *sc, int qid, int id } #endif -/* - * Take an 802.11 (non-n) rate, find the relevant rate - * table entry. return the index into in_ridx[]. - * - * The caller then uses that index back into in_ridx - * to figure out the rate index programmed /into/ - * the firmware for this given node. - */ static int -iwm_tx_rateidx_lookup(struct iwm_softc *sc, struct iwm_node *in, - uint8_t rate) -{ - int i; - uint8_t r; - - for (i = 0; i < nitems(in->in_ridx); i++) { - r = iwm_rates[in->in_ridx[i]].rate; - if (rate == r) - return (i); - } - - IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, - "%s: couldn't find an entry for rate=%d\n", - __func__, - rate); - - /* XXX Return the first */ - /* XXX TODO: have it return the /lowest/ */ - return (0); -} - -static int iwm_tx_rateidx_global_lookup(struct iwm_softc *sc, uint8_t rate) { int i; @@ -3565,22 +3562,15 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, "%s: FIXED_RATE (%d)\n", __func__, tp->ucastrate); } else { - int i; - /* for data frames, use RS table */ IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, "%s: DATA\n", __func__); - /* XXX pass pktlen */ - (void) ieee80211_ratectl_rate(ni, NULL, 0); - i = iwm_tx_rateidx_lookup(sc, in, ni->ni_txrate); - ridx = in->in_ridx[i]; + ridx = iwm_rate2ridx(sc, ni->ni_txrate); + if (ridx == -1) + ridx = 0; /* This is the index into the programmed table */ - tx->initial_rate_index = i; + tx->initial_rate_index = 0; tx->tx_flags |= htole32(IWM_TX_CMD_FLG_STA_RATE); - - IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, - "%s: start with i=%d, txrate %d\n", - __func__, i, iwm_rates[ridx].rate); } IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, @@ -4165,6 +4155,19 @@ iwm_node_alloc(struct ieee80211vap *vap, const uint8_t M_NOWAIT | M_ZERO); } +static uint8_t +iwm_rate_from_ucode_rate(uint32_t rate_n_flags) +{ + uint8_t plcp = rate_n_flags & 0xff; + int i; + + for (i = 0; i <= IWM_RIDX_MAX; i++) { + if (iwm_rates[i].plcp == plcp) + return iwm_rates[i].rate; + } + return 0; +} + uint8_t iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx) { @@ -4180,15 +4183,36 @@ iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx) return 0; } +static int +iwm_rate2ridx(struct iwm_softc *sc, uint8_t rate) +{ + int i; + + for (i = 0; i <= IWM_RIDX_MAX; i++) { + if (iwm_rates[i].rate == rate) + return i; + } + + device_printf(sc->sc_dev, + "%s: WARNING: device rate for %u not found!\n", + __func__, rate); + + return -1; +} + + static void -iwm_setrates(struct iwm_softc *sc, struct iwm_node *in) +iwm_setrates(struct iwm_softc *sc, struct iwm_node *in, int rix) { struct ieee80211_node *ni = &in->in_ni; struct iwm_lq_cmd *lq = &in->in_lq; - int nrates = ni->ni_rates.rs_nrates; + struct ieee80211_rateset *rs = &ni->ni_rates; + int nrates = rs->rs_nrates; int i, ridx, tab = 0; // int txant = 0; + KASSERT(rix >= 0 && rix < nrates, ("invalid rix")); + if (nrates > nitems(lq->rs_table)) { device_printf(sc->sc_dev, "%s: node supports %d rates, driver handles " @@ -4200,45 +4224,11 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in "%s: node supports 0 rates, odd!\n", __func__); return; } + nrates = imin(rix + 1, nrates); - /* - * XXX .. and most of iwm_node is not initialised explicitly; - * it's all just 0x0 passed to the firmware. - */ - - /* first figure out which rates we should support */ - /* XXX TODO: this isn't 11n aware /at all/ */ - memset(&in->in_ridx, -1, sizeof(in->in_ridx)); IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, "%s: nrates=%d\n", __func__, nrates); - /* - * Loop over nrates and populate in_ridx from the highest - * rate to the lowest rate. Remember, in_ridx[] has - * IEEE80211_RATE_MAXSIZE entries! - */ - for (i = 0; i < min(nrates, IEEE80211_RATE_MAXSIZE); i++) { - int rate = ni->ni_rates.rs_rates[(nrates - 1) - i] & IEEE80211_RATE_VAL; - - /* Map 802.11 rate to HW rate index. */ - for (ridx = 0; ridx <= IWM_RIDX_MAX; ridx++) - if (iwm_rates[ridx].rate == rate) - break; - if (ridx > IWM_RIDX_MAX) { - device_printf(sc->sc_dev, - "%s: WARNING: device rate for %d not found!\n", - __func__, rate); - } else { - IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, - "%s: rate: i: %d, rate=%d, ridx=%d\n", - __func__, - i, - rate, - ridx); - in->in_ridx[i] = ridx; - } - } - /* then construct a lq_cmd based on those */ memset(lq, 0, sizeof(*lq)); lq->sta_id = IWM_STATION_ID; @@ -4262,13 +4252,15 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in * Note that we add the rates in the highest rate first * (opposite of ni_rates). */ - /* - * XXX TODO: this should be looping over the min of nrates - * and LQ_MAX_RETRY_NUM. Sigh. - */ for (i = 0; i < nrates; i++) { + int rate = rs->rs_rates[rix - i] & IEEE80211_RATE_VAL; int nextant; + /* Map 802.11 rate to HW rate index. */ + ridx = iwm_rate2ridx(sc, rate); + if (ridx == -1) + continue; + #if 0 if (txant == 0) txant = iwm_mvm_get_valid_tx_ant(sc); @@ -4277,12 +4269,6 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in #else nextant = iwm_mvm_get_valid_tx_ant(sc); #endif - /* - * Map the rate id into a rate index into - * our hardware table containing the - * configuration to use for this rate. - */ - ridx = in->in_ridx[i]; tab = iwm_rates[ridx].plcp; tab |= nextant << IWM_RATE_MCS_ANT_POS; if (IWM_RIDX_IS_CCK(ridx)) @@ -4474,7 +4460,8 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ iwm_mvm_enable_beacon_filter(sc, ivp); iwm_mvm_power_update_mac(sc); iwm_mvm_update_quotas(sc, ivp); - iwm_setrates(sc, in); + int rix = ieee80211_ratectl_rate(&in->in_ni, NULL, 0); + iwm_setrates(sc, in, rix); if ((error = iwm_mvm_send_lq_cmd(sc, &in->in_lq, TRUE)) != 0) { device_printf(sc->sc_dev, Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 01:08:37 2019 (r343372) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:41:09 2019 (r343373) @@ -404,8 +404,6 @@ struct iwm_node { int in_assoc; struct iwm_lq_cmd in_lq; - - uint8_t in_ridx[IEEE80211_RATE_MAXSIZE]; }; #define IWM_NODE(_ni) ((struct iwm_node *)(_ni)) From owner-svn-src-head@freebsd.org Thu Jan 24 03:47:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9264F14C0529; Thu, 24 Jan 2019 03:47:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A62E76564; Thu, 24 Jan 2019 03:47:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D83822C3B; Thu, 24 Jan 2019 03:47:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3lmHU026078; Thu, 24 Jan 2019 03:47:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3llKV026073; Thu, 24 Jan 2019 03:47:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240347.x0O3llKV026073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343384 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A62E76564 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:47:48 -0000 Author: kevans Date: Thu Jan 24 03:47:47 2019 New Revision: 343384 URL: https://svnweb.freebsd.org/changeset/base/343384 Log: iwm - Clear Time Event active state, when receiving End Notification. * This hopefully avoids some firmware panics, I was occasionally seeing, when iwm disconnects upon losing signal to an access point at some point. * This is synchronizing the if_iwm_time_event.c file a bit more from the corresponding Linux iwlwifi/mvm/time-event.c. Taken-From: Linux iwlwifi Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (e8cb71584a6a72232c13151d60e57f7f229220eb) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_time_event.c head/sys/dev/iwm/if_iwm_time_event.h head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:47:04 2019 (r343383) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:47:47 2019 (r343384) @@ -5375,15 +5375,9 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) break; } - case IWM_TIME_EVENT_NOTIFICATION: { - struct iwm_time_event_notif *notif; - notif = (void *)pkt->data; - - IWM_DPRINTF(sc, IWM_DEBUG_INTR, - "TE notif status = 0x%x action = 0x%x\n", - notif->status, notif->action); + case IWM_TIME_EVENT_NOTIFICATION: + iwm_mvm_rx_time_event_notif(sc, pkt); break; - } /* * Firmware versions 21 and 22 generate some DEBUG_LOG_MSG Modified: head/sys/dev/iwm/if_iwm_time_event.c ============================================================================== --- head/sys/dev/iwm/if_iwm_time_event.c Thu Jan 24 03:47:04 2019 (r343383) +++ head/sys/dev/iwm/if_iwm_time_event.c Thu Jan 24 03:47:47 2019 (r343384) @@ -159,13 +159,74 @@ __FBSDID("$FreeBSD$"); #include #include +#define TU_TO_HZ(tu) (((uint64_t)(tu) * 1024 * hz) / 1000000) + +static void +iwm_mvm_te_clear_data(struct iwm_softc *sc) +{ + sc->sc_time_event_uid = 0; + sc->sc_time_event_duration = 0; + sc->sc_time_event_end_ticks = 0; + sc->sc_flags &= ~IWM_FLAG_TE_ACTIVE; +} + /* - * For the high priority TE use a time event type that has similar priority to - * the FW's action scan priority. + * Handles a FW notification for an event that is known to the driver. + * + * @mvm: the mvm component + * @te_data: the time event data + * @notif: the notification data corresponding the time event data. */ -#define IWM_MVM_ROC_TE_TYPE_NORMAL IWM_TE_P2P_DEVICE_DISCOVERABLE -#define IWM_MVM_ROC_TE_TYPE_MGMT_TX IWM_TE_P2P_CLIENT_ASSOC +static void +iwm_mvm_te_handle_notif(struct iwm_softc *sc, + struct iwm_time_event_notif *notif) +{ + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "Handle time event notif - UID = 0x%x action %d\n", + le32toh(notif->unique_id), + le32toh(notif->action)); + if (!le32toh(notif->status)) { + const char *msg; + + if (notif->action & htole32(IWM_TE_V2_NOTIF_HOST_EVENT_START)) + msg = "Time Event start notification failure"; + else + msg = "Time Event end notification failure"; + + IWM_DPRINTF(sc, IWM_DEBUG_TE, "%s\n", msg); + } + + if (le32toh(notif->action) & IWM_TE_V2_NOTIF_HOST_EVENT_END) { + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "TE ended - current time %d, estimated end %d\n", + ticks, sc->sc_time_event_end_ticks); + + iwm_mvm_te_clear_data(sc); + } else if (le32toh(notif->action) & IWM_TE_V2_NOTIF_HOST_EVENT_START) { + sc->sc_time_event_end_ticks = + ticks + TU_TO_HZ(sc->sc_time_event_duration); + } else { + device_printf(sc->sc_dev, "Got TE with unknown action\n"); + } +} + +/* + * The Rx handler for time event notifications + */ +void +iwm_mvm_rx_time_event_notif(struct iwm_softc *sc, struct iwm_rx_packet *pkt) +{ + struct iwm_time_event_notif *notif = (void *)pkt->data; + + IWM_DPRINTF(sc, IWM_DEBUG_TE, + "Time event notification - UID = 0x%x action %d\n", + le32toh(notif->unique_id), + le32toh(notif->action)); + + iwm_mvm_te_handle_notif(sc, notif); +} + static int iwm_mvm_te_notif(struct iwm_softc *sc, struct iwm_rx_packet *pkt, void *data) @@ -241,6 +302,8 @@ iwm_mvm_time_event_send_add(struct iwm_softc *sc, stru IWM_DPRINTF(sc, IWM_DEBUG_TE, "Add new TE, duration %d TU\n", le32toh(te_cmd->duration)); + sc->sc_time_event_duration = le32toh(te_cmd->duration); + /* * Use a notification wait, which really just processes the * command response and doesn't wait for anything, in order @@ -279,8 +342,6 @@ iwm_mvm_time_event_send_add(struct iwm_softc *sc, stru return ret; } -#define TU_TO_HZ(tu) (((uint64_t)(tu) * 1024 * hz) / 1000000) - void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_vap *ivp, uint32_t duration, uint32_t max_delay, boolean_t wait_for_notif) @@ -362,7 +423,7 @@ iwm_mvm_stop_session_protection(struct iwm_softc *sc, "%s: Removing TE 0x%x\n", __func__, le32toh(time_cmd.id)); if (iwm_mvm_send_cmd_pdu(sc, IWM_TIME_EVENT_CMD, 0, sizeof(time_cmd), &time_cmd) == 0) - sc->sc_flags &= ~IWM_FLAG_TE_ACTIVE; + iwm_mvm_te_clear_data(sc); DELAY(100); } Modified: head/sys/dev/iwm/if_iwm_time_event.h ============================================================================== --- head/sys/dev/iwm/if_iwm_time_event.h Thu Jan 24 03:47:04 2019 (r343383) +++ head/sys/dev/iwm/if_iwm_time_event.h Thu Jan 24 03:47:47 2019 (r343384) @@ -107,6 +107,8 @@ #ifndef __IF_IWM_TIME_EVENT_H__ #define __IF_IWM_TIME_EVENT_H__ +extern void iwm_mvm_rx_time_event_notif(struct iwm_softc *sc, + struct iwm_rx_packet *pkt); extern void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_vap *ivp, uint32_t duration, uint32_t max_delay, boolean_t wait_for_notif); extern void iwm_mvm_stop_session_protection(struct iwm_softc *sc, Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:47:04 2019 (r343383) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:47:47 2019 (r343384) @@ -566,6 +566,12 @@ struct iwm_softc { /* Unique ID (assigned by the firmware) of the current Time Event. */ uint32_t sc_time_event_uid; + + /* Duration of the Time Event in TU. */ + uint32_t sc_time_event_duration; + + /* Expected end of the Time Event in HZ ticks. */ + int sc_time_event_end_ticks; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-head@freebsd.org Thu Jan 24 03:49:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4766014C0748; Thu, 24 Jan 2019 03:49:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E22B876B30; Thu, 24 Jan 2019 03:49:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D545A22C41; Thu, 24 Jan 2019 03:49:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3naSN026331; Thu, 24 Jan 2019 03:49:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3naII026328; Thu, 24 Jan 2019 03:49:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240349.x0O3naII026328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343388 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E22B876B30 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:49:37 -0000 Author: kevans Date: Thu Jan 24 03:49:35 2019 New Revision: 343388 URL: https://svnweb.freebsd.org/changeset/base/343388 Log: iwm - Update alive response handling, add v4 and remove old versions. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (3820e2bf3331ced3541d1811a38c5a5136dfab93) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmreg.h head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:49:11 2019 (r343387) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:49:35 2019 (r343388) @@ -2723,75 +2723,48 @@ static int iwm_alive_fn(struct iwm_softc *sc, struct iwm_rx_packet *pkt, void *data) { struct iwm_mvm_alive_data *alive_data = data; - struct iwm_mvm_alive_resp_ver1 *palive1; - struct iwm_mvm_alive_resp_ver2 *palive2; + struct iwm_mvm_alive_resp_v3 *palive3; struct iwm_mvm_alive_resp *palive; + struct iwm_umac_alive *umac; + struct iwm_lmac_alive *lmac1; + struct iwm_lmac_alive *lmac2 = NULL; + uint16_t status; - if (iwm_rx_packet_payload_len(pkt) == sizeof(*palive1)) { - palive1 = (void *)pkt->data; - - sc->support_umac_log = FALSE; - sc->error_event_table = - le32toh(palive1->error_event_table_ptr); - sc->log_event_table = - le32toh(palive1->log_event_table_ptr); - alive_data->scd_base_addr = le32toh(palive1->scd_base_ptr); - - alive_data->valid = le16toh(palive1->status) == - IWM_ALIVE_STATUS_OK; - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "Alive VER1 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n", - le16toh(palive1->status), palive1->ver_type, - palive1->ver_subtype, palive1->flags); - } else if (iwm_rx_packet_payload_len(pkt) == sizeof(*palive2)) { - palive2 = (void *)pkt->data; - sc->error_event_table = - le32toh(palive2->error_event_table_ptr); - sc->log_event_table = - le32toh(palive2->log_event_table_ptr); - alive_data->scd_base_addr = le32toh(palive2->scd_base_ptr); - sc->umac_error_event_table = - le32toh(palive2->error_info_addr); - - alive_data->valid = le16toh(palive2->status) == - IWM_ALIVE_STATUS_OK; - if (sc->umac_error_event_table) - sc->support_umac_log = TRUE; - - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "Alive VER2 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n", - le16toh(palive2->status), palive2->ver_type, - palive2->ver_subtype, palive2->flags); - - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "UMAC version: Major - 0x%x, Minor - 0x%x\n", - palive2->umac_major, palive2->umac_minor); - } else if (iwm_rx_packet_payload_len(pkt) == sizeof(*palive)) { + if (iwm_rx_packet_payload_len(pkt) == sizeof(*palive)) { palive = (void *)pkt->data; + umac = &palive->umac_data; + lmac1 = &palive->lmac_data[0]; + lmac2 = &palive->lmac_data[1]; + status = le16toh(palive->status); + } else { + palive3 = (void *)pkt->data; + umac = &palive3->umac_data; + lmac1 = &palive3->lmac_data; + status = le16toh(palive3->status); + } - sc->error_event_table = - le32toh(palive->error_event_table_ptr); - sc->log_event_table = - le32toh(palive->log_event_table_ptr); - alive_data->scd_base_addr = le32toh(palive->scd_base_ptr); - sc->umac_error_event_table = - le32toh(palive->error_info_addr); + sc->error_event_table[0] = le32toh(lmac1->error_event_table_ptr); + if (lmac2) + sc->error_event_table[1] = + le32toh(lmac2->error_event_table_ptr); + sc->log_event_table = le32toh(lmac1->log_event_table_ptr); + sc->umac_error_event_table = le32toh(umac->error_info_addr); + alive_data->scd_base_addr = le32toh(lmac1->scd_base_ptr); + alive_data->valid = status == IWM_ALIVE_STATUS_OK; + if (sc->umac_error_event_table) + sc->support_umac_log = TRUE; - alive_data->valid = le16toh(palive->status) == - IWM_ALIVE_STATUS_OK; - if (sc->umac_error_event_table) - sc->support_umac_log = TRUE; + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "Alive ucode status 0x%04x revision 0x%01X 0x%01X\n", + status, lmac1->ver_type, lmac1->ver_subtype); - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "Alive VER3 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n", - le16toh(palive->status), palive->ver_type, - palive->ver_subtype, palive->flags); + if (lmac2) + IWM_DPRINTF(sc, IWM_DEBUG_FW, "Alive ucode CDB\n"); - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "UMAC version: Major - 0x%x, Minor - 0x%x\n", - le32toh(palive->umac_major), - le32toh(palive->umac_minor)); - } + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "UMAC version: Major - 0x%x, Minor - 0x%x\n", + le32toh(umac->umac_major), + le32toh(umac->umac_minor)); return TRUE; } @@ -5052,7 +5025,7 @@ iwm_nic_error(struct iwm_softc *sc) uint32_t base; device_printf(sc->sc_dev, "dumping device error log\n"); - base = sc->error_event_table; + base = sc->error_event_table[0]; if (base < 0x800000) { device_printf(sc->sc_dev, "Invalid error log pointer 0x%08x\n", base); Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:49:11 2019 (r343387) +++ head/sys/dev/iwm/if_iwmreg.h Thu Jan 24 03:49:35 2019 (r343388) @@ -2144,43 +2144,15 @@ enum { #define IWM_ALIVE_FLG_RFKILL (1 << 0) -struct iwm_mvm_alive_resp_ver1 { - uint16_t status; - uint16_t flags; - uint8_t ucode_minor; - uint8_t ucode_major; - uint16_t id; - uint8_t api_minor; - uint8_t api_major; +struct iwm_lmac_alive { + uint32_t ucode_major; + uint32_t ucode_minor; uint8_t ver_subtype; uint8_t ver_type; uint8_t mac; uint8_t opt; - uint16_t reserved2; uint32_t timestamp; uint32_t error_event_table_ptr; /* SRAM address for error log */ - uint32_t log_event_table_ptr; /* SRAM address for event log */ - uint32_t cpu_register_ptr; - uint32_t dbgm_config_ptr; - uint32_t alive_counter_ptr; - uint32_t scd_base_ptr; /* SRAM address for SCD */ -} __packed; /* IWM_ALIVE_RES_API_S_VER_1 */ - -struct iwm_mvm_alive_resp_ver2 { - uint16_t status; - uint16_t flags; - uint8_t ucode_minor; - uint8_t ucode_major; - uint16_t id; - uint8_t api_minor; - uint8_t api_major; - uint8_t ver_subtype; - uint8_t ver_type; - uint8_t mac; - uint8_t opt; - uint16_t reserved2; - uint32_t timestamp; - uint32_t error_event_table_ptr; /* SRAM address for error log */ uint32_t log_event_table_ptr; /* SRAM address for LMAC event log */ uint32_t cpu_register_ptr; uint32_t dbgm_config_ptr; @@ -2188,36 +2160,28 @@ struct iwm_mvm_alive_resp_ver2 { uint32_t scd_base_ptr; /* SRAM address for SCD */ uint32_t st_fwrd_addr; /* pointer to Store and forward */ uint32_t st_fwrd_size; - uint8_t umac_minor; /* UMAC version: minor */ - uint8_t umac_major; /* UMAC version: major */ - uint16_t umac_id; /* UMAC version: id */ +} __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */ + +struct iwm_umac_alive { + uint32_t umac_major; /* UMAC version: major */ + uint32_t umac_minor; /* UMAC version: minor */ uint32_t error_info_addr; /* SRAM address for UMAC error log */ uint32_t dbg_print_buff_addr; -} __packed; /* ALIVE_RES_API_S_VER_2 */ +} __packed; /* UMAC_ALIVE_DATA_API_S_VER_2 */ -struct iwm_mvm_alive_resp { +struct iwm_mvm_alive_resp_v3 { uint16_t status; uint16_t flags; - uint32_t ucode_minor; - uint32_t ucode_major; - uint8_t ver_subtype; - uint8_t ver_type; - uint8_t mac; - uint8_t opt; - uint32_t timestamp; - uint32_t error_event_table_ptr; /* SRAM address for error log */ - uint32_t log_event_table_ptr; /* SRAM address for LMAC event log */ - uint32_t cpu_register_ptr; - uint32_t dbgm_config_ptr; - uint32_t alive_counter_ptr; - uint32_t scd_base_ptr; /* SRAM address for SCD */ - uint32_t st_fwrd_addr; /* pointer to Store and forward */ - uint32_t st_fwrd_size; - uint32_t umac_minor; /* UMAC version: minor */ - uint32_t umac_major; /* UMAC version: major */ - uint32_t error_info_addr; /* SRAM address for UMAC error log */ - uint32_t dbg_print_buff_addr; + struct iwm_lmac_alive lmac_data; + struct iwm_umac_alive umac_data; } __packed; /* ALIVE_RES_API_S_VER_3 */ + +struct iwm_mvm_alive_resp { + uint16_t status; + uint16_t flags; + struct iwm_lmac_alive lmac_data[2]; + struct iwm_umac_alive umac_data; +} __packed; /* ALIVE_RES_API_S_VER_4 */ /* Error response/notification */ enum { Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:49:11 2019 (r343387) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:49:35 2019 (r343388) @@ -538,7 +538,7 @@ struct iwm_softc { int cmd_hold_nic_awake; /* Firmware status */ - uint32_t error_event_table; + uint32_t error_event_table[2]; uint32_t log_event_table; uint32_t umac_error_event_table; int support_umac_log; From owner-svn-src-head@freebsd.org Thu Jan 24 03:43:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0861C14C006C; Thu, 24 Jan 2019 03:43:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0EE375B75; Thu, 24 Jan 2019 03:43:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A381E22C22; Thu, 24 Jan 2019 03:43:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3hkDI025562; Thu, 24 Jan 2019 03:43:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3hjY1025553; Thu, 24 Jan 2019 03:43:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240343.x0O3hjY1025553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343377 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B0EE375B75 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:43:47 -0000 Author: kevans Date: Thu Jan 24 03:43:45 2019 New Revision: 343377 URL: https://svnweb.freebsd.org/changeset/base/343377 Log: iwm - Reduce gratuitous differences with Linux iwlwifi in struct naming. * Rename some structs and struct members for firmware handling. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (4b1006a6e4d0f61d48c67b46e1f791e30837db67) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_fw.c head/sys/dev/iwm/if_iwm_fw.h head/sys/dev/iwm/if_iwm_phy_db.c head/sys/dev/iwm/if_iwm_scan.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:42:59 2019 (r343376) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:43:45 2019 (r343377) @@ -305,16 +305,16 @@ static int iwm_pcie_load_section(struct iwm_softc *, u static int iwm_pcie_load_firmware_chunk(struct iwm_softc *, uint32_t, bus_addr_t, uint32_t); static int iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, - const struct iwm_fw_sects *, + const struct iwm_fw_img *, int, int *); static int iwm_pcie_load_cpu_sections(struct iwm_softc *, - const struct iwm_fw_sects *, + const struct iwm_fw_img *, int, int *); static int iwm_pcie_load_given_ucode_8000(struct iwm_softc *, - const struct iwm_fw_sects *); + const struct iwm_fw_img *); static int iwm_pcie_load_given_ucode(struct iwm_softc *, - const struct iwm_fw_sects *); -static int iwm_start_fw(struct iwm_softc *, const struct iwm_fw_sects *); + const struct iwm_fw_img *); +static int iwm_start_fw(struct iwm_softc *, const struct iwm_fw_img *); static int iwm_send_tx_ant_cfg(struct iwm_softc *, uint8_t); static int iwm_send_phy_cfg_cmd(struct iwm_softc *); static int iwm_mvm_load_ucode_wait_alive(struct iwm_softc *, @@ -426,7 +426,7 @@ static int iwm_firmware_store_section(struct iwm_softc *sc, enum iwm_ucode_type type, const uint8_t *data, size_t dlen) { - struct iwm_fw_sects *fws; + struct iwm_fw_img *fws; struct iwm_fw_desc *fwone; if (type >= IWM_UCODE_TYPE_MAX) @@ -434,11 +434,11 @@ iwm_firmware_store_section(struct iwm_softc *sc, if (dlen < sizeof(uint32_t)) return EINVAL; - fws = &sc->sc_fw.fw_sects[type]; + fws = &sc->sc_fw.img[type]; if (fws->fw_count >= IWM_UCODE_SECTION_MAX) return EINVAL; - fwone = &fws->fw_sect[fws->fw_count]; + fwone = &fws->sec[fws->fw_count]; /* first 32bit are device load offset */ memcpy(&fwone->offset, data, sizeof(uint32_t)); @@ -536,7 +536,7 @@ iwm_fw_info_free(struct iwm_fw_info *fw) { firmware_put(fw->fw_fp, FIRMWARE_UNLOAD); fw->fw_fp = NULL; - memset(fw->fw_sects, 0, sizeof(fw->fw_sects)); + memset(fw->img, 0, sizeof(fw->img)); } static int @@ -545,7 +545,7 @@ iwm_read_firmware(struct iwm_softc *sc) struct iwm_fw_info *fw = &sc->sc_fw; const struct iwm_tlv_ucode_header *uhdr; const struct iwm_ucode_tlv *tlv; - struct iwm_ucode_capabilities *capa = &sc->ucode_capa; + struct iwm_ucode_capabilities *capa = &sc->sc_fw.ucode_capa; enum iwm_ucode_tlv_type tlv_type; const struct firmware *fwp; const uint8_t *data; @@ -694,11 +694,11 @@ iwm_read_firmware(struct iwm_softc *sc) } num_of_cpus = le32_to_cpup((const uint32_t *)tlv_data); if (num_of_cpus == 2) { - fw->fw_sects[IWM_UCODE_REGULAR].is_dual_cpus = + fw->img[IWM_UCODE_REGULAR].is_dual_cpus = TRUE; - fw->fw_sects[IWM_UCODE_INIT].is_dual_cpus = + fw->img[IWM_UCODE_INIT].is_dual_cpus = TRUE; - fw->fw_sects[IWM_UCODE_WOWLAN].is_dual_cpus = + fw->img[IWM_UCODE_WOWLAN].is_dual_cpus = TRUE; } else if ((num_of_cpus > 2) || (num_of_cpus < 1)) { device_printf(sc->sc_dev, @@ -831,10 +831,10 @@ iwm_read_firmware(struct iwm_softc *sc) goto out; } - sc->sc_fw.fw_sects[IWM_UCODE_REGULAR].paging_mem_size = + sc->sc_fw.img[IWM_UCODE_REGULAR].paging_mem_size = paging_mem_size; usniffer_img = IWM_UCODE_REGULAR_USNIFFER; - sc->sc_fw.fw_sects[usniffer_img].paging_mem_size = + sc->sc_fw.img[usniffer_img].paging_mem_size = paging_mem_size; break; @@ -2447,7 +2447,7 @@ iwm_pcie_load_firmware_chunk(struct iwm_softc *sc, uin static int iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, - const struct iwm_fw_sects *image, int cpu, int *first_ucode_section) + const struct iwm_fw_img *image, int cpu, int *first_ucode_section) { int shift_param; int i, ret = 0, sec_num = 0x1; @@ -2470,15 +2470,15 @@ iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, * PAGING_SEPARATOR_SECTION delimiter - separate between * CPU2 non paged to CPU2 paging sec. */ - if (!image->fw_sect[i].data || - image->fw_sect[i].offset == IWM_CPU1_CPU2_SEPARATOR_SECTION || - image->fw_sect[i].offset == IWM_PAGING_SEPARATOR_SECTION) { + if (!image->sec[i].data || + image->sec[i].offset == IWM_CPU1_CPU2_SEPARATOR_SECTION || + image->sec[i].offset == IWM_PAGING_SEPARATOR_SECTION) { IWM_DPRINTF(sc, IWM_DEBUG_RESET, "Break since Data not valid or Empty section, sec = %d\n", i); break; } - ret = iwm_pcie_load_section(sc, i, &image->fw_sect[i]); + ret = iwm_pcie_load_section(sc, i, &image->sec[i]); if (ret) return ret; @@ -2509,7 +2509,7 @@ iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, static int iwm_pcie_load_cpu_sections(struct iwm_softc *sc, - const struct iwm_fw_sects *image, int cpu, int *first_ucode_section) + const struct iwm_fw_img *image, int cpu, int *first_ucode_section) { int shift_param; int i, ret = 0; @@ -2532,16 +2532,16 @@ iwm_pcie_load_cpu_sections(struct iwm_softc *sc, * PAGING_SEPARATOR_SECTION delimiter - separate between * CPU2 non paged to CPU2 paging sec. */ - if (!image->fw_sect[i].data || - image->fw_sect[i].offset == IWM_CPU1_CPU2_SEPARATOR_SECTION || - image->fw_sect[i].offset == IWM_PAGING_SEPARATOR_SECTION) { + if (!image->sec[i].data || + image->sec[i].offset == IWM_CPU1_CPU2_SEPARATOR_SECTION || + image->sec[i].offset == IWM_PAGING_SEPARATOR_SECTION) { IWM_DPRINTF(sc, IWM_DEBUG_RESET, "Break since Data not valid or Empty section, sec = %d\n", i); break; } - ret = iwm_pcie_load_section(sc, i, &image->fw_sect[i]); + ret = iwm_pcie_load_section(sc, i, &image->sec[i]); if (ret) return ret; } @@ -2553,8 +2553,7 @@ iwm_pcie_load_cpu_sections(struct iwm_softc *sc, } static int -iwm_pcie_load_given_ucode(struct iwm_softc *sc, - const struct iwm_fw_sects *image) +iwm_pcie_load_given_ucode(struct iwm_softc *sc, const struct iwm_fw_img *image) { int ret = 0; int first_ucode_section; @@ -2593,7 +2592,7 @@ iwm_pcie_load_given_ucode(struct iwm_softc *sc, int iwm_pcie_load_given_ucode_8000(struct iwm_softc *sc, - const struct iwm_fw_sects *image) + const struct iwm_fw_img *image) { int ret = 0; int first_ucode_section; @@ -2631,8 +2630,7 @@ iwm_enable_fw_load_int(struct iwm_softc *sc) /* XXX Add proper rfkill support code */ static int -iwm_start_fw(struct iwm_softc *sc, - const struct iwm_fw_sects *fw) +iwm_start_fw(struct iwm_softc *sc, const struct iwm_fw_img *fw) { int ret; @@ -2824,12 +2822,12 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, { struct iwm_notification_wait alive_wait; struct iwm_mvm_alive_data alive_data; - const struct iwm_fw_sects *fw; + const struct iwm_fw_img *fw; enum iwm_ucode_type old_type = sc->cur_ucode; int error; static const uint16_t alive_cmd[] = { IWM_MVM_ALIVE }; - fw = &sc->sc_fw.fw_sects[ucode_type]; + fw = &sc->sc_fw.img[ucode_type]; sc->cur_ucode = ucode_type; sc->ucode_loaded = FALSE; @@ -4473,7 +4471,7 @@ static boolean_t iwm_mvm_is_lar_supported(struct iwm_softc *sc) { boolean_t nvm_lar = sc->nvm_data->lar_enabled; - boolean_t tlv_lar = fw_has_capa(&sc->ucode_capa, + boolean_t tlv_lar = fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_LAR_SUPPORT); if (iwm_lar_disable) @@ -4492,9 +4490,9 @@ iwm_mvm_is_lar_supported(struct iwm_softc *sc) static boolean_t iwm_mvm_is_wifi_mcc_supported(struct iwm_softc *sc) { - return fw_has_api(&sc->ucode_capa, + return fw_has_api(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_API_WIFI_MCC_UPDATE) || - fw_has_capa(&sc->ucode_capa, + fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_LAR_MULTI_MCC); } @@ -4515,7 +4513,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch int n_channels; uint16_t mcc; #endif - int resp_v2 = fw_has_capa(&sc->ucode_capa, + int resp_v2 = fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_LAR_SUPPORT_V2); if (!iwm_mvm_is_lar_supported(sc)) { @@ -4674,7 +4672,7 @@ iwm_init_hw(struct iwm_softc *sc) if ((error = iwm_send_update_mcc_cmd(sc, "ZZ")) != 0) goto error; - if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { + if (fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { if ((error = iwm_mvm_config_umac_scan(sc)) != 0) goto error; } @@ -6208,7 +6206,7 @@ iwm_scan_start(struct ieee80211com *ic) device_printf(sc->sc_dev, "%s: Previous scan not completed yet\n", __func__); } - if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) + if (fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) error = iwm_mvm_umac_scan(sc); else error = iwm_mvm_lmac_scan(sc); Modified: head/sys/dev/iwm/if_iwm_fw.c ============================================================================== --- head/sys/dev/iwm/if_iwm_fw.c Thu Jan 24 03:42:59 2019 (r343376) +++ head/sys/dev/iwm/if_iwm_fw.c Thu Jan 24 03:43:45 2019 (r343377) @@ -141,7 +141,7 @@ iwm_free_fw_paging(struct iwm_softc *sc) } static int -iwm_fill_paging_mem(struct iwm_softc *sc, const struct iwm_fw_sects *image) +iwm_fill_paging_mem(struct iwm_softc *sc, const struct iwm_fw_img *image) { int sec_idx, idx; uint32_t offset = 0; @@ -158,7 +158,7 @@ iwm_fill_paging_mem(struct iwm_softc *sc, const struct * CPU2 paging image (including instruction and data) */ for (sec_idx = 0; sec_idx < IWM_UCODE_SECTION_MAX; sec_idx++) { - if (image->fw_sect[sec_idx].offset == IWM_PAGING_SEPARATOR_SECTION) { + if (image->sec[sec_idx].offset == IWM_PAGING_SEPARATOR_SECTION) { sec_idx++; break; } @@ -168,7 +168,7 @@ iwm_fill_paging_mem(struct iwm_softc *sc, const struct * If paging is enabled there should be at least 2 more sections left * (one for CSS and one for Paging data) */ - if (sec_idx >= nitems(image->fw_sect) - 1) { + if (sec_idx >= nitems(image->sec) - 1) { device_printf(sc->sc_dev, "Paging: Missing CSS and/or paging sections\n"); iwm_free_fw_paging(sc); @@ -181,7 +181,7 @@ iwm_fill_paging_mem(struct iwm_softc *sc, const struct sec_idx); memcpy(sc->fw_paging_db[0].fw_paging_block.vaddr, - image->fw_sect[sec_idx].data, + image->sec[sec_idx].data, sc->fw_paging_db[0].fw_paging_size); IWM_DPRINTF(sc, IWM_DEBUG_FW, @@ -198,7 +198,7 @@ iwm_fill_paging_mem(struct iwm_softc *sc, const struct */ for (idx = 1; idx < sc->num_of_paging_blk; idx++) { memcpy(sc->fw_paging_db[idx].fw_paging_block.vaddr, - (const char *)image->fw_sect[sec_idx].data + offset, + (const char *)image->sec[sec_idx].data + offset, sc->fw_paging_db[idx].fw_paging_size); IWM_DPRINTF(sc, IWM_DEBUG_FW, @@ -212,7 +212,7 @@ iwm_fill_paging_mem(struct iwm_softc *sc, const struct /* copy the last paging block */ if (sc->num_of_pages_in_last_blk > 0) { memcpy(sc->fw_paging_db[idx].fw_paging_block.vaddr, - (const char *)image->fw_sect[sec_idx].data + offset, + (const char *)image->sec[sec_idx].data + offset, IWM_FW_PAGING_SIZE * sc->num_of_pages_in_last_blk); IWM_DPRINTF(sc, IWM_DEBUG_FW, @@ -224,7 +224,7 @@ iwm_fill_paging_mem(struct iwm_softc *sc, const struct } static int -iwm_alloc_fw_paging_mem(struct iwm_softc *sc, const struct iwm_fw_sects *image) +iwm_alloc_fw_paging_mem(struct iwm_softc *sc, const struct iwm_fw_img *image) { int blk_idx = 0; int error, num_of_pages; @@ -298,7 +298,7 @@ iwm_alloc_fw_paging_mem(struct iwm_softc *sc, const st } int -iwm_save_fw_paging(struct iwm_softc *sc, const struct iwm_fw_sects *fw) +iwm_save_fw_paging(struct iwm_softc *sc, const struct iwm_fw_img *fw) { int ret; @@ -311,7 +311,7 @@ iwm_save_fw_paging(struct iwm_softc *sc, const struct /* send paging cmd to FW in case CPU2 has paging image */ int -iwm_send_paging_cmd(struct iwm_softc *sc, const struct iwm_fw_sects *fw) +iwm_send_paging_cmd(struct iwm_softc *sc, const struct iwm_fw_img *fw) { int blk_idx; uint32_t dev_phy_addr; Modified: head/sys/dev/iwm/if_iwm_fw.h ============================================================================== --- head/sys/dev/iwm/if_iwm_fw.h Thu Jan 24 03:42:59 2019 (r343376) +++ head/sys/dev/iwm/if_iwm_fw.h Thu Jan 24 03:43:45 2019 (r343377) @@ -107,7 +107,7 @@ #define IWM_PAGING_TLV_SECURE_MASK 1 extern void iwm_free_fw_paging(struct iwm_softc *); -extern int iwm_save_fw_paging(struct iwm_softc *, const struct iwm_fw_sects *); -extern int iwm_send_paging_cmd(struct iwm_softc *, const struct iwm_fw_sects *); +extern int iwm_save_fw_paging(struct iwm_softc *, const struct iwm_fw_img *); +extern int iwm_send_paging_cmd(struct iwm_softc *, const struct iwm_fw_img *); #endif /* __IF_IWM_FW_H__ */ Modified: head/sys/dev/iwm/if_iwm_phy_db.c ============================================================================== --- head/sys/dev/iwm/if_iwm_phy_db.c Thu Jan 24 03:42:59 2019 (r343376) +++ head/sys/dev/iwm/if_iwm_phy_db.c Thu Jan 24 03:43:45 2019 (r343377) @@ -390,7 +390,7 @@ static uint8_t ch_id_to_ch_index(uint16_t ch_id) { if (!is_valid_channel(ch_id)) - return 0xff; + return 0xff; if (ch_id <= 14) return ch_id - 1; @@ -509,7 +509,7 @@ iwm_phy_db_send_all_channel_groups(struct iwm_phy_db * int err; struct iwm_phy_db_entry *entry; - /* Send all the channel specific groups to operational fw */ + /* Send all the channel specific groups to operational fw */ for (i = 0; i < max_ch_groups; i++) { entry = iwm_phy_db_get_section(phy_db, type, Modified: head/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- head/sys/dev/iwm/if_iwm_scan.c Thu Jan 24 03:42:59 2019 (r343376) +++ head/sys/dev/iwm/if_iwm_scan.c Thu Jan 24 03:43:45 2019 (r343377) @@ -215,7 +215,7 @@ static inline boolean_t iwm_mvm_rrm_scan_needed(struct iwm_softc *sc) { /* require rrm scan whenever the fw supports it */ - return fw_has_capa(&sc->ucode_capa, + return fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT); } @@ -251,7 +251,7 @@ iwm_mvm_rx_lmac_scan_complete_notif(struct iwm_softc * /* If this happens, the firmware has mistakenly sent an LMAC * notification during UMAC scans -- warn and ignore it. */ - if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { + if (fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { device_printf(sc->sc_dev, "%s: Mistakenly got LMAC notification during UMAC scan\n", __func__); @@ -307,7 +307,8 @@ iwm_mvm_lmac_scan_fill_channels(struct iwm_softc *sc, int j; for (nchan = j = 0; - j < ss->ss_last && nchan < sc->ucode_capa.n_scan_channels; j++) { + j < ss->ss_last && nchan < sc->sc_fw.ucode_capa.n_scan_channels; + j++) { c = ss->ss_chans[j]; /* * Catch other channels, in case we have 900MHz channels or @@ -350,7 +351,8 @@ iwm_mvm_umac_scan_fill_channels(struct iwm_softc *sc, int j; for (nchan = j = 0; - j < ss->ss_last && nchan < sc->ucode_capa.n_scan_channels; j++) { + j < ss->ss_last && nchan < sc->sc_fw.ucode_capa.n_scan_channels; + j++) { c = ss->ss_chans[j]; /* * Catch other channels, in case we have 900MHz channels or @@ -495,7 +497,7 @@ iwm_mvm_config_umac_scan(struct iwm_softc *sc) IWM_SCAN_CONFIG_RATE_36M | IWM_SCAN_CONFIG_RATE_48M | IWM_SCAN_CONFIG_RATE_54M); - cmd_size = sizeof(*scan_config) + sc->ucode_capa.n_scan_channels; + cmd_size = sizeof(*scan_config) + sc->sc_fw.ucode_capa.n_scan_channels; scan_config = malloc(cmd_size, M_DEVBUF, M_NOWAIT | M_ZERO); if (scan_config == NULL) @@ -523,7 +525,8 @@ iwm_mvm_config_umac_scan(struct iwm_softc *sc) IWM_CHANNEL_FLAG_PRE_SCAN_PASSIVE2ACTIVE; for (nchan = j = 0; - j < ic->ic_nchans && nchan < sc->ucode_capa.n_scan_channels; j++) { + j < ic->ic_nchans && nchan < sc->sc_fw.ucode_capa.n_scan_channels; + j++) { c = &ic->ic_channels[j]; /* For 2GHz, only populate 11b channels */ /* For 5GHz, only populate 11a channels */ @@ -566,7 +569,7 @@ iwm_mvm_config_umac_scan(struct iwm_softc *sc) static boolean_t iwm_mvm_scan_use_ebs(struct iwm_softc *sc) { - const struct iwm_ucode_capabilities *capa = &sc->ucode_capa; + const struct iwm_ucode_capabilities *capa = &sc->sc_fw.ucode_capa; /* We can only use EBS if: * 1. the feature is supported; @@ -596,7 +599,7 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) req_len = sizeof(struct iwm_scan_req_umac) + (sizeof(struct iwm_scan_channel_cfg_umac) * - sc->ucode_capa.n_scan_channels) + + sc->sc_fw.ucode_capa.n_scan_channels) + sizeof(struct iwm_scan_req_umac_tail); if (req_len > IWM_MAX_CMD_PAYLOAD_SIZE) return ENOMEM; @@ -630,7 +633,7 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) tail = (void *)((char *)&req->data + sizeof(struct iwm_scan_channel_cfg_umac) * - sc->ucode_capa.n_scan_channels); + sc->sc_fw.ucode_capa.n_scan_channels); /* Check if we're doing an active directed scan. */ for (i = 0; i < nssid; i++) { @@ -694,7 +697,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) req_len = sizeof(struct iwm_scan_req_lmac) + (sizeof(struct iwm_scan_channel_cfg_lmac) * - sc->ucode_capa.n_scan_channels) + sizeof(struct iwm_scan_probe_req); + sc->sc_fw.ucode_capa.n_scan_channels) + sizeof(struct iwm_scan_probe_req); if (req_len > IWM_MAX_CMD_PAYLOAD_SIZE) return ENOMEM; req = malloc(req_len, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -764,7 +767,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) ret = iwm_mvm_fill_probe_req(sc, (struct iwm_scan_probe_req *)(req->data + (sizeof(struct iwm_scan_channel_cfg_lmac) * - sc->ucode_capa.n_scan_channels))); + sc->sc_fw.ucode_capa.n_scan_channels))); if (ret) { free(req, M_DEVBUF); return ret; @@ -863,7 +866,7 @@ iwm_mvm_scan_stop_wait(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "Preparing to stop scan\n"); - if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) + if (fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) ret = iwm_mvm_umac_scan_abort(sc); else ret = iwm_mvm_lmac_scan_abort(sc); Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:42:59 2019 (r343376) +++ head/sys/dev/iwm/if_iwmvar.h Thu Jan 24 03:43:45 2019 (r343377) @@ -186,16 +186,21 @@ struct iwm_fw_desc { uint32_t offset; /* offset in the device */ }; +struct iwm_fw_img { + struct iwm_fw_desc sec[IWM_UCODE_SECTION_MAX]; + int fw_count; + int is_dual_cpus; + uint32_t paging_mem_size; +}; + struct iwm_fw_info { const struct firmware *fw_fp; - struct iwm_fw_sects { - struct iwm_fw_desc fw_sect[IWM_UCODE_SECTION_MAX]; - int fw_count; - int is_dual_cpus; - uint32_t paging_mem_size; - } fw_sects[IWM_UCODE_TYPE_MAX]; + /* ucode images */ + struct iwm_fw_img img[IWM_UCODE_TYPE_MAX]; + struct iwm_ucode_capabilities ucode_capa; + uint32_t phy_config; uint8_t valid_tx_ant; uint8_t valid_rx_ant; @@ -470,7 +475,6 @@ struct iwm_softc { int ucode_loaded; char sc_fwver[32]; - struct iwm_ucode_capabilities ucode_capa; char sc_fw_mcc[3]; int sc_intmask; From owner-svn-src-head@freebsd.org Thu Jan 24 03:46:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D08914C02EF; Thu, 24 Jan 2019 03:46:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E64D576201; Thu, 24 Jan 2019 03:46:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA67822C34; Thu, 24 Jan 2019 03:46:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O3kZwN025934; Thu, 24 Jan 2019 03:46:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O3kZXE025933; Thu, 24 Jan 2019 03:46:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901240346.x0O3kZXE025933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 24 Jan 2019 03:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343382 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E64D576201 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 03:46:36 -0000 Author: kevans Date: Thu Jan 24 03:46:35 2019 New Revision: 343382 URL: https://svnweb.freebsd.org/changeset/base/343382 Log: iwm - Avoid Tx watchdog timeout, when dropping a connection. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (3e12596fb5c55351517cdd741d72979388a8c75c) Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:45:55 2019 (r343381) +++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:46:35 2019 (r343382) @@ -4329,6 +4329,10 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ IEEE80211_UNLOCK(ic); IWM_LOCK(sc); + /* Avoid Tx watchdog triggering, when a connectionm is dropped. */ + if (vap->iv_state == IEEE80211_S_RUN && nstate != IEEE80211_S_RUN) + sc->sc_tx_timer = 0; + if ((sc->sc_flags & IWM_FLAG_SCAN_RUNNING) && (nstate == IEEE80211_S_AUTH || nstate == IEEE80211_S_ASSOC || From owner-svn-src-head@freebsd.org Thu Jan 24 06:34:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D580814C4452; Thu, 24 Jan 2019 06:34:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7934F83B3A; Thu, 24 Jan 2019 06:34:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64D3C248DC; Thu, 24 Jan 2019 06:34:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O6YUdZ013809; Thu, 24 Jan 2019 06:34:30 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O6YUIe013808; Thu, 24 Jan 2019 06:34:30 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901240634.x0O6YUIe013808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 24 Jan 2019 06:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343391 - head/tools/tools/tinybsd X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/tools/tools/tinybsd X-SVN-Commit-Revision: 343391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7934F83B3A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 06:34:31 -0000 Author: gonzo Date: Thu Jan 24 06:34:29 2019 New Revision: 343391 URL: https://svnweb.freebsd.org/changeset/base/343391 Log: Fix prompt for MFSROOT in tinybsd tinybsd offers two choices when prompting user for MFSROOT: 'YES' and 'NO'. Script logic only handles 'yes'. Change offered values to lower case. PR: 131059 Submitted by: Brock Williams MFC after: 1 week Modified: head/tools/tools/tinybsd/tinybsd Modified: head/tools/tools/tinybsd/tinybsd ============================================================================== --- head/tools/tools/tinybsd/tinybsd Thu Jan 24 03:50:27 2019 (r343390) +++ head/tools/tools/tinybsd/tinybsd Thu Jan 24 06:34:29 2019 (r343391) @@ -206,7 +206,7 @@ loadconfig () { break fi done - MFSROOT=`confirm_action "$MFSROOT" "Use an MFSROOT? (YES/NO)"` + MFSROOT=`confirm_action "$MFSROOT" "Use an MFSROOT? (yes/no)"` IMG=`confirm_action "$IMG" "Image file to generate?"` # example of formatted value (NNN in this case) From owner-svn-src-head@freebsd.org Thu Jan 24 08:15:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B890B14C6188; Thu, 24 Jan 2019 08:15:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5426A863B6; Thu, 24 Jan 2019 08:15:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48C78259A3; Thu, 24 Jan 2019 08:15:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O8FgsS065349; Thu, 24 Jan 2019 08:15:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O8FgPt065348; Thu, 24 Jan 2019 08:15:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901240815.x0O8FgPt065348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 24 Jan 2019 08:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343392 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 343392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5426A863B6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 08:15:42 -0000 Author: hselasky Date: Thu Jan 24 08:15:41 2019 New Revision: 343392 URL: https://svnweb.freebsd.org/changeset/base/343392 Log: Fix duplicate acquiring of refcount when joining IPv6 multicast groups. This was observed by starting and stopping rpcbind(8) multiple times. PR: 233535 Differential Revision: https://reviews.freebsd.org/D18887 Reviewed by: bz (net) Tested by: ae MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Thu Jan 24 06:34:29 2019 (r343391) +++ head/sys/netinet6/in6_mcast.c Thu Jan 24 08:15:41 2019 (r343392) @@ -2178,7 +2178,10 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sop IN6_MULTI_UNLOCK(); goto out_im6o_free; } - in6m_acquire(inm); + /* + * NOTE: Refcount from in6_joingroup_locked() + * is protecting membership. + */ imo->im6o_membership[idx] = inm; } else { CTR1(KTR_MLD, "%s: merge inm state", __func__); From owner-svn-src-head@freebsd.org Thu Jan 24 08:18:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EB5A14C6250; Thu, 24 Jan 2019 08:18:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7BC386638; Thu, 24 Jan 2019 08:18:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4A20259DB; Thu, 24 Jan 2019 08:18:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O8I2Jc065495; Thu, 24 Jan 2019 08:18:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O8I2GU065494; Thu, 24 Jan 2019 08:18:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901240818.x0O8I2GU065494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 24 Jan 2019 08:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343393 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 343393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B7BC386638 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 08:18:03 -0000 Author: hselasky Date: Thu Jan 24 08:18:02 2019 New Revision: 343393 URL: https://svnweb.freebsd.org/changeset/base/343393 Log: Add debugging sysctl to disable incoming MLD v2 messages similar to the existing sysctl for MLD v1 messages. PR: 233535 Differential Revision: https://reviews.freebsd.org/D18887 Reviewed by: bz (net) Tested by: ae MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/netinet6/mld6.c Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Thu Jan 24 08:15:41 2019 (r343392) +++ head/sys/netinet6/mld6.c Thu Jan 24 08:18:02 2019 (r343393) @@ -243,6 +243,10 @@ static int mld_v1enable = 1; SYSCTL_INT(_net_inet6_mld, OID_AUTO, v1enable, CTLFLAG_RWTUN, &mld_v1enable, 0, "Enable fallback to MLDv1"); +static int mld_v2enable = 1; +SYSCTL_INT(_net_inet6_mld, OID_AUTO, v2enable, CTLFLAG_RWTUN, + &mld_v2enable, 0, "Enable MLDv2"); + static int mld_use_allow = 1; SYSCTL_INT(_net_inet6_mld, OID_AUTO, use_allow, CTLFLAG_RWTUN, &mld_use_allow, 0, "Use ALLOW/BLOCK for RFC 4604 SSM joins/leaves"); @@ -817,7 +821,12 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6 char ip6tbuf[INET6_ADDRSTRLEN]; #endif - is_general_query = 0; + if (!mld_v2enable) { + CTR3(KTR_MLD, "ignore v2 query src %s on ifp %p(%s)", + ip6_sprintf(ip6tbuf, &ip6->ip6_src), + ifp, if_name(ifp)); + return (0); + } /* * RFC3810 Section 6.2: MLD queries must originate from @@ -829,6 +838,8 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6 ifp, if_name(ifp)); return (0); } + + is_general_query = 0; CTR2(KTR_MLD, "input v2 query on ifp %p(%s)", ifp, if_name(ifp)); From owner-svn-src-head@freebsd.org Thu Jan 24 08:25:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F22114C66B9; Thu, 24 Jan 2019 08:25:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D44B886C56; Thu, 24 Jan 2019 08:25:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6E0725B84; Thu, 24 Jan 2019 08:25:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O8P3nO070685; Thu, 24 Jan 2019 08:25:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O8P3fd070682; Thu, 24 Jan 2019 08:25:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901240825.x0O8P3fd070682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 24 Jan 2019 08:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343394 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 343394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D44B886C56 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 08:25:04 -0000 Author: hselasky Date: Thu Jan 24 08:25:02 2019 New Revision: 343394 URL: https://svnweb.freebsd.org/changeset/base/343394 Log: When detaching a network interface drain the workqueue freeing the inm's because the destructor will access the if_ioctl() callback in the ifnet pointer which is about to be freed. This prevents use-after-free. PR: 233535 Differential Revision: https://reviews.freebsd.org/D18887 Reviewed by: bz (net) Tested by: ae MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_var.h Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Thu Jan 24 08:18:02 2019 (r343393) +++ head/sys/netinet6/in6_ifattach.c Thu Jan 24 08:25:02 2019 (r343394) @@ -884,6 +884,13 @@ in6_purgemaddrs(struct ifnet *ifp) IN6_MULTI_LIST_UNLOCK(); IN6_MULTI_UNLOCK(); in6m_release_list_deferred(&purgeinms); + + /* + * Make sure all multicast deletions invoking if_ioctl() are + * completed before returning. Else we risk accessing a freed + * ifnet structure pointer. + */ + in6m_release_wait(); } void Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Thu Jan 24 08:18:02 2019 (r343393) +++ head/sys/netinet6/in6_mcast.c Thu Jan 24 08:25:02 2019 (r343394) @@ -585,6 +585,14 @@ in6m_release_list_deferred(struct in6_multi_head *inmh } void +in6m_release_wait(void) +{ + + /* Wait for all jobs to complete. */ + gtaskqueue_drain_all(free_gtask.gt_taskqueue); +} + +void in6m_disconnect(struct in6_multi *inm) { struct ifnet *ifp; Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Thu Jan 24 08:18:02 2019 (r343393) +++ head/sys/netinet6/in6_var.h Thu Jan 24 08:25:02 2019 (r343394) @@ -811,6 +811,7 @@ void in6m_print(const struct in6_multi *); int in6m_record_source(struct in6_multi *, const struct in6_addr *); void in6m_release_deferred(struct in6_multi *); void in6m_release_list_deferred(struct in6_multi_head *); +void in6m_release_wait(void); void ip6_freemoptions(struct ip6_moptions *); int ip6_getmoptions(struct inpcb *, struct sockopt *); int ip6_setmoptions(struct inpcb *, struct sockopt *); From owner-svn-src-head@freebsd.org Thu Jan 24 08:34:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EA5814C6B0B; Thu, 24 Jan 2019 08:34:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4FC58737F; Thu, 24 Jan 2019 08:34:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AD4225D63; Thu, 24 Jan 2019 08:34:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0O8YExP075803; Thu, 24 Jan 2019 08:34:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0O8YD8Q075799; Thu, 24 Jan 2019 08:34:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901240834.x0O8YD8Q075799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 24 Jan 2019 08:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343395 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 343395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4FC58737F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 08:34:15 -0000 Author: hselasky Date: Thu Jan 24 08:34:13 2019 New Revision: 343395 URL: https://svnweb.freebsd.org/changeset/base/343395 Log: Fix refcounting leaks in IPv6 MLD code leading to loss of IPv6 connectivity. Looking at past changes in this area like r337866, some refcounting bugs have been introduced, one by one. For example like calling in6m_disconnect() and in6m_rele_locked() in mld_v1_process_group_timer() where previously no disconnect nor refcount decrement was done. Calling in6m_disconnect() when it shouldn't causes IPv6 solitation to no longer work, because all the multicast addresses receiving the solitation messages are now deleted from the network interface. This patch reverts some recent changes while improving the MLD refcounting and concurrency model after the MLD code was converted to using EPOCH(9). List changes: - All CK_STAILQ_FOREACH() macros are now properly enclosed into EPOCH(9) sections. This simplifies assertion of locking inside in6m_ifmultiaddr_get_inm(). - Corrected bad use of in6m_disconnect() leading to loss of IPv6 connectivity for MLD v1. - Factored out checks for valid inm structure into in6m_ifmultiaddr_get_inm(). PR: 233535 Differential Revision: https://reviews.freebsd.org/D18887 Reviewed by: bz (net) Tested by: ae MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_var.h head/sys/netinet6/mld6.c head/sys/netinet6/mld6_var.h Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Thu Jan 24 08:25:02 2019 (r343394) +++ head/sys/netinet6/in6_ifattach.c Thu Jan 24 08:34:13 2019 (r343395) @@ -854,36 +854,15 @@ in6_tmpaddrtimer(void *arg) static void in6_purgemaddrs(struct ifnet *ifp) { - struct in6_multi_head purgeinms; - struct in6_multi *inm; - struct ifmultiaddr *ifma, *next; + struct in6_multi_head inmh; - SLIST_INIT(&purgeinms); + SLIST_INIT(&inmh); IN6_MULTI_LOCK(); IN6_MULTI_LIST_LOCK(); - IF_ADDR_WLOCK(ifp); - /* - * Extract list of in6_multi associated with the detaching ifp - * which the PF_INET6 layer is about to release. - */ - restart: - CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) { - if (ifma->ifma_addr->sa_family != AF_INET6 || - ifma->ifma_protospec == NULL) - continue; - inm = (struct in6_multi *)ifma->ifma_protospec; - in6m_disconnect(inm); - in6m_rele_locked(&purgeinms, inm); - if (__predict_false(ifma6_restart)) { - ifma6_restart = false; - goto restart; - } - } - IF_ADDR_WUNLOCK(ifp); - mld_ifdetach(ifp); + mld_ifdetach(ifp, &inmh); IN6_MULTI_LIST_UNLOCK(); IN6_MULTI_UNLOCK(); - in6m_release_list_deferred(&purgeinms); + in6m_release_list_deferred(&inmh); /* * Make sure all multicast deletions invoking if_ioctl() are Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Thu Jan 24 08:25:02 2019 (r343394) +++ head/sys/netinet6/in6_mcast.c Thu Jan 24 08:34:13 2019 (r343395) @@ -190,7 +190,6 @@ static SYSCTL_NODE(_net_inet6_ip6_mcast, OID_AUTO, fil CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_ip6_mcast_filters, "Per-interface stack-wide source filters"); -int ifma6_restart = 0; #ifdef KTR /* * Inline function which wraps assertions for a valid ifp. @@ -405,6 +404,7 @@ static int in6_getmulti(struct ifnet *ifp, const struct in6_addr *group, struct in6_multi **pinm) { + struct epoch_tracker et; struct sockaddr_in6 gsin6; struct ifmultiaddr *ifma; struct in6_multi *inm; @@ -420,7 +420,10 @@ in6_getmulti(struct ifnet *ifp, const struct in6_addr IN6_MULTI_LOCK_ASSERT(); IN6_MULTI_LIST_LOCK(); IF_ADDR_WLOCK(ifp); + NET_EPOCH_ENTER(et); inm = in6m_lookup_locked(ifp, group); + NET_EPOCH_EXIT(et); + if (inm != NULL) { /* * If we already joined this group, just bump the @@ -593,7 +596,7 @@ in6m_release_wait(void) } void -in6m_disconnect(struct in6_multi *inm) +in6m_disconnect_locked(struct in6_multi_head *inmh, struct in6_multi *inm) { struct ifnet *ifp; struct ifaddr *ifa; @@ -601,10 +604,12 @@ in6m_disconnect(struct in6_multi *inm) struct in6_multi_mship *imm, *imm_tmp; struct ifmultiaddr *ifma, *ll_ifma; - ifp = inm->in6m_ifp; + IN6_MULTI_LIST_LOCK_ASSERT(); + ifp = inm->in6m_ifp; if (ifp == NULL) - return; + return; /* already called */ + inm->in6m_ifp = NULL; IF_ADDR_WLOCK_ASSERT(ifp); ifma = inm->in6m_ifma; @@ -623,7 +628,6 @@ in6m_disconnect(struct in6_multi *inm) MPASS(ll_ifma->ifma_llifma == NULL); MPASS(ll_ifma->ifma_ifp == ifp); if (--ll_ifma->ifma_refcount == 0) { - ifma6_restart = true; if (ll_ifma->ifma_flags & IFMA_F_ENQUEUED) { CK_STAILQ_REMOVE(&ifp->if_multiaddrs, ll_ifma, ifmultiaddr, ifma_link); ll_ifma->ifma_flags &= ~IFMA_F_ENQUEUED; @@ -641,28 +645,12 @@ in6m_disconnect(struct in6_multi *inm) if (inm == imm->i6mm_maddr) { LIST_REMOVE(imm, i6mm_chain); free(imm, M_IP6MADDR); + in6m_rele_locked(inmh, inm); } } } } -void -in6m_release_deferred(struct in6_multi *inm) -{ - struct in6_multi_head tmp; - - IN6_MULTI_LIST_LOCK_ASSERT(); - KASSERT(inm->in6m_refcount > 0, ("refcount == %d inm: %p", inm->in6m_refcount, inm)); - if (--inm->in6m_refcount == 0) { - MPASS(inm->in6m_ifp == NULL); - SLIST_INIT(&tmp); - inm->in6m_ifma->ifma_protospec = NULL; - MPASS(inm->in6m_ifma->ifma_llifma == NULL); - SLIST_INSERT_HEAD(&tmp, inm, in6m_nrele); - in6m_release_list_deferred(&tmp); - } -} - static void in6m_release_task(void *arg __unused) { @@ -1262,6 +1250,7 @@ in6_joingroup_locked(struct ifnet *ifp, const struct i /*const*/ struct in6_mfilter *imf, struct in6_multi **pinm, const int delay) { + struct in6_multi_head inmh; struct in6_mfilter timf; struct in6_multi *inm; struct ifmultiaddr *ifma; @@ -1321,6 +1310,7 @@ in6_joingroup_locked(struct ifnet *ifp, const struct i } out_in6m_release: + SLIST_INIT(&inmh); if (error) { struct epoch_tracker et; @@ -1332,13 +1322,14 @@ out_in6m_release: break; } } - in6m_disconnect(inm); - in6m_release_deferred(inm); + in6m_disconnect_locked(&inmh, inm); + in6m_rele_locked(&inmh, inm); NET_EPOCH_EXIT(et); } else { *pinm = inm; } IN6_MULTI_LIST_UNLOCK(); + in6m_release_list_deferred(&inmh); return (error); } @@ -1372,6 +1363,7 @@ in6_leavegroup(struct in6_multi *inm, /*const*/ struct int in6_leavegroup_locked(struct in6_multi *inm, /*const*/ struct in6_mfilter *imf) { + struct in6_multi_head inmh; struct in6_mfilter timf; struct ifnet *ifp; int error; @@ -1421,13 +1413,15 @@ in6_leavegroup_locked(struct in6_multi *inm, /*const*/ CTR2(KTR_MLD, "%s: dropping ref on %p", __func__, inm); if (ifp) IF_ADDR_WLOCK(ifp); - if (inm->in6m_refcount == 1 && inm->in6m_ifp != NULL) - in6m_disconnect(inm); - in6m_release_deferred(inm); + + SLIST_INIT(&inmh); + if (inm->in6m_refcount == 1) + in6m_disconnect_locked(&inmh, inm); + in6m_rele_locked(&inmh, inm); if (ifp) IF_ADDR_WUNLOCK(ifp); IN6_MULTI_LIST_UNLOCK(); - + in6m_release_list_deferred(&inmh); return (error); } @@ -1941,6 +1935,7 @@ in6p_lookup_mcast_ifp(const struct inpcb *in6p, static int in6p_join_group(struct inpcb *inp, struct sockopt *sopt) { + struct in6_multi_head inmh; struct group_source_req gsr; sockunion_t *gsa, *ssa; struct ifnet *ifp; @@ -1951,6 +1946,7 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sop size_t idx; int error, is_new; + SLIST_INIT(&inmh); ifp = NULL; imf = NULL; lims = NULL; @@ -2227,7 +2223,7 @@ out_im6o_free: inm = imo->im6o_membership[idx]; if (inm != NULL) { IN6_MULTI_LIST_LOCK(); - in6m_release_deferred(inm); + in6m_rele_locked(&inmh, inm); IN6_MULTI_LIST_UNLOCK(); } imo->im6o_membership[idx] = NULL; @@ -2236,6 +2232,7 @@ out_im6o_free: out_in6p_locked: INP_WUNLOCK(inp); + in6m_release_list_deferred(&inmh); return (error); } @@ -2880,10 +2877,9 @@ sysctl_ip6_mcast_filters(SYSCTL_HANDLER_ARGS) IN6_MULTI_LIST_LOCK(); NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_INET6 || - ifma->ifma_protospec == NULL) + inm = in6m_ifmultiaddr_get_inm(ifma); + if (inm == NULL) continue; - inm = (struct in6_multi *)ifma->ifma_protospec; if (!IN6_ARE_ADDR_EQUAL(&inm->in6m_addr, &mcaddr)) continue; fmode = inm->in6m_st[1].iss_fmode; Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Thu Jan 24 08:25:02 2019 (r343394) +++ head/sys/netinet6/in6_var.h Thu Jan 24 08:34:13 2019 (r343395) @@ -645,6 +645,7 @@ struct in6_multi { /* New fields for MLDv2 follow. */ struct mld_ifsoftc *in6m_mli; /* MLD info */ SLIST_ENTRY(in6_multi) in6m_nrele; /* to-be-released by MLD */ + SLIST_ENTRY(in6_multi) in6m_defer; /* deferred MLDv1 */ struct ip6_msource_tree in6m_srcs; /* tree of sources */ u_long in6m_nsrc; /* # of tree entries */ @@ -670,8 +671,8 @@ struct in6_multi { } in6m_st[2]; /* state at t0, t1 */ }; -void in6m_disconnect(struct in6_multi *inm); -extern int ifma6_restart; +void in6m_disconnect_locked(struct in6_multi_head *inmh, struct in6_multi *inm); + /* * Helper function to derive the filter mode on a source entry * from its internal counters. Predicates are: @@ -713,13 +714,25 @@ extern struct sx in6_multi_sx; #define IN6_MULTI_LOCK_ASSERT() sx_assert(&in6_multi_sx, SA_XLOCKED) #define IN6_MULTI_UNLOCK_ASSERT() sx_assert(&in6_multi_sx, SA_XUNLOCKED) +/* + * Get the in6_multi pointer from a ifmultiaddr. + * Returns NULL if ifmultiaddr is no longer valid. + */ +static __inline struct in6_multi * +in6m_ifmultiaddr_get_inm(struct ifmultiaddr *ifma) +{ + NET_EPOCH_ASSERT(); + + return ((ifma->ifma_addr->sa_family != AF_INET6 || + (ifma->ifma_flags & IFMA_F_ENQUEUED) == 0) ? NULL : + ifma->ifma_protospec); +} + /* * Look up an in6_multi record for an IPv6 multicast address * on the interface ifp. * If no record found, return NULL. - * - * SMPng: The IN6_MULTI_LOCK and IF_ADDR_LOCK on ifp must be held. */ static __inline struct in6_multi * in6m_lookup_locked(struct ifnet *ifp, const struct in6_addr *mcaddr) @@ -727,18 +740,14 @@ in6m_lookup_locked(struct ifnet *ifp, const struct in6 struct ifmultiaddr *ifma; struct in6_multi *inm; - inm = NULL; - CK_STAILQ_FOREACH(ifma, &((ifp)->if_multiaddrs), ifma_link) { - if (ifma->ifma_addr->sa_family == AF_INET6) { - inm = (struct in6_multi *)ifma->ifma_protospec; - if (inm == NULL) - continue; - if (IN6_ARE_ADDR_EQUAL(&inm->in6m_addr, mcaddr)) - break; - inm = NULL; - } + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + inm = in6m_ifmultiaddr_get_inm(ifma); + if (inm == NULL) + continue; + if (IN6_ARE_ADDR_EQUAL(&inm->in6m_addr, mcaddr)) + return (inm); } - return (inm); + return (NULL); } /* @@ -809,7 +818,6 @@ void in6m_clear_recorded(struct in6_multi *); void in6m_commit(struct in6_multi *); void in6m_print(const struct in6_multi *); int in6m_record_source(struct in6_multi *, const struct in6_addr *); -void in6m_release_deferred(struct in6_multi *); void in6m_release_list_deferred(struct in6_multi_head *); void in6m_release_wait(void); void ip6_freemoptions(struct ip6_moptions *); Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Thu Jan 24 08:25:02 2019 (r343394) +++ head/sys/netinet6/mld6.c Thu Jan 24 08:34:13 2019 (r343395) @@ -110,7 +110,7 @@ static void mli_delete_locked(const struct ifnet *); static void mld_dispatch_packet(struct mbuf *); static void mld_dispatch_queue(struct mbufq *, int); static void mld_final_leave(struct in6_multi *, struct mld_ifsoftc *); -static void mld_fasttimo_vnet(void); +static void mld_fasttimo_vnet(struct in6_multi_head *inmh); static int mld_handle_state_change(struct in6_multi *, struct mld_ifsoftc *); static int mld_initial_join(struct in6_multi *, struct mld_ifsoftc *, @@ -537,45 +537,48 @@ out: * XXX This routine is also bitten by unlocked ifma_protospec access. */ void -mld_ifdetach(struct ifnet *ifp) +mld_ifdetach(struct ifnet *ifp, struct in6_multi_head *inmh) { + struct epoch_tracker et; struct mld_ifsoftc *mli; - struct ifmultiaddr *ifma, *next; + struct ifmultiaddr *ifma; struct in6_multi *inm; - struct in6_multi_head inmh; CTR3(KTR_MLD, "%s: called for ifp %p(%s)", __func__, ifp, if_name(ifp)); - SLIST_INIT(&inmh); IN6_MULTI_LIST_LOCK_ASSERT(); MLD_LOCK(); mli = MLD_IFINFO(ifp); - if (mli->mli_version == MLD_VERSION_2) { - IF_ADDR_WLOCK(ifp); - restart: - CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) { - if (ifma->ifma_addr->sa_family != AF_INET6 || - ifma->ifma_protospec == NULL) - continue; - inm = (struct in6_multi *)ifma->ifma_protospec; + IF_ADDR_WLOCK(ifp); + /* + * Extract list of in6_multi associated with the detaching ifp + * which the PF_INET6 layer is about to release. + */ + NET_EPOCH_ENTER(et); + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + inm = in6m_ifmultiaddr_get_inm(ifma); + if (inm == NULL) + continue; + in6m_disconnect_locked(inmh, inm); + + if (mli->mli_version == MLD_VERSION_2) { + in6m_clear_recorded(inm); + + /* + * We need to release the final reference held + * for issuing the INCLUDE {}. + */ if (inm->in6m_state == MLD_LEAVING_MEMBER) { - in6m_disconnect(inm); - in6m_rele_locked(&inmh, inm); - ifma->ifma_protospec = NULL; + inm->in6m_state = MLD_NOT_MEMBER; + in6m_rele_locked(inmh, inm); } - in6m_clear_recorded(inm); - if (__predict_false(ifma6_restart)) { - ifma6_restart = false; - goto restart; - } } - IF_ADDR_WUNLOCK(ifp); } - + NET_EPOCH_EXIT(et); + IF_ADDR_WUNLOCK(ifp); MLD_UNLOCK(); - in6m_release_list_deferred(&inmh); } /* @@ -709,10 +712,9 @@ mld_v1_input_query(struct ifnet *ifp, const struct ip6 CTR2(KTR_MLD, "process v1 general query on ifp %p(%s)", ifp, if_name(ifp)); CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_INET6 || - ifma->ifma_protospec == NULL) + inm = in6m_ifmultiaddr_get_inm(ifma); + if (inm == NULL) continue; - inm = (struct in6_multi *)ifma->ifma_protospec; mld_v1_update_group(inm, timer); } } else { @@ -1324,15 +1326,19 @@ mld_input(struct mbuf *m, int off, int icmp6len) void mld_fasttimo(void) { + struct in6_multi_head inmh; VNET_ITERATOR_DECL(vnet_iter); + SLIST_INIT(&inmh); + VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - mld_fasttimo_vnet(); + mld_fasttimo_vnet(&inmh); CURVNET_RESTORE(); } VNET_LIST_RUNLOCK_NOSLEEP(); + in6m_release_list_deferred(&inmh); } /* @@ -1341,15 +1347,15 @@ mld_fasttimo(void) * VIMAGE: Assume caller has set up our curvnet. */ static void -mld_fasttimo_vnet(void) +mld_fasttimo_vnet(struct in6_multi_head *inmh) { + struct epoch_tracker et; struct mbufq scq; /* State-change packets */ struct mbufq qrq; /* Query response packets */ struct ifnet *ifp; struct mld_ifsoftc *mli; - struct ifmultiaddr *ifma, *next; - struct in6_multi *inm, *tinm; - struct in6_multi_head inmh; + struct ifmultiaddr *ifma; + struct in6_multi *inm; int uri_fasthz; uri_fasthz = 0; @@ -1364,7 +1370,6 @@ mld_fasttimo_vnet(void) !V_state_change_timers_running6) return; - SLIST_INIT(&inmh); IN6_MULTI_LIST_LOCK(); MLD_LOCK(); @@ -1410,25 +1415,20 @@ mld_fasttimo_vnet(void) } IF_ADDR_WLOCK(ifp); - restart: - CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) { - if (ifma->ifma_addr->sa_family != AF_INET6 || - ifma->ifma_protospec == NULL) + NET_EPOCH_ENTER(et); + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + inm = in6m_ifmultiaddr_get_inm(ifma); + if (inm == NULL) continue; - inm = (struct in6_multi *)ifma->ifma_protospec; switch (mli->mli_version) { case MLD_VERSION_1: - mld_v1_process_group_timer(&inmh, inm); + mld_v1_process_group_timer(inmh, inm); break; case MLD_VERSION_2: - mld_v2_process_group_timers(&inmh, &qrq, + mld_v2_process_group_timers(inmh, &qrq, &scq, inm, uri_fasthz); break; } - if (__predict_false(ifma6_restart)) { - ifma6_restart = false; - goto restart; - } } IF_ADDR_WUNLOCK(ifp); @@ -1442,9 +1442,8 @@ mld_fasttimo_vnet(void) * IF_ADDR_LOCK internally as well as * ip6_output() to transmit a packet. */ - SLIST_FOREACH_SAFE(inm, &inmh, in6m_nrele, tinm) { - SLIST_REMOVE_HEAD(&inmh, - in6m_nrele); + while ((inm = SLIST_FIRST(inmh)) != NULL) { + SLIST_REMOVE_HEAD(inmh, in6m_defer); (void)mld_v1_transmit_report(inm, MLD_LISTENER_REPORT); } @@ -1452,14 +1451,9 @@ mld_fasttimo_vnet(void) case MLD_VERSION_2: mld_dispatch_queue(&qrq, 0); mld_dispatch_queue(&scq, 0); - - /* - * Free the in_multi reference(s) for - * this lifecycle. - */ - in6m_release_list_deferred(&inmh); break; } + NET_EPOCH_EXIT(et); } out_locked: @@ -1499,8 +1493,7 @@ mld_v1_process_group_timer(struct in6_multi_head *inmh case MLD_REPORTING_MEMBER: if (report_timer_expired) { inm->in6m_state = MLD_IDLE_MEMBER; - in6m_disconnect(inm); - in6m_rele_locked(inmh, inm); + SLIST_INSERT_HEAD(inmh, inm, in6m_defer); } break; case MLD_G_QUERY_PENDING_MEMBER: @@ -1624,7 +1617,7 @@ mld_v2_process_group_timers(struct in6_multi_head *inm if (inm->in6m_state == MLD_LEAVING_MEMBER && inm->in6m_scrv == 0) { inm->in6m_state = MLD_NOT_MEMBER; - in6m_disconnect(inm); + in6m_disconnect_locked(inmh, inm); in6m_rele_locked(inmh, inm); } } @@ -1669,10 +1662,11 @@ mld_set_version(struct mld_ifsoftc *mli, const int ver static void mld_v2_cancel_link_timers(struct mld_ifsoftc *mli) { - struct ifmultiaddr *ifma, *next; + struct epoch_tracker et; + struct in6_multi_head inmh; + struct ifmultiaddr *ifma; struct ifnet *ifp; struct in6_multi *inm; - struct in6_multi_head inmh; CTR3(KTR_MLD, "%s: cancel v2 timers on ifp %p(%s)", __func__, mli->mli_ifp, if_name(mli->mli_ifp)); @@ -1695,12 +1689,11 @@ mld_v2_cancel_link_timers(struct mld_ifsoftc *mli) ifp = mli->mli_ifp; IF_ADDR_WLOCK(ifp); - restart: - CK_STAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) { - if (ifma->ifma_addr->sa_family != AF_INET6 || - ifma->ifma_protospec == NULL) + NET_EPOCH_ENTER(et); + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + inm = in6m_ifmultiaddr_get_inm(ifma); + if (inm == NULL) continue; - inm = (struct in6_multi *)ifma->ifma_protospec; switch (inm->in6m_state) { case MLD_NOT_MEMBER: case MLD_SILENT_MEMBER: @@ -1715,9 +1708,7 @@ mld_v2_cancel_link_timers(struct mld_ifsoftc *mli) * version, we need to release the final * reference held for issuing the INCLUDE {}. */ - in6m_disconnect(inm); in6m_rele_locked(&inmh, inm); - ifma->ifma_protospec = NULL; /* FALLTHROUGH */ case MLD_G_QUERY_PENDING_MEMBER: case MLD_SG_QUERY_PENDING_MEMBER: @@ -1733,11 +1724,8 @@ mld_v2_cancel_link_timers(struct mld_ifsoftc *mli) mbufq_drain(&inm->in6m_scq); break; } - if (__predict_false(ifma6_restart)) { - ifma6_restart = false; - goto restart; - } } + NET_EPOCH_EXIT(et); IF_ADDR_WUNLOCK(ifp); in6m_release_list_deferred(&inmh); } @@ -1910,6 +1898,14 @@ mld_change_state(struct in6_multi *inm, const int dela error = 0; /* + * Check if the in6_multi has already been disconnected. + */ + if (inm->in6m_ifp == NULL) { + CTR1(KTR_MLD, "%s: inm is disconnected", __func__); + return (0); + } + + /* * Try to detect if the upper layer just asked us to change state * for an interface which has now gone away. */ @@ -2019,6 +2015,7 @@ mld_initial_join(struct in6_multi *inm, struct mld_ifs if (mli->mli_version == MLD_VERSION_2 && inm->in6m_state == MLD_LEAVING_MEMBER) { inm->in6m_refcount--; + MPASS(inm->in6m_refcount > 0); } inm->in6m_state = MLD_REPORTING_MEMBER; @@ -3023,11 +3020,9 @@ mld_v2_dispatch_general_query(struct mld_ifsoftc *mli) NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_INET6 || - ifma->ifma_protospec == NULL) + inm = in6m_ifmultiaddr_get_inm(ifma); + if (inm == NULL) continue; - - inm = (struct in6_multi *)ifma->ifma_protospec; KASSERT(ifp == inm->in6m_ifp, ("%s: inconsistent ifp", __func__)); Modified: head/sys/netinet6/mld6_var.h ============================================================================== --- head/sys/netinet6/mld6_var.h Thu Jan 24 08:25:02 2019 (r343394) +++ head/sys/netinet6/mld6_var.h Thu Jan 24 08:34:13 2019 (r343395) @@ -160,12 +160,13 @@ struct mld_ifsoftc { #define MLD_IFINFO(ifp) \ (((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->mld_ifinfo) +struct in6_multi_head; int mld_change_state(struct in6_multi *, const int); struct mld_ifsoftc * mld_domifattach(struct ifnet *); void mld_domifdetach(struct ifnet *); void mld_fasttimo(void); -void mld_ifdetach(struct ifnet *); +void mld_ifdetach(struct ifnet *, struct in6_multi_head *); int mld_input(struct mbuf *, int, int); void mld_slowtimo(void); From owner-svn-src-head@freebsd.org Thu Jan 24 11:59:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2FBB14AD2E2; Thu, 24 Jan 2019 11:59:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A99F8F0D1; Thu, 24 Jan 2019 11:59:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80B4C280D3; Thu, 24 Jan 2019 11:59:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OBxlEk080192; Thu, 24 Jan 2019 11:59:47 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OBxk05080188; Thu, 24 Jan 2019 11:59:46 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201901241159.x0OBxk05080188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 24 Jan 2019 11:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343399 - in head: bin/sh share/skel X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: bin/sh share/skel X-SVN-Commit-Revision: 343399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A99F8F0D1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 11:59:48 -0000 Author: trasz Date: Thu Jan 24 11:59:46 2019 New Revision: 343399 URL: https://svnweb.freebsd.org/changeset/base/343399 Log: Make sh(1) support \u in PS1. This removes one fork/exec on interactive shell startup. Reviewed by: 0mp (man page), jilles MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18790 Modified: head/bin/sh/parser.c head/bin/sh/sh.1 head/share/skel/dot.shrc Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Thu Jan 24 11:31:57 2019 (r343398) +++ head/bin/sh/parser.c Thu Jan 24 11:59:46 2019 (r343399) @@ -40,6 +40,8 @@ static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/ #include __FBSDID("$FreeBSD$"); +#include +#include #include #include #include @@ -130,6 +132,7 @@ static void synexpect(int) __dead2; static void synerror(const char *) __dead2; static void setprompt(int); static int pgetc_linecont(void); +static void getusername(char *, size_t); static void * @@ -1969,6 +1972,53 @@ pgetc_linecont(void) return (c); } + +static struct passwd * +getpwlogin(void) +{ + const char *login; + + login = getlogin(); + if (login == NULL) + return (NULL); + + return (getpwnam(login)); +} + + +static void +getusername(char *name, size_t namelen) +{ + static char cached_name[MAXLOGNAME]; + struct passwd *pw; + uid_t euid; + + if (cached_name[0] == '\0') { + euid = geteuid(); + + /* + * Handle the case when there is more than one + * login with the same UID, or when the login + * returned by getlogin(2) does no longer match + * the current UID. + */ + pw = getpwlogin(); + if (pw == NULL || pw->pw_uid != euid) + pw = getpwuid(euid); + + if (pw != NULL) { + strlcpy(cached_name, pw->pw_name, + sizeof(cached_name)); + } else { + snprintf(cached_name, sizeof(cached_name), + "%u", euid); + } + } + + strlcpy(name, cached_name, namelen); +} + + /* * called by editline -- any expansions to the prompt * should be added here. @@ -2024,6 +2074,17 @@ getprompt(void *unused __unused) while ((ps[i] != '\0') && (ps[i] != trim)) i++; --i; + break; + + /* + * User name. + */ + case 'u': + ps[i] = '\0'; + getusername(&ps[i], PROMPTLEN - i); + /* Skip to end of username. */ + while (ps[i + 1] != '\0') + i++; break; /* Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Thu Jan 24 11:31:57 2019 (r343398) +++ head/bin/sh/sh.1 Thu Jan 24 11:59:46 2019 (r343399) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd December 8, 2018 +.Dd January 24, 2019 .Dt SH 1 .Os .Sh NAME @@ -1402,6 +1402,8 @@ which are replaced by the given information: This system's fully-qualified hostname (FQDN). .It Li \eh This system's hostname. +.It Li \eu +User name. .It Li \eW The final component of the current working directory. .It Li \ew Modified: head/share/skel/dot.shrc ============================================================================== --- head/share/skel/dot.shrc Thu Jan 24 11:31:57 2019 (r343398) +++ head/share/skel/dot.shrc Thu Jan 24 11:59:46 2019 (r343399) @@ -33,7 +33,7 @@ alias g='egrep -i' # set prompt: ``username@hostname:directory $ '' -PS1="`whoami`@\h:\w \\$ " +PS1="\u@\h:\w \\$ " # search path for cd(1) # CDPATH=:$HOME From owner-svn-src-head@freebsd.org Thu Jan 24 14:33:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21CC514B1963; Thu, 24 Jan 2019 14:33:29 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f169.google.com (mail-it1-f169.google.com [209.85.166.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6D466D972; Thu, 24 Jan 2019 14:33:27 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f169.google.com with SMTP id d11so5221522itf.2; Thu, 24 Jan 2019 06:33:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=46AvUTJwSJkenr5EemY+5/UiOJzqJZgqYYPh9EtIc0s=; b=A3eC1BKd20lVMhfgkuwVEfpfQKlSnwMogJLo1a832g+fykHgiMejXsZZBl5n37diR4 U+ij7q87Jzc4/gAiVQN/Bn8f5bF7YjC3Pekzuv3gtyipoqn2jeVbtQbgKgQl/6QveNOp hrMVmtNJJF5k70D1ZUKlfPmvo9JNHzAGXMK/ZCTW6RBtfZsFAgFNxYM938Z/F+zDb09t we7fsBkhDSH5PeOsqSYsW/PUussd3XBaYj7NkB243mByNI9tGdt+4kztP8WLrvuEM63x viGK1Hqr9k2HH3ms/rSfHAI+Zgq7zfUNXBDT1dwJglEE/SSU7n2IiDcKIwaVcgbdyz7/ 1D+g== X-Gm-Message-State: AJcUukcqOyrnHHRYoO5OCXOuYmZtrpfUmsFc/iqcPPHiFX3XKoyZvoye Az/Wh1TTRKfB2atXluS6ba4Xtaeuq/YswoFkh2A9GA== X-Google-Smtp-Source: ALg8bN4hLeZZWz7XBDgP+tJiZ1uFVg10IYKSZ0WkItsTU2HICYmeN6z1TUfen8P7vsP2Fr3etpartLD1uVZEGL1wVqs= X-Received: by 2002:a05:660c:84e:: with SMTP id f14mr1459902itl.33.1548340400497; Thu, 24 Jan 2019 06:33:20 -0800 (PST) MIME-Version: 1.0 References: <201901151535.x0FFZE94018787@repo.freebsd.org> <201901151700.x0FH0Crl041083@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201901151700.x0FH0Crl041083@pdx.rh.CN85.dnsmgr.net> From: Ed Maste Date: Thu, 24 Jan 2019 09:33:06 -0500 Message-ID: Subject: Re: svn commit: r343043 - head/crypto/openssh To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: D6D466D972 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.169 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-5.80 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-3.00)[ip: (-9.28), ipnet: 209.85.128.0/17(-3.72), asn: 15169(-1.91), country: US(-0.08)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.80)[-0.796,0]; RCVD_IN_DNSWL_NONE(0.00)[169.166.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 14:33:29 -0000 > > Log: > > scp: disallow empty or current directory > > > Can this be MFCed to 12, 11 and 10? r343096,r343097,r343098 for stable/12, stable/11, stable/10. It will get merged to release branches with the next batch of SA/ENs. From owner-svn-src-head@freebsd.org Thu Jan 24 16:40:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08BB314B4E1C; Thu, 24 Jan 2019 16:40:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A35A071BAB; Thu, 24 Jan 2019 16:40:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 974E02B117; Thu, 24 Jan 2019 16:40:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OGeEH4025557; Thu, 24 Jan 2019 16:40:14 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OGeEjL025556; Thu, 24 Jan 2019 16:40:14 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901241640.x0OGeEjL025556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 24 Jan 2019 16:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343401 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 343401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A35A071BAB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 16:40:15 -0000 Author: tuexen Date: Thu Jan 24 16:40:14 2019 New Revision: 343401 URL: https://svnweb.freebsd.org/changeset/base/343401 Log: Update a comment to reflect the current reality. SYN-cache entries live for abaut 12 seconds, not 45, when default setting are used. MFC after: 1 week Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Jan 24 14:33:15 2019 (r343400) +++ head/sys/netinet/tcp_syncache.c Thu Jan 24 16:40:14 2019 (r343401) @@ -154,7 +154,12 @@ static int syncookie_cmp(struct in_conninfo *inc, str /* * Transmit the SYN,ACK fewer times than TCP_MAXRXTSHIFT specifies. - * 3 retransmits corresponds to a timeout of 3 * (1 + 2 + 4 + 8) == 45 seconds, + * 3 retransmits corresponds to a timeout with default values of + * TCPTV_RTOBASE * ( 1 + + * tcp_syn_backoff[1] + + * tcp_syn_backoff[2] + + * tcp_syn_backoff[3]) + 3 * tcp_rexmit_slop, + * 3000 ms * (1 + 1 + 1 + 1) + 3 * 200 ms = 12300 ms, * the odds are that the user has given up attempting to connect by then. */ #define SYNCACHE_MAXREXMTS 3 From owner-svn-src-head@freebsd.org Thu Jan 24 16:43:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CEBB14B515C; Thu, 24 Jan 2019 16:43:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5AA87212A; Thu, 24 Jan 2019 16:43:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B85602B2B8; Thu, 24 Jan 2019 16:43:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OGhDZ4030424; Thu, 24 Jan 2019 16:43:13 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OGhDI9030423; Thu, 24 Jan 2019 16:43:13 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901241643.x0OGhDI9030423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 24 Jan 2019 16:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343402 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 343402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C5AA87212A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 16:43:14 -0000 Author: tuexen Date: Thu Jan 24 16:43:13 2019 New Revision: 343402 URL: https://svnweb.freebsd.org/changeset/base/343402 Log: Kill a trailing whitespace character... MFC after: 3 days Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Jan 24 16:40:14 2019 (r343401) +++ head/sys/netinet/tcp_syncache.c Thu Jan 24 16:43:13 2019 (r343402) @@ -156,7 +156,7 @@ static int syncookie_cmp(struct in_conninfo *inc, str * Transmit the SYN,ACK fewer times than TCP_MAXRXTSHIFT specifies. * 3 retransmits corresponds to a timeout with default values of * TCPTV_RTOBASE * ( 1 + - * tcp_syn_backoff[1] + + * tcp_syn_backoff[1] + * tcp_syn_backoff[2] + * tcp_syn_backoff[3]) + 3 * tcp_rexmit_slop, * 3000 ms * (1 + 1 + 1 + 1) + 3 * 200 ms = 12300 ms, From owner-svn-src-head@freebsd.org Thu Jan 24 16:47:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1E0E14B531D; Thu, 24 Jan 2019 16:47:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 688F472415; Thu, 24 Jan 2019 16:47:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BE962B2BF; Thu, 24 Jan 2019 16:47:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OGlJPM030790; Thu, 24 Jan 2019 16:47:19 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OGlJUY030789; Thu, 24 Jan 2019 16:47:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901241647.x0OGlJUY030789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 24 Jan 2019 16:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343403 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 343403 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 688F472415 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 16:47:19 -0000 Author: tuexen Date: Thu Jan 24 16:47:18 2019 New Revision: 343403 URL: https://svnweb.freebsd.org/changeset/base/343403 Log: Get the arithmetic right... MFC after: 3 days Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Jan 24 16:43:13 2019 (r343402) +++ head/sys/netinet/tcp_syncache.c Thu Jan 24 16:47:18 2019 (r343403) @@ -159,7 +159,7 @@ static int syncookie_cmp(struct in_conninfo *inc, str * tcp_syn_backoff[1] + * tcp_syn_backoff[2] + * tcp_syn_backoff[3]) + 3 * tcp_rexmit_slop, - * 3000 ms * (1 + 1 + 1 + 1) + 3 * 200 ms = 12300 ms, + * 3000 ms * (1 + 1 + 1 + 1) + 3 * 200 ms = 12600 ms, * the odds are that the user has given up attempting to connect by then. */ #define SYNCACHE_MAXREXMTS 3 From owner-svn-src-head@freebsd.org Thu Jan 24 17:02:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F60314B60EA; Thu, 24 Jan 2019 17:02:21 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A8F1732AD; Thu, 24 Jan 2019 17:02:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0OH2G9v084160; Thu, 24 Jan 2019 09:02:16 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0OH2GdN084159; Thu, 24 Jan 2019 09:02:16 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901241702.x0OH2GdN084159@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343391 - head/tools/tools/tinybsd In-Reply-To: <201901240634.x0O6YUIe013808@repo.freebsd.org> To: Oleksandr Tymoshenko Date: Thu, 24 Jan 2019 09:02:16 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 0A8F1732AD X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 17:02:21 -0000 > Author: gonzo > Date: Thu Jan 24 06:34:29 2019 > New Revision: 343391 > URL: https://svnweb.freebsd.org/changeset/base/343391 > > Log: > Fix prompt for MFSROOT in tinybsd > > tinybsd offers two choices when prompting user for MFSROOT: 'YES' > and 'NO'. Script logic only handles 'yes'. Change offered values > to lower case. Why not fix this so that [Yy][Ee][Ss] is accepted? > PR: 131059 > Submitted by: Brock Williams > MFC after: 1 week > > Modified: > head/tools/tools/tinybsd/tinybsd > > Modified: head/tools/tools/tinybsd/tinybsd > ============================================================================== > --- head/tools/tools/tinybsd/tinybsd Thu Jan 24 03:50:27 2019 (r343390) > +++ head/tools/tools/tinybsd/tinybsd Thu Jan 24 06:34:29 2019 (r343391) > @@ -206,7 +206,7 @@ loadconfig () { > break > fi > done > - MFSROOT=`confirm_action "$MFSROOT" "Use an MFSROOT? (YES/NO)"` > + MFSROOT=`confirm_action "$MFSROOT" "Use an MFSROOT? (yes/no)"` > IMG=`confirm_action "$IMG" "Image file to generate?"` > > # example of formatted value (NNN in this case) > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jan 24 18:13:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB0C414B8C2F; Thu, 24 Jan 2019 18:13:23 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A9E376F9F; Thu, 24 Jan 2019 18:13:23 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 707FB2C272; Thu, 24 Jan 2019 18:13:23 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OIDNkw079068; Thu, 24 Jan 2019 18:13:23 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OIDNUN079067; Thu, 24 Jan 2019 18:13:23 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201901241813.x0OIDNUN079067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Thu, 24 Jan 2019 18:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343406 - head/usr.bin/fortune/datfiles X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/usr.bin/fortune/datfiles X-SVN-Commit-Revision: 343406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7A9E376F9F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 18:13:24 -0000 Author: bcr (doc committer) Date: Thu Jan 24 18:13:23 2019 New Revision: 343406 URL: https://svnweb.freebsd.org/changeset/base/343406 Log: Add ZFS usage tips to freebsd-tips. Add a bunch of examples on how to use ZFS features like: - listing available space, - setting and displaying a userquota, - displaying pool I/O statistics and pool history, - displaying the compression ratio for a dataset, - various list options (sorting, removing headers), - performing a dry-run of a snapshot delete, - removing a range of snapshots, - setting a custom property, - preventing removal of a snapshot with ZFS holds, - permission sets for zfs send/receive. Additionally, clarify the existing examples a bit when it comes to displaying space by mentioning UFS explicitly. Other examples include displaying I/O in top(1), querying sysctl(8) for active CPUs and available RAM. Mention systat(1) and its options, too. While here, reformat the example to upload a dmesg(8) a bit to wrap properly. Thanks to Allan Jude for his help with some of the ZFS examples. Reviewed by: dru,allanjude Approved by: allanjude (earlier version) MFC after: 3 days Relnotes: yes (ZFS examples in freebsd-tips) Differential Revision: https://reviews.freebsd.org/D18541 Modified: head/usr.bin/fortune/datfiles/freebsd-tips Modified: head/usr.bin/fortune/datfiles/freebsd-tips ============================================================================== --- head/usr.bin/fortune/datfiles/freebsd-tips Thu Jan 24 17:55:33 2019 (r343405) +++ head/usr.bin/fortune/datfiles/freebsd-tips Thu Jan 24 18:13:23 2019 (r343406) @@ -270,12 +270,12 @@ To see how long it takes a command to run, type the wo command name. -- Dru % -To see how much disk space is left on your partitions, use +To see how much disk space is left on your UFS partitions, use df -h -- Dru % -To see the 10 largest files on a directory or partition, use +To see the 10 largest files on a directory or UFS partition, use du -h /partition_or_directory_name | sort -rh | head -- Dru @@ -554,9 +554,241 @@ Use "sysrc name=value" to add an entry and "sysrc -x n -- Lars Engels % -You can upload the dmesg of your system to help developers get an overview of commonly used hardware and peripherals for FreeBSD. -Use the curl package to upload it in one command: +You can upload the dmesg of your system to help developers get an overview of commonly +used hardware and peripherals for FreeBSD. Use the curl package to upload it like this: curl -v -d "nickname=$USER" -d "description=FreeBSD/$(uname -m) on \ $(kenv smbios.system.maker) $(kenv smbios.system.product)" -d "do=addd" \ --data-urlencode 'dmesg@/var/run/dmesg.boot' http://dmesgd.nycbug.org/index.cgi +% +Want to know how much memory (in bytes) your machine has available? Let +sysctl(8) tell you with the following command: + +sysctl hw.physmem + +The number of active CPUs is displayed using this command: + +sysctl hw.ncpu + + -- Benedict Reuschling +% +When using ZFS as the file system the "df" command will display confusing +values. Use the built-in "zfs list" command to get an overview of space usage: + +zfs list -o space + + -- Benedict Reuschling +% +To learn more about what your system is doing, take a look at systat(1). For +example, to get an overview of I/O happening in the system, run: + +systat -iostat + +Other values are icmp, icmp6, ifstat, ip, ip6, netstat, pigs, sctp, swap, tcp, +vmstat, or zarc. You can switch between displays using : and exit +back to your shell by typing + +:quit + + -- Benedict Reuschling +% +To set a quota of 10 GB for the user named foo on a ZFS dataset, run the +following command: + +# zfs set userquota@foo=10G pool/home/foo + +The zfs userspace command can display the quota and current space usage: + +# zfs userspace pool/home/foo + +To unset a quota, assign "none" as the value. + -- Benedict Reuschling +% +ZFS can display I/O statistics for a given pool using the iostat subcommand. +By default, it will display one line of current activity. To display stats +every 5 seconds run the following command (cancel with CTRL+C): + +zpool iostat 5 + +To view individual disk activities, specify the -v parameter: + +zpool iostat -v + +Of course, both can be combined. For more options, see zpool(8). + -- Benedict Reuschling +% +FreeBSD's top(1) utility displays CPU statistics by default. +To display I/O activity for each process instead, run top like this: + +top -m io + + -- Benedict Reuschling +% +ZFS keeps a history of commands run against a specific pool using the +history subcommand to zpool: + +zpool history + +More details are available using the -i and -l parameters. Note that ZFS +will not keep the complete pool history forever and will remove older +events in favor of never ones. + -- Benedict Reuschling +% +To display the compression ratio for the ZFS dataset /var/log on the pool +mypool, run the following command: + +zfs get refcompressratio mypool/var/log + +The refcompressratio will only display the compression ratio for that specific +dataset, not the descendant datasets. To include the child datasets, the +command looks like this: + +zfs get compressratio mypool/var + + -- Benedict Reuschling +% +You can limit the depth of the displayed datasets in the "zfs list" output +using the -d parameter. To display only the first level of datasets below +mypool/usr and not the ones deeper than those, run this command: + +zfs list -d 1 mypool/usr + + -- Benedict Reuschling +% +The "zfs list" command can be filtered in multiple ways. To display just +the dataset name, use the -o parameter: + +zfs list -o name mypool/usr + +More columns and their order can be defined by separating them with commas: + +zfs list -o mountpoint,name,avail + + -- Benedict Reuschling +% +The output of "zfs list" can be sorted by a specific column using -s. To +sort the datasets by the "used" column in ascending order, run this command: + +zfs list -s used + +To sort in descending order instead, use -S: + +zfs list -S used + + -- Benedict Reuschling +% +To make the "zfs list" output more script-friendly, you can suppress the +output of the headers for each column by passing the -H parameter: + +zfs list -H + +Another helpful option for script writers is -p, which displays the numbers +in non-rounded, exact values: + +zfs list -p + + -- Benedict Reuschling +% +Before deleting a dataset or snapshot, perform a dry run using the -n +parameter. This is to make sure you really want to delete just that +dataset/snapshot and not any dependent ones. ZFS will display the resulting +action when -n is combined with the -v option without actually performing +it: + +zfs destroy -rvn mypool@mysnap + +Once you are sure this is exactly what you intend to do, remove the -n +parameter to execute the destroy operation. + -- Benedict Reuschling +% +You can delete a range of ZFS snapshots (a-z) in multiple ways. +The following will delete d and all earlier snapshots: + +zfs destroy mypool/data@%d + +To delete d and all later snapshots: + +zfs destroy mypool/data@d% + +To delete all dataset snapshots: + +zfs destroy mypool/data@% + +Make sure to let ZFS perform a dry run (-n option) first and display (-v) what +it would do to confirm that the delete operation is removing exactly what you +intended. + -- Benedict Reuschling +% +To set a custom ZFS property on the mypool pool, you need to provide it +using the "key1:key2=value" syntax, where the colon (:) is used as the +separator and identifier from the built-in ZFS properties: + +# zfs set warranty:expires=2038-01-19 mypool + +The custom property is applied to all datasets and can be queried like any +built-in properties using zfs get: + +zfs get warranty:expires mypool + +To reset the value of a custom property, use the inherit subcommand: + +# zfs inherit warranty:expires mypool + +Removing a custom property from a pool is done using the -r flag to the +"zfs inherit" command: + +# zfs inherit -r warranty:expires mypool + + -- Benedict Reuschling +% +To delete a range of ZFS snapshots, use the % (percent) character after the +full path to the first snapshot that should be included. For example, to +simulate deleting snapshots a through (including) d, use this command: + +# zfs destroy -rvn mypool/tmp@a%d + +Once you are sure that this is what you want, remove the -n option: + +# zfs destroy -rv mypool/tmp@a%d + + -- Benedict Reuschling +% +You can prevent the removal of a ZFS snapshot by using the hold subcommand. +For example, to prevent the snapshot called milestone from deletion, run the +following command: + +# zfs hold milestone_hold mypool/projects@my_milestone + +The "zfs holds" command will list all current snapshots that are protected +this way (-r for a recursive list): + +# zfs holds -r mypool + +The TIMESTAMP column in the output of the above command is from when the +hold was created, not the snapshot it holds. The "zfs destroy" command will +echo a "dataset is busy" message on the console when it encounters a hold. +Use "zfs release" to release the hold on the snapshot: + +# zfs release milestone_hold mypool/projects@my_milestone + + -- Benedict Reuschling +% +A user "sender" needs the following permissions set to send a ZFS dataset: + +# zfs allow -u sender send,snapshot txpool + +On the receiving side, the user "receiver" requires these permissions: + +# zfs allow -u receiver compression,mountpoint,mount,create,receive rxpool + + -- Benedict Reuschling +% +Don't let your zpool fill up completely by creating a dataset with +reservation. + +# zfs create -o refreservation=<5% of total pool space> /reserved + +You can always shrink the reserve if you need the space, but your pool will +always have space left this way. + + -- Benedict Reuschling % From owner-svn-src-head@freebsd.org Thu Jan 24 18:26:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75AF814B9323; Thu, 24 Jan 2019 18:26:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C9EE7787C; Thu, 24 Jan 2019 18:26:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10F9E2C434; Thu, 24 Jan 2019 18:26:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OIQUJk084198; Thu, 24 Jan 2019 18:26:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OIQUUk084197; Thu, 24 Jan 2019 18:26:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901241826.x0OIQUUk084197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 24 Jan 2019 18:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343407 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1C9EE7787C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 18:26:31 -0000 Author: emaste Date: Thu Jan 24 18:26:30 2019 New Revision: 343407 URL: https://svnweb.freebsd.org/changeset/base/343407 Log: freebsd-update: open $PAGER only if necessary PR: 194547, 208497 Submitted by: Gerald Aryeetey Reviewed by: delphij MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:13:23 2019 (r343406) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:26:30 2019 (r343407) @@ -1949,13 +1949,11 @@ fetch_create_manifest () { # Report to the user if any updates were avoided due to local changes if [ -s modifiedfiles ]; then - echo - echo -n "The following files are affected by updates, " - echo "but no changes have" - echo -n "been downloaded because the files have been " - echo "modified locally:" - cat modifiedfiles - fi | $PAGER + cat - modifiedfiles <<- EOF | ${PAGER} + The folling files are affected by updates but no changes have + been downloaded because the files have been modified locally: + EOF + fi rm modifiedfiles # If no files will be updated, tell the user and exit @@ -1981,30 +1979,29 @@ fetch_create_manifest () { # Report removed files, if any if [ -s files.removed ]; then - echo - echo -n "The following files will be removed " - echo "as part of updating to ${RELNUM}-p${RELPATCHNUM}:" - cat files.removed - fi | $PAGER + cat - files.removed <<- EOF | ${PAGER} + The following files will be removed as part of updating to + ${RELNUM}-p${RELPATCHNUM}: + EOF + fi rm files.removed # Report added files, if any if [ -s files.added ]; then - echo - echo -n "The following files will be added " - echo "as part of updating to ${RELNUM}-p${RELPATCHNUM}:" - cat files.added - fi | $PAGER + cat - files.added <<- EOF | ${PAGER} + The following files will be added as part of updating to + ${RELNUM}-p${RELPATCHNUM}: + EOF + fi rm files.added # Report updated files, if any if [ -s files.updated ]; then - echo - echo -n "The following files will be updated " - echo "as part of updating to ${RELNUM}-p${RELPATCHNUM}:" - - cat files.updated - fi | $PAGER + cat - files.updated <<- EOF | ${PAGER} + The following files will be updated as part of updating to + ${RELNUM}-p${RELPATCHNUM}: + EOF + fi rm files.updated # Create a directory for the install manifest. From owner-svn-src-head@freebsd.org Thu Jan 24 18:39:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D31714B97CC; Thu, 24 Jan 2019 18:39:46 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6A1377FC4; Thu, 24 Jan 2019 18:39:45 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA7262C5EC; Thu, 24 Jan 2019 18:39:45 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OIdjjt089422; Thu, 24 Jan 2019 18:39:45 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OIdjIH089421; Thu, 24 Jan 2019 18:39:45 GMT (envelope-from se@FreeBSD.org) Message-Id: <201901241839.x0OIdjIH089421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Thu, 24 Jan 2019 18:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343408 - head/usr.bin/whereis X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/usr.bin/whereis X-SVN-Commit-Revision: 343408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D6A1377FC4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 18:39:46 -0000 Author: se Date: Thu Jan 24 18:39:45 2019 New Revision: 343408 URL: https://svnweb.freebsd.org/changeset/base/343408 Log: Silence Clang Scan warnings regarding the use of strcp(). While these warnings are false positives, the use of strdup() instead of malloc() and strcpy() simplifies and clarifies the code. While checking the remaining uses of strcpy and strcat I noticed an assignment of a strlen() to a variable "s", whose value needs to be preserved for use in later output routines (where it is used to allocate a buffer). I do not think that the value of "s" will come out lower than its correct value and thus there is no risk of a buffer overflow, in the general case, but a specially crafter argument might lead to an overflow. The bogus assignment to "s" is removed since this value was only used a single time in the following malloc() call, which has been removed. MFC after: 2 weeks Modified: head/usr.bin/whereis/whereis.c Modified: head/usr.bin/whereis/whereis.c ============================================================================== --- head/usr.bin/whereis/whereis.c Thu Jan 24 18:26:30 2019 (r343407) +++ head/usr.bin/whereis/whereis.c Thu Jan 24 18:39:45 2019 (r343408) @@ -285,9 +285,9 @@ defaults(void) bindirs[nele] = NULL; if ((cp = getenv("PATH")) != NULL) { /* don't destroy the original environment... */ - if ((b = malloc(strlen(cp) + 1)) == NULL) + b = strdup(cp); + if (b == NULL) abort(); - strcpy(b, cp); decolonify(b, &bindirs, &nele); } } @@ -301,18 +301,18 @@ defaults(void) err(EX_OSERR, "error processing manpath results"); if ((b = strchr(buf, '\n')) != NULL) *b = '\0'; - if ((b = malloc(strlen(buf) + 1)) == NULL) + b = strdup(buf); + if (b == NULL) abort(); - strcpy(b, buf); nele = 0; decolonify(b, &mandirs, &nele); } /* -s defaults to precompiled list, plus subdirs of /usr/ports */ if (!sourcedirs) { - if ((b = malloc(strlen(sourcepath) + 1)) == NULL) + b = strdup(sourcepath); + if (b == NULL) abort(); - strcpy(b, sourcepath); nele = 0; decolonify(b, &sourcedirs, &nele); @@ -523,11 +523,9 @@ main(int argc, char **argv) * man -w found plain source * page, use it. */ - s = strlen(buf); - cp2 = malloc(s + 1); + cp2 = strdup(buf); if (cp2 == NULL) abort(); - strcpy(cp2, buf); } if (man == NULL) { From owner-svn-src-head@freebsd.org Thu Jan 24 18:41:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6117614B9A2E; Thu, 24 Jan 2019 18:41:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0925D8027D; Thu, 24 Jan 2019 18:41:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F292B2C612; Thu, 24 Jan 2019 18:41:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OIf0tm090352; Thu, 24 Jan 2019 18:41:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OIf07Y090351; Thu, 24 Jan 2019 18:41:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901241841.x0OIf07Y090351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 24 Jan 2019 18:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343409 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0925D8027D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 18:41:01 -0000 Author: emaste Date: Thu Jan 24 18:41:00 2019 New Revision: 343409 URL: https://svnweb.freebsd.org/changeset/base/343409 Log: freebsd-update: Stop installing empty component sets Submitted by: Gerald Aryeetey Reported by: rgrimes Reviewed by: delphij MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18927 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:39:45 2019 (r343408) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:41:00 2019 (r343409) @@ -2195,7 +2195,7 @@ upgrade_guess_components () { sort -k 2,2 -t ' ' > compfreq.present join -t ' ' -1 2 -2 2 compfreq.present compfreq.total | while read S P T; do - if [ ${P} -gt `expr ${T} / 2` ]; then + if [ ${T} -ne 0 -a ${P} -gt `expr ${T} / 2` ]; then echo ${S} fi done > comp.present From owner-svn-src-head@freebsd.org Thu Jan 24 18:44:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3DDD14B9D06; Thu, 24 Jan 2019 18:44:02 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87982807FE; Thu, 24 Jan 2019 18:44:02 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f48.google.com with SMTP id m19so5621751ioh.3; Thu, 24 Jan 2019 10:44:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=6JjcNvvA2V9li2u3lFmLWwb26S5TFmK6w/Awre9A3eg=; b=XVRBjznhktwA/ZGmV8ycPwJByN7JHu5UxLbzy6ZqRVMaBguctp1m3KcreqHPUmqM/2 u3pvzjK5W3Abo0NNdGONmpa9cK7l1oXCKqUin9967SXWReVu3VVkzFoH/AWlkRL44D0C yWtOSy6ufiPwYbgBMe91Q5qDulWD7sL9OFkiP5AKQE0g51vT729Pw16uzU+Q7DooFrFx s0e2H4l5aDL97i78fUFfwilhmE7VB+zG2sudSbYSn7i5DKD08y3AvSbx9OWibIOBzR6r TnU8oJrPXfhV1EsJZLRg1kSinpZDtjHAo5sqvFW1BTAQq4WUzVpW/FYzPPVcvGt/PaM8 PVWg== X-Gm-Message-State: AHQUAuam6uzhEiX3omULhyD1iTOATxqKqBgexqR1usNn8VtWP92G8DKi 8zIQvO8dzLSEbaFbLJJ835ifz3+YOghhWvKbgOi5mw== X-Google-Smtp-Source: ALg8bN7IRK9GqDDny0ZMsCddclpR8DXC5L41zipHm4phf5Yd+fePLN2Xbuh5KHw1YdD0E+dcy9e4ieBdyob794lGUxk= X-Received: by 2002:a5d:88ce:: with SMTP id i14mr5228351iol.66.1548355435576; Thu, 24 Jan 2019 10:43:55 -0800 (PST) MIME-Version: 1.0 References: <201901241841.x0OIf07Y090351@repo.freebsd.org> In-Reply-To: <201901241841.x0OIf07Y090351@repo.freebsd.org> From: Ed Maste Date: Thu, 24 Jan 2019 13:43:42 -0500 Message-ID: Subject: Re: svn commit: r343409 - head/usr.sbin/freebsd-update To: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 87982807FE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.937,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 18:44:03 -0000 On Thu, 24 Jan 2019 at 13:41, Ed Maste wrote: > > Author: emaste > Date: Thu Jan 24 18:41:00 2019 > New Revision: 343409 > URL: https://svnweb.freebsd.org/changeset/base/343409 > > Log: > freebsd-update: Stop installing empty component sets > ... > Reviewed by: delphij Oops, error in the commit message; delphij did not review this one of the set of freebsd-update patches. From owner-svn-src-head@freebsd.org Thu Jan 24 18:48:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A014B14B9F05; Thu, 24 Jan 2019 18:48:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4364080A2B; Thu, 24 Jan 2019 18:48:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3137D2C7B2; Thu, 24 Jan 2019 18:48:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OImGOm094607; Thu, 24 Jan 2019 18:48:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OImG3N094606; Thu, 24 Jan 2019 18:48:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901241848.x0OImG3N094606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 24 Jan 2019 18:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343410 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4364080A2B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 18:48:16 -0000 Author: emaste Date: Thu Jan 24 18:48:15 2019 New Revision: 343410 URL: https://svnweb.freebsd.org/changeset/base/343410 Log: freebsd-update: fix style from r343271 change PR: 234771 Submitted by: Gerald Aryeetey MFC with: r343271 Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:41:00 2019 (r343409) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:48:15 2019 (r343410) @@ -670,20 +670,20 @@ fetchupgrade_check_params () { # Disallow upgrade from a version that is not a release case ${RELNUM} in - *-RELEASE | *-ALPHA* | *-BETA* | *-RC*) - ;; - *) - echo -n "`basename $0`: " - cat <<- EOF - Cannot upgrade from a version that is not a release - (including alpha, beta and release candidates) - using `basename $0`. Instead, FreeBSD can be directly - upgraded by source or upgraded to a RELEASE/RELENG version - prior to running `basename $0`. - Currently running: ${RELNUM} - EOF - exit 1 - ;; + *-RELEASE | *-ALPHA* | *-BETA* | *-RC*) + ;; + *) + echo -n "`basename $0`: " + cat <<- EOF + Cannot upgrade from a version that is not a release + (including alpha, beta and release candidates) + using `basename $0`. Instead, FreeBSD can be directly + upgraded by source or upgraded to a RELEASE/RELENG version + prior to running `basename $0`. + Currently running: ${RELNUM} + EOF + exit 1 + ;; esac # Figure out what directory contains the running kernel From owner-svn-src-head@freebsd.org Thu Jan 24 18:51:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46F5814BA051; Thu, 24 Jan 2019 18:51:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD67E80DEA; Thu, 24 Jan 2019 18:51:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8F5F2C7EA; Thu, 24 Jan 2019 18:51:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OIpFRq096330; Thu, 24 Jan 2019 18:51:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OIpFGs096329; Thu, 24 Jan 2019 18:51:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901241851.x0OIpFGs096329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 24 Jan 2019 18:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343411 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD67E80DEA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 18:51:16 -0000 Author: emaste Date: Thu Jan 24 18:51:15 2019 New Revision: 343411 URL: https://svnweb.freebsd.org/changeset/base/343411 Log: freebsd-update: Clarify unsupported upgrade message PR: 204115 Submitted by: Gerald Aryeetey Reviewed by: delphij MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18916 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:48:15 2019 (r343410) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:51:15 2019 (r343411) @@ -1022,7 +1022,16 @@ fetch_pick_server () { # Have we run out of mirrors? if [ `wc -l < serverlist` -eq 0 ]; then - echo "No mirrors remaining, giving up." + cat <<- EOF + No mirrors remaining, giving up. + + This may be because upgrading from this platform (${ARCH}) + or release (${RELNUM}) is unsupported by `basename $0`. Only + platforms with Tier 1 support can be upgraded by `basename $0`. + See https://www.freebsd.org/platforms/index.html for more info. + + If unsupported, FreeBSD must be upgraded by source. + EOF return 1 fi From owner-svn-src-head@freebsd.org Thu Jan 24 19:41:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCA5714BBE0C; Thu, 24 Jan 2019 19:41:06 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51DB083306; Thu, 24 Jan 2019 19:41:05 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0OJeuup084583; Thu, 24 Jan 2019 11:40:56 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0OJetvf084582; Thu, 24 Jan 2019 11:40:55 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901241940.x0OJetvf084582@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343043 - head/crypto/openssh In-Reply-To: To: Ed Maste Date: Thu, 24 Jan 2019 11:40:55 -0800 (PST) CC: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 51DB083306 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 19:41:07 -0000 [ Charset UTF-8 unsupported, converting... ] > > > Log: > > > scp: disallow empty or current directory > > > > > Can this be MFCed to 12, 11 and 10? > > r343096,r343097,r343098 for stable/12, stable/11, stable/10. It will > get merged to release branches with the next batch of SA/ENs. Thank you! -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jan 24 20:08:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5915914BC95C; Thu, 24 Jan 2019 20:08:48 +0000 (UTC) (envelope-from gonzo@freebsd.org) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB2648475A; Thu, 24 Jan 2019 20:08:47 +0000 (UTC) (envelope-from gonzo@freebsd.org) Received: from localhost ([127.0.0.1] helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1 (FreeBSD)) (envelope-from ) id 1gmlIk-000P68-E3; Thu, 24 Jan 2019 12:08:39 -0800 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id x0OK8bMg096479; Thu, 24 Jan 2019 12:08:37 -0800 (PST) (envelope-from gonzo@freebsd.org) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@freebsd.org using -f Date: Thu, 24 Jan 2019 12:08:37 -0800 From: Oleksandr Tymoshenko To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343391 - head/tools/tools/tinybsd Message-ID: <20190124200837.GA96390@bluezbox.com> References: <201901240634.x0O6YUIe013808@repo.freebsd.org> <201901241702.x0OH2GdN084159@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201901241702.x0OH2GdN084159@pdx.rh.CN85.dnsmgr.net> X-Operating-System: FreeBSD/11.1-RELEASE-p4 (amd64) User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Rodney W. Grimes (freebsd@pdx.rh.CN85.dnsmgr.net) wrote: > > Author: gonzo > > Date: Thu Jan 24 06:34:29 2019 > > New Revision: 343391 > > URL: https://svnweb.freebsd.org/changeset/base/343391 > > > > [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Rspamd-Queue-Id: EB2648475A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 20:08:48 -0000 Rodney W. Grimes (freebsd@pdx.rh.CN85.dnsmgr.net) wrote: > > Author: gonzo > > Date: Thu Jan 24 06:34:29 2019 > > New Revision: 343391 > > URL: https://svnweb.freebsd.org/changeset/base/343391 > > > > Log: > > Fix prompt for MFSROOT in tinybsd > > > > tinybsd offers two choices when prompting user for MFSROOT: 'YES' > > and 'NO'. Script logic only handles 'yes'. Change offered values > > to lower case. > > Why not fix this so that [Yy][Ee][Ss] is accepted? I thought about it but actual end-to-end verification of such fix would require going through whole build (and learning how tinybsd script works). It's a bit more effort than I would like to spend on the tool I don't work with and with the number of users I don't know of. The committed patch was readily available, easily verifiable and a step forward, a tiny one but nevertheless. If anybody wants to implement proper fix - feel free to reopen PR and take over it. -- gonzo From owner-svn-src-head@freebsd.org Thu Jan 24 20:35:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84A2214BDA43; Thu, 24 Jan 2019 20:35:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C0E385CF9; Thu, 24 Jan 2019 20:35:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FF2B2DAA9; Thu, 24 Jan 2019 20:35:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OKZx6N052620; Thu, 24 Jan 2019 20:35:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OKZwxX052619; Thu, 24 Jan 2019 20:35:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201901242035.x0OKZwxX052619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Thu, 24 Jan 2019 20:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343412 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 343412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C0E385CF9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 20:35:59 -0000 Author: ngie Date: Thu Jan 24 20:35:58 2019 New Revision: 343412 URL: https://svnweb.freebsd.org/changeset/base/343412 Log: Fix a typo/wordsmith a description modified in r343407 r343407 accidentally introduced a typo (folling -> following). While reading the change out loud, I realized that the original sentence was wordy. almost sounding like a run-on sentence. Improve the flow by splitting up the two thoughts into two distinct sentence fragments. PR: 194547, 208497 Reviewed by: emaste Approved by: emaste (mentor) MFC after: 1 month MFC with: r343407 Differential Revision: https://reviews.freebsd.org/D18947 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:51:15 2019 (r343411) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 20:35:58 2019 (r343412) @@ -1959,8 +1959,9 @@ fetch_create_manifest () { # Report to the user if any updates were avoided due to local changes if [ -s modifiedfiles ]; then cat - modifiedfiles <<- EOF | ${PAGER} - The folling files are affected by updates but no changes have - been downloaded because the files have been modified locally: + The following files are affected by updates. No changes have + been downloaded, however, because the files have been modified + locally: EOF fi rm modifiedfiles From owner-svn-src-head@freebsd.org Thu Jan 24 20:38:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 560BA14BDBEB; Thu, 24 Jan 2019 20:38:45 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5A4385F8B; Thu, 24 Jan 2019 20:38:44 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0OKcgoq084811; Thu, 24 Jan 2019 12:38:42 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0OKcgLH084810; Thu, 24 Jan 2019 12:38:42 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901242038.x0OKcgLH084810@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343409 - head/usr.sbin/freebsd-update In-Reply-To: <201901241841.x0OIf07Y090351@repo.freebsd.org> To: Ed Maste Date: Thu, 24 Jan 2019 12:38:42 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: C5A4385F8B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 20:38:45 -0000 > Author: emaste > Date: Thu Jan 24 18:41:00 2019 > New Revision: 343409 > URL: https://svnweb.freebsd.org/changeset/base/343409 > > Log: > freebsd-update: Stop installing empty component sets Thank you! > Submitted by: Gerald Aryeetey > Reported by: rgrimes > Reviewed by: delphij > MFC after: 1 month > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D18927 > > Modified: > head/usr.sbin/freebsd-update/freebsd-update.sh > > Modified: head/usr.sbin/freebsd-update/freebsd-update.sh > ============================================================================== > --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:39:45 2019 (r343408) > +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Jan 24 18:41:00 2019 (r343409) > @@ -2195,7 +2195,7 @@ upgrade_guess_components () { > sort -k 2,2 -t ' ' > compfreq.present > join -t ' ' -1 2 -2 2 compfreq.present compfreq.total | > while read S P T; do > - if [ ${P} -gt `expr ${T} / 2` ]; then > + if [ ${T} -ne 0 -a ${P} -gt `expr ${T} / 2` ]; then > echo ${S} > fi > done > comp.present > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Jan 24 22:09:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EADA014C0723; Thu, 24 Jan 2019 22:09:26 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D08989952; Thu, 24 Jan 2019 22:09:26 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 797482EA63; Thu, 24 Jan 2019 22:09:26 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0OM9Qop000206; Thu, 24 Jan 2019 22:09:26 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0OM9QDV000205; Thu, 24 Jan 2019 22:09:26 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201901242209.x0OM9QDV000205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Thu, 24 Jan 2019 22:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343413 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 343413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8D08989952 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 22:09:27 -0000 Author: vmaffione Date: Thu Jan 24 22:09:26 2019 New Revision: 343413 URL: https://svnweb.freebsd.org/changeset/base/343413 Log: netmap: fix crash with monitors and VALE ports Crash report described here: https://github.com/luigirizzo/netmap/issues/583 Fixed by providing dummy sync callback in case it is missing. Modified: head/sys/dev/netmap/netmap_monitor.c Modified: head/sys/dev/netmap/netmap_monitor.c ============================================================================== --- head/sys/dev/netmap/netmap_monitor.c Thu Jan 24 20:35:58 2019 (r343412) +++ head/sys/dev/netmap/netmap_monitor.c Thu Jan 24 22:09:26 2019 (r343413) @@ -259,11 +259,20 @@ static int netmap_monitor_parent_txsync(struct netmap_ static int netmap_monitor_parent_rxsync(struct netmap_kring *, int); static int netmap_monitor_parent_notify(struct netmap_kring *, int); +static int +nm_monitor_dummycb(struct netmap_kring *kring, int flags) +{ + (void)kring; + (void)flags; + return 0; +} + static void nm_monitor_intercept_callbacks(struct netmap_kring *kring) { ND("intercept callbacks on %s", kring->name); - kring->mon_sync = kring->nm_sync; + kring->mon_sync = kring->nm_sync != NULL ? + kring->nm_sync : nm_monitor_dummycb; kring->mon_notify = kring->nm_notify; if (kring->tx == NR_TX) { kring->nm_sync = netmap_monitor_parent_txsync; From owner-svn-src-head@freebsd.org Thu Jan 24 23:34:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8116614C2D65; Thu, 24 Jan 2019 23:34:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27F3A8CEBF; Thu, 24 Jan 2019 23:34:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E44A2FA3B; Thu, 24 Jan 2019 23:34:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0ONYpWk047051; Thu, 24 Jan 2019 23:34:51 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0ONYpNU047048; Thu, 24 Jan 2019 23:34:51 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201901242334.x0ONYpNU047048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 24 Jan 2019 23:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343416 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 343416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 27F3A8CEBF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 23:34:52 -0000 Author: trasz Date: Thu Jan 24 23:34:51 2019 New Revision: 343416 URL: https://svnweb.freebsd.org/changeset/base/343416 Log: Install .shrc for root, and set PS1 for the toor account. Reviewed by: jilles MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18872 Added: head/bin/sh/dot.shrc - copied unchanged from r343399, head/share/skel/dot.shrc Modified: head/bin/sh/Makefile head/bin/sh/dot.profile Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Thu Jan 24 22:34:30 2019 (r343415) +++ head/bin/sh/Makefile Thu Jan 24 23:34:51 2019 (r343416) @@ -3,9 +3,12 @@ .include -CONFS= dot.profile profile -CONFSDIR_dot.profile= /root -CONFSNAME_dot.profile= .profile +CONFGROUPS= ETC ROOT +ETC= profile +ROOT= dot.shrc dot.profile +ROOTDIR= /root +ROOTNAME_dot.shrc= .shrc +ROOTNAME_dot.profile= .profile PACKAGE=runtime PROG= sh INSTALLFLAGS= -S Modified: head/bin/sh/dot.profile ============================================================================== --- head/bin/sh/dot.profile Thu Jan 24 22:34:30 2019 (r343415) +++ head/bin/sh/dot.profile Thu Jan 24 23:34:51 2019 (r343416) @@ -9,6 +9,9 @@ export TERM PAGER=less export PAGER +# set ENV to a file invoked each time sh is started for interactive use. +ENV=$HOME/.shrc; export ENV + # Query terminal size; useful for serial lines. if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi Copied: head/bin/sh/dot.shrc (from r343399, head/share/skel/dot.shrc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/dot.shrc Thu Jan 24 23:34:51 2019 (r343416, copy of r343399, head/share/skel/dot.shrc) @@ -0,0 +1,39 @@ +# $FreeBSD$ +# +# .shrc - bourne shell startup file +# +# This file will be used if the shell is invoked for interactive use and +# the environment variable ENV is set to this file. +# +# see also sh(1), environ(7). +# + + +# file permissions: rwxr-xr-x +# +# umask 022 + +# Uncomment this to enable the builtin vi(1) command line editor in sh(1), +# e.g. ESC to go into visual mode. +# set -o vi + + +# some useful aliases +alias h='fc -l' +alias j=jobs +alias m="$PAGER" +alias ll='ls -laFo' +alias l='ls -l' +alias g='egrep -i' + +# # be paranoid +# alias cp='cp -ip' +# alias mv='mv -i' +# alias rm='rm -i' + + +# set prompt: ``username@hostname:directory $ '' +PS1="\u@\h:\w \\$ " + +# search path for cd(1) +# CDPATH=:$HOME From owner-svn-src-head@freebsd.org Thu Jan 24 23:55:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD71914C356E; Thu, 24 Jan 2019 23:55:08 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF6608DA45; Thu, 24 Jan 2019 23:55:07 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0ONt46H085461; Thu, 24 Jan 2019 15:55:04 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0ONt4Xl085460; Thu, 24 Jan 2019 15:55:04 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901242355.x0ONt4Xl085460@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343416 - head/bin/sh In-Reply-To: <201901242334.x0ONYpNU047048@repo.freebsd.org> To: Edward Tomasz Napierala Date: Thu, 24 Jan 2019 15:55:04 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: EF6608DA45 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.962,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2019 23:55:09 -0000 > Author: trasz > Date: Thu Jan 24 23:34:51 2019 > New Revision: 343416 > URL: https://svnweb.freebsd.org/changeset/base/343416 > > Log: > Install .shrc for root, and set PS1 for the toor account. And a dozen other aliases :-( Please do not contaiminate the prestine environment with personal preferences. In the start of the project we did a great deal of work to remove and eliminate these types of things, only the few csh aliases where retained. This is really the domain of a systems administrator to decide and making work for them to clean this out is not going to make them happy. The commands in an ENV file well be executed by every single shell that is started, not just an interactive shell, unless I am mis reading the man page: If the environment variable ENV is set on entry to a shell, or is set in the .profile of a login shell, the shell then subjects its value to parameter expansion and arithmetic expansion and reads commands from the named file. > Reviewed by: jilles > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D18872 > > Added: > head/bin/sh/dot.shrc > - copied unchanged from r343399, head/share/skel/dot.shrc > Modified: > head/bin/sh/Makefile > head/bin/sh/dot.profile > > Modified: head/bin/sh/Makefile > ============================================================================== > --- head/bin/sh/Makefile Thu Jan 24 22:34:30 2019 (r343415) > +++ head/bin/sh/Makefile Thu Jan 24 23:34:51 2019 (r343416) > @@ -3,9 +3,12 @@ > > .include > > -CONFS= dot.profile profile > -CONFSDIR_dot.profile= /root > -CONFSNAME_dot.profile= .profile > +CONFGROUPS= ETC ROOT > +ETC= profile > +ROOT= dot.shrc dot.profile > +ROOTDIR= /root > +ROOTNAME_dot.shrc= .shrc > +ROOTNAME_dot.profile= .profile > PACKAGE=runtime > PROG= sh > INSTALLFLAGS= -S > > Modified: head/bin/sh/dot.profile > ============================================================================== > --- head/bin/sh/dot.profile Thu Jan 24 22:34:30 2019 (r343415) > +++ head/bin/sh/dot.profile Thu Jan 24 23:34:51 2019 (r343416) > @@ -9,6 +9,9 @@ export TERM > PAGER=less > export PAGER > > +# set ENV to a file invoked each time sh is started for interactive use. > +ENV=$HOME/.shrc; export ENV > + > # Query terminal size; useful for serial lines. > if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi > > > Copied: head/bin/sh/dot.shrc (from r343399, head/share/skel/dot.shrc) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/bin/sh/dot.shrc Thu Jan 24 23:34:51 2019 (r343416, copy of r343399, head/share/skel/dot.shrc) > @@ -0,0 +1,39 @@ > +# $FreeBSD$ > +# > +# .shrc - bourne shell startup file > +# > +# This file will be used if the shell is invoked for interactive use and > +# the environment variable ENV is set to this file. > +# > +# see also sh(1), environ(7). > +# > + > + > +# file permissions: rwxr-xr-x > +# > +# umask 022 > + > +# Uncomment this to enable the builtin vi(1) command line editor in sh(1), > +# e.g. ESC to go into visual mode. > +# set -o vi > + > + > +# some useful aliases > +alias h='fc -l' > +alias j=jobs > +alias m="$PAGER" > +alias ll='ls -laFo' > +alias l='ls -l' > +alias g='egrep -i' > + > +# # be paranoid > +# alias cp='cp -ip' > +# alias mv='mv -i' > +# alias rm='rm -i' > + > + > +# set prompt: ``username@hostname:directory $ '' > +PS1="\u@\h:\w \\$ " > + > +# search path for cd(1) > +# CDPATH=:$HOME > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 25 00:15:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19E8014C4312 for ; Fri, 25 Jan 2019 00:15:59 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48F528E95E for ; Fri, 25 Jan 2019 00:15:58 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1548374384; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=IhU5Z7fq9XDu4QVLiFZbHY36lbfZuuAZTeS6JR4fpl2YwRQm8w1vwt/gmeVE6OaskIGxLPWuM9LvP IRKiBpFHDOvJht6kA7+k0XSss1OqR/1nUK2ZgTa8/RmSAa4kczLrFaNAzNjYzAlmwa1cEOjFUMhdxf esbmvF8//ItEqG25qzpH1IDvJbPmOzIHmwVoQ6gDLkEMlyeYAO0pQORIIPR2YpBWj5y68KWWhF8ePx xvF9y2tCE2LoNwvhdcF4iTI70TrTZusIvfsGT2tEd978D5I0iFZnOVj0GWbKjFUK5GOyYITmpOuyGj F4qWwmyKlUu1zBILRu+YEMuyHBJXycA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=VBFwOtucCkSCwRaGe8DxOZwVSejGaKoaMeVpX2Dq3m4=; b=EfVDbKcC0ihqeLUvT8+/jgJ0A+Ns5VoHbHqpEnLU11AAN7dnPQH+CAkCGnfyLk9EUE5RTjiXCYoI4 DTskXGLx+7Vd0rormBX2KrySC/nx/hrrqlX+pLacG80m5V8EUzcx6dl7IQmQJN57KTuErBW3m73ca4 mUYLiDXa6oCHh+yxiuEGNwKX1IyEMrUtSslIgwc44i91V2gARkm93dEVE9bg9qyT5GV01B2plKf7br vxe9KDdu4tyFvuJvSt5oSncbi5RPc+TWMTyn23hFX54WAEdwzSgnC7f7V3lbaRtbkupx5PCTQvv9tQ 08wDLw/jNncLqB2+vDkmaXJ1sn9ezPw== ARC-Authentication-Results: i=1; outbound3.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=VBFwOtucCkSCwRaGe8DxOZwVSejGaKoaMeVpX2Dq3m4=; b=C3MhRy057dkba0dUJa8gRUR5ubjzmte8k0N3OnRuvIVmQFQyQjII+JStmpqZfs05M6ff2u91c5IRm qoWFolo8oPAcZs1otwKOTwARUf+CJy4uQ3Fufn2e0IGs7UWPq5yeEuKMnvyZfu1Tvb4CkkQAj+CLGk u+jNDnZC/UWGNifzuQ7l+Bhz73+VFcg0/WYpsEkx8enI2pdi5YLZb/zDpLhbn9l7D36tpoN+l6/o3j 2PCGJqD+f8fZHSKet6c/lbBcMrAqu7no2akvgVVG5aTk688BagvREMaMHRvyXPI+Tj1kmskALhFfXd huMa5wPZx8jsGrGKEWbuuLmIlGNvYxA== X-MHO-RoutePath: aGlwcGll X-MHO-User: 1cced4f4-2034-11e9-8a28-a1efd8da9a94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.eu.mailhop.org (Halon) with ESMTPSA id 1cced4f4-2034-11e9-8a28-a1efd8da9a94; Thu, 24 Jan 2019 23:59:41 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x0ONxeHX002783; Thu, 24 Jan 2019 16:59:40 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <5bf59c74ab2bfaf831811df273ae1adde1599acc.camel@freebsd.org> Subject: Re: svn commit: r343416 - head/bin/sh From: Ian Lepore To: rgrimes@freebsd.org, Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 24 Jan 2019 16:59:40 -0700 In-Reply-To: <201901242355.x0ONt4Xl085460@pdx.rh.CN85.dnsmgr.net> References: <201901242355.x0ONt4Xl085460@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 48F528E95E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 00:15:59 -0000 On Thu, 2019-01-24 at 15:55 -0800, Rodney W. Grimes wrote: > > Author: trasz > > Date: Thu Jan 24 23:34:51 2019 > > New Revision: 343416 > > URL: https://svnweb.freebsd.org/changeset/base/343416 > > > > Log: > > Install .shrc for root, and set PS1 for the toor account. > > And a dozen other aliases :-( > Please do not contaiminate the prestine environment with > personal preferences. In the start of the project we > did a great deal of work to remove and eliminate these > types of things, only the few csh aliases where retained. > > This is really the domain of a systems administrator to > decide and making work for them to clean this out is > not going to make them happy. > > The commands in an ENV file well be executed by > every single shell that is started, not just an > interactive shell, unless I am mis reading the > man page: > If the environment variable ENV is set on > entry to a shell, or is set in the .profile of a login shell, the > shell > then subjects its value to parameter expansion and arithmetic > expansion > and reads commands from the named file. > I agree with all of tat. If the local sysadmin wants to make /bin/sh friendly as an interactive shell, maybe we could provide some .sample files to make that easy, but we SHOULD NOT put all this junk in by default. -- Ian > > Reviewed by: jilles > > MFC after: 2 weeks > > Sponsored by: DARPA, AFRL > > Differential Revision: https://reviews.freebsd.org/D18872 > > > > Added: > > head/bin/sh/dot.shrc > > - copied unchanged from r343399, head/share/skel/dot.shrc > > Modified: > > head/bin/sh/Makefile > > head/bin/sh/dot.profile > > > > Modified: head/bin/sh/Makefile > > =================================================================== > > =========== > > --- head/bin/sh/Makefile Thu Jan 24 22:34:30 2019 (r343415) > > +++ head/bin/sh/Makefile Thu Jan 24 23:34:51 2019 (r343416) > > @@ -3,9 +3,12 @@ > > > > .include > > > > -CONFS= dot.profile profile > > -CONFSDIR_dot.profile= /root > > -CONFSNAME_dot.profile= .profile > > +CONFGROUPS= ETC ROOT > > +ETC= profile > > +ROOT= dot.shrc dot.profile > > +ROOTDIR= /root > > +ROOTNAME_dot.shrc= .shrc > > +ROOTNAME_dot.profile= .profile > > PACKAGE=runtime > > PROG= sh > > INSTALLFLAGS= -S > > > > Modified: head/bin/sh/dot.profile > > =================================================================== > > =========== > > --- head/bin/sh/dot.profile Thu Jan 24 22:34:30 2019 (r343415) > > +++ head/bin/sh/dot.profile Thu Jan 24 23:34:51 2019 (r343416) > > @@ -9,6 +9,9 @@ export TERM > > PAGER=less > > export PAGER > > > > +# set ENV to a file invoked each time sh is started for > > interactive use. > > +ENV=$HOME/.shrc; export ENV > > + > > # Query terminal size; useful for serial lines. > > if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi > > > > > > Copied: head/bin/sh/dot.shrc (from r343399, > > head/share/skel/dot.shrc) > > =================================================================== > > =========== > > --- /dev/null 00:00:00 1970 (empty, because file is > > newly added) > > +++ head/bin/sh/dot.shrc Thu Jan 24 23:34:51 2019 (r343416, > > copy of r343399, head/share/skel/dot.shrc) > > @@ -0,0 +1,39 @@ > > +# $FreeBSD$ > > +# > > +# .shrc - bourne shell startup file > > +# > > +# This file will be used if the shell is invoked for interactive > > use and > > +# the environment variable ENV is set to this file. > > +# > > +# see also sh(1), environ(7). > > +# > > + > > + > > +# file permissions: rwxr-xr-x > > +# > > +# umask 022 > > + > > +# Uncomment this to enable the builtin vi(1) command line editor > > in sh(1), > > +# e.g. ESC to go into visual mode. > > +# set -o vi > > + > > + > > +# some useful aliases > > +alias h='fc -l' > > +alias j=jobs > > +alias m="$PAGER" > > +alias ll='ls -laFo' > > +alias l='ls -l' > > +alias g='egrep -i' > > + > > +# # be paranoid > > +# alias cp='cp -ip' > > +# alias mv='mv -i' > > +# alias rm='rm -i' > > + > > + > > +# set prompt: ``username@hostname:directory $ '' > > +PS1="\u@\h:\w \\$ " > > + > > +# search path for cd(1) > > +# CDPATH=:$HOME > > > > > > From owner-svn-src-head@freebsd.org Fri Jan 25 00:23:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32DAB14C46E2; Fri, 25 Jan 2019 00:23:56 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97E958EF61; Fri, 25 Jan 2019 00:23:55 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0P0Nr60085676; Thu, 24 Jan 2019 16:23:53 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0P0NrC0085675; Thu, 24 Jan 2019 16:23:53 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901250023.x0P0NrC0085675@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343416 - head/bin/sh In-Reply-To: <5bf59c74ab2bfaf831811df273ae1adde1599acc.camel@freebsd.org> To: Ian Lepore Date: Thu, 24 Jan 2019 16:23:53 -0800 (PST) CC: rgrimes@freebsd.org, Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 97E958EF61 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.986,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 00:23:56 -0000 [ Charset UTF-8 unsupported, converting... ] > On Thu, 2019-01-24 at 15:55 -0800, Rodney W. Grimes wrote: > > > Author: trasz > > > Date: Thu Jan 24 23:34:51 2019 > > > New Revision: 343416 > > > URL: https://svnweb.freebsd.org/changeset/base/343416 > > > > > > Log: > > > Install .shrc for root, and set PS1 for the toor account. > > > > And a dozen other aliases :-( > > Please do not contaiminate the prestine environment with > > personal preferences. In the start of the project we > > did a great deal of work to remove and eliminate these > > types of things, only the few csh aliases where retained. > > > > This is really the domain of a systems administrator to > > decide and making work for them to clean this out is > > not going to make them happy. > > > > The commands in an ENV file well be executed by > > every single shell that is started, not just an > > interactive shell, unless I am mis reading the > > man page: > > If the environment variable ENV is set on > > entry to a shell, or is set in the .profile of a login shell, the > > shell > > then subjects its value to parameter expansion and arithmetic > > expansion > > and reads commands from the named file. The man page needs fixed here too, it does infact later state that THIS version of sh does not always run ENV, only for interactive shells. Which is a good thing, but there is still this un needed contaimination with aliases. You also just caused me to have to revive my .profile diff cause the addition of the ENV falls in the context range of my local mods. I am sure this effects others. Please do consider that these files have been very very rarely touched over decades of time. > > > > I agree with all of tat. If the local sysadmin wants to make /bin/sh > friendly as an interactive shell, maybe we could provide some .sample > files to make that easy, but we SHOULD NOT put all this junk in by > default. > > -- Ian > > > > Reviewed by: jilles > > > MFC after: 2 weeks > > > Sponsored by: DARPA, AFRL > > > Differential Revision: https://reviews.freebsd.org/D18872 > > > > > > Added: > > > head/bin/sh/dot.shrc > > > - copied unchanged from r343399, head/share/skel/dot.shrc > > > Modified: > > > head/bin/sh/Makefile > > > head/bin/sh/dot.profile > > > > > > Modified: head/bin/sh/Makefile > > > =================================================================== > > > =========== > > > --- head/bin/sh/Makefile Thu Jan 24 22:34:30 2019 (r343415) > > > +++ head/bin/sh/Makefile Thu Jan 24 23:34:51 2019 (r343416) > > > @@ -3,9 +3,12 @@ > > > > > > .include > > > > > > -CONFS= dot.profile profile > > > -CONFSDIR_dot.profile= /root > > > -CONFSNAME_dot.profile= .profile > > > +CONFGROUPS= ETC ROOT > > > +ETC= profile > > > +ROOT= dot.shrc dot.profile > > > +ROOTDIR= /root > > > +ROOTNAME_dot.shrc= .shrc > > > +ROOTNAME_dot.profile= .profile > > > PACKAGE=runtime > > > PROG= sh > > > INSTALLFLAGS= -S > > > > > > Modified: head/bin/sh/dot.profile > > > =================================================================== > > > =========== > > > --- head/bin/sh/dot.profile Thu Jan 24 22:34:30 2019 (r343415) > > > +++ head/bin/sh/dot.profile Thu Jan 24 23:34:51 2019 (r343416) > > > @@ -9,6 +9,9 @@ export TERM > > > PAGER=less > > > export PAGER > > > > > > +# set ENV to a file invoked each time sh is started for > > > interactive use. > > > +ENV=$HOME/.shrc; export ENV > > > + > > > # Query terminal size; useful for serial lines. > > > if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi > > > > > > > > > Copied: head/bin/sh/dot.shrc (from r343399, > > > head/share/skel/dot.shrc) > > > =================================================================== > > > =========== > > > --- /dev/null 00:00:00 1970 (empty, because file is > > > newly added) > > > +++ head/bin/sh/dot.shrc Thu Jan 24 23:34:51 2019 (r343416, > > > copy of r343399, head/share/skel/dot.shrc) > > > @@ -0,0 +1,39 @@ > > > +# $FreeBSD$ > > > +# > > > +# .shrc - bourne shell startup file > > > +# > > > +# This file will be used if the shell is invoked for interactive > > > use and > > > +# the environment variable ENV is set to this file. > > > +# > > > +# see also sh(1), environ(7). > > > +# > > > + > > > + > > > +# file permissions: rwxr-xr-x > > > +# > > > +# umask 022 > > > + > > > +# Uncomment this to enable the builtin vi(1) command line editor > > > in sh(1), > > > +# e.g. ESC to go into visual mode. > > > +# set -o vi > > > + > > > + > > > +# some useful aliases > > > +alias h='fc -l' > > > +alias j=jobs > > > +alias m="$PAGER" > > > +alias ll='ls -laFo' > > > +alias l='ls -l' > > > +alias g='egrep -i' > > > + > > > +# # be paranoid > > > +# alias cp='cp -ip' > > > +# alias mv='mv -i' > > > +# alias rm='rm -i' > > > + > > > + > > > +# set prompt: ``username@hostname:directory $ '' > > > +PS1="\u@\h:\w \\$ " > > > + > > > +# search path for cd(1) > > > +# CDPATH=:$HOME > > > > > > > > > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 25 01:05:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D82E014C5986; Fri, 25 Jan 2019 01:05:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DF119057B; Fri, 25 Jan 2019 01:05:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70573A27; Fri, 25 Jan 2019 01:05:20 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0P15KrM093248; Fri, 25 Jan 2019 01:05:20 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0P15IQ8093240; Fri, 25 Jan 2019 01:05:18 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901250105.x0P15IQ8093240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 25 Jan 2019 01:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343417 - in head/sys: dev/rtwn/pci dev/rtwn/usb net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys: dev/rtwn/pci dev/rtwn/usb net80211 X-SVN-Commit-Revision: 343417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7DF119057B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 01:05:21 -0000 Author: avos Date: Fri Jan 25 01:05:18 2019 New Revision: 343417 URL: https://svnweb.freebsd.org/changeset/base/343417 Log: net80211: reuse TICKS_2_MSEC / MSEC_2_TICKS macros from sys/time.h Replace in-place implementation with system-wide one; since it guarantees non-zero result drop all less-than-one checks from drivers and net80211. MFC after: 2 weeks Modified: head/sys/dev/rtwn/pci/rtwn_pci_reg.c head/sys/dev/rtwn/usb/rtwn_usb_reg.c head/sys/net80211/ieee80211_amrr.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_freebsd.h head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_rssadapt.c head/sys/net80211/ieee80211_scan.c Modified: head/sys/dev/rtwn/pci/rtwn_pci_reg.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_reg.c Thu Jan 24 23:34:51 2019 (r343416) +++ head/sys/dev/rtwn/pci/rtwn_pci_reg.c Fri Jan 25 01:05:18 2019 (r343417) @@ -118,6 +118,6 @@ rtwn_pci_delay(struct rtwn_softc *sc, int usec) DELAY(usec); else { (void) mtx_sleep(sc, &sc->sc_mtx, 0, "rtwn_pci", - MAX(msecs_to_ticks(usec / 1000), 1)); + msecs_to_ticks(usec / 1000)); } } Modified: head/sys/dev/rtwn/usb/rtwn_usb_reg.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_reg.c Thu Jan 24 23:34:51 2019 (r343416) +++ head/sys/dev/rtwn/usb/rtwn_usb_reg.c Fri Jan 25 01:05:18 2019 (r343417) @@ -172,8 +172,6 @@ rtwn_usb_delay(struct rtwn_softc *sc, int usec) /* 1ms delay as default is too big. */ if (usec < 1000) DELAY(usec); - else { - usb_pause_mtx(&sc->sc_mtx, - MAX(msecs_to_ticks(usec / 1000), 1)); - } + else + usb_pause_mtx(&sc->sc_mtx, msecs_to_ticks(usec / 1000)); } Modified: head/sys/net80211/ieee80211_amrr.c ============================================================================== --- head/sys/net80211/ieee80211_amrr.c Thu Jan 24 23:34:51 2019 (r343416) +++ head/sys/net80211/ieee80211_amrr.c Fri Jan 25 01:05:18 2019 (r343417) @@ -102,15 +102,13 @@ static void amrr_setinterval(const struct ieee80211vap *vap, int msecs) { struct ieee80211_amrr *amrr = vap->iv_rs; - int t; if (!amrr) return; if (msecs < 100) msecs = 100; - t = msecs_to_ticks(msecs); - amrr->amrr_interval = (t < 1) ? 1 : t; + amrr->amrr_interval = msecs_to_ticks(msecs); } static void Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Thu Jan 24 23:34:51 2019 (r343416) +++ head/sys/net80211/ieee80211_freebsd.c Fri Jan 25 01:05:18 2019 (r343417) @@ -136,13 +136,12 @@ int ieee80211_sysctl_msecs_ticks(SYSCTL_HANDLER_ARGS) { int msecs = ticks_to_msecs(*(int *)arg1); - int error, t; + int error; error = sysctl_handle_int(oidp, &msecs, 0, req); if (error || !req->newptr) return error; - t = msecs_to_ticks(msecs); - *(int *)arg1 = (t < 1) ? 1 : t; + *(int *)arg1 = msecs_to_ticks(msecs); return 0; } @@ -347,9 +346,6 @@ ieee80211_com_vdetach(struct ieee80211vap *vap) int sleep_time; sleep_time = msecs_to_ticks(250); - if (sleep_time == 0) - sleep_time = 1; - atomic_set_32(&vap->iv_com_state, IEEE80211_COM_DETACHED); while (MS(atomic_load_32(&vap->iv_com_state), IEEE80211_COM_REF) != 0) pause("comref", sleep_time); Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Thu Jan 24 23:34:51 2019 (r343416) +++ head/sys/net80211/ieee80211_freebsd.h Fri Jan 25 01:05:18 2019 (r343417) @@ -38,6 +38,7 @@ #include #include #include +#include /* * Common state locking definitions. @@ -249,9 +250,8 @@ void ieee80211_vap_destroy(struct ieee80211vap *); (((_ifp)->if_flags & IFF_UP) && \ ((_ifp)->if_drv_flags & IFF_DRV_RUNNING)) -/* XXX TODO: cap these at 1, as hz may not be 1000 */ -#define msecs_to_ticks(ms) (((ms)*hz)/1000) -#define ticks_to_msecs(t) (1000*(t) / hz) +#define msecs_to_ticks(ms) MSEC_2_TICKS(ms) +#define ticks_to_msecs(t) TICKS_2_MSEC(t) #define ticks_to_secs(t) ((t) / hz) #define ieee80211_time_after(a,b) ((long)(b) - (long)(a) < 0) Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Jan 24 23:34:51 2019 (r343416) +++ head/sys/net80211/ieee80211_ioctl.c Fri Jan 25 01:05:18 2019 (r343417) @@ -2515,20 +2515,12 @@ ieee80211_scanreq(struct ieee80211vap *vap, struct iee sr->sr_duration > IEEE80211_IOC_SCAN_DURATION_MAX) return EINVAL; sr->sr_duration = msecs_to_ticks(sr->sr_duration); - if (sr->sr_duration < 1) - sr->sr_duration = 1; } /* convert min/max channel dwell */ - if (sr->sr_mindwell != 0) { + if (sr->sr_mindwell != 0) sr->sr_mindwell = msecs_to_ticks(sr->sr_mindwell); - if (sr->sr_mindwell < 1) - sr->sr_mindwell = 1; - } - if (sr->sr_maxdwell != 0) { + if (sr->sr_maxdwell != 0) sr->sr_maxdwell = msecs_to_ticks(sr->sr_maxdwell); - if (sr->sr_maxdwell < 1) - sr->sr_maxdwell = 1; - } /* NB: silently reduce ssid count to what is supported */ if (sr->sr_nssid > IEEE80211_SCAN_MAX_SSID) sr->sr_nssid = IEEE80211_SCAN_MAX_SSID; Modified: head/sys/net80211/ieee80211_rssadapt.c ============================================================================== --- head/sys/net80211/ieee80211_rssadapt.c Thu Jan 24 23:34:51 2019 (r343416) +++ head/sys/net80211/ieee80211_rssadapt.c Fri Jan 25 01:05:18 2019 (r343417) @@ -117,15 +117,13 @@ static void rssadapt_setinterval(const struct ieee80211vap *vap, int msecs) { struct ieee80211_rssadapt *rs = vap->iv_rs; - int t; if (!rs) return; if (msecs < 100) msecs = 100; - t = msecs_to_ticks(msecs); - rs->interval = (t < 1) ? 1 : t; + rs->interval = msecs_to_ticks(msecs); } static void Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Thu Jan 24 23:34:51 2019 (r343416) +++ head/sys/net80211/ieee80211_scan.c Fri Jan 25 01:05:18 2019 (r343417) @@ -294,7 +294,7 @@ ieee80211_scan_dump(struct ieee80211_scan_state *ss) if_printf(vap->iv_ifp, "scan set "); ieee80211_scan_dump_channels(ss); - printf(" dwell min %lums max %lums\n", + printf(" dwell min %ums max %ums\n", ticks_to_msecs(ss->ss_mindwell), ticks_to_msecs(ss->ss_maxdwell)); } #endif /* IEEE80211_DEBUG */ From owner-svn-src-head@freebsd.org Fri Jan 25 01:06:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4351C14C5A08; Fri, 25 Jan 2019 01:06:07 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD656906BE; Fri, 25 Jan 2019 01:06:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFC57A28; Fri, 25 Jan 2019 01:06:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0P166NR093322; Fri, 25 Jan 2019 01:06:06 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0P1668p093321; Fri, 25 Jan 2019 01:06:06 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901250106.x0P1668p093321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 25 Jan 2019 01:06:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343418 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 343418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD656906BE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 01:06:07 -0000 Author: kp Date: Fri Jan 25 01:06:06 2019 New Revision: 343418 URL: https://svnweb.freebsd.org/changeset/base/343418 Log: pf: Fix use-after-free of counters When cleaning up a vnet we free the counters in V_pf_default_rule and V_pf_status from shutdown_pf(), but we can still use them later, for example through pf_purge_expired_src_nodes(). Free them as the very last operation, as they rely on nothing else themselves. PR: 235097 MFC after: 1 week Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Fri Jan 25 01:05:18 2019 (r343417) +++ head/sys/netpfil/pf/pf_ioctl.c Fri Jan 25 01:06:06 2019 (r343418) @@ -3989,20 +3989,6 @@ shutdown_pf(void) /* status does not use malloced mem so no need to cleanup */ /* fingerprints and interfaces have their own cleanup code */ - - /* Free counters last as we updated them during shutdown. */ - counter_u64_free(V_pf_default_rule.states_cur); - counter_u64_free(V_pf_default_rule.states_tot); - counter_u64_free(V_pf_default_rule.src_nodes); - - for (int i = 0; i < PFRES_MAX; i++) - counter_u64_free(V_pf_status.counters[i]); - for (int i = 0; i < LCNT_MAX; i++) - counter_u64_free(V_pf_status.lcounters[i]); - for (int i = 0; i < FCNT_MAX; i++) - counter_u64_free(V_pf_status.fcounters[i]); - for (int i = 0; i < SCNT_MAX; i++) - counter_u64_free(V_pf_status.scounters[i]); } while(0); return (error); @@ -4232,6 +4218,20 @@ pf_unload_vnet(void) pf_cleanup(); if (IS_DEFAULT_VNET(curvnet)) pf_mtag_cleanup(); + + /* Free counters last as we updated them during shutdown. */ + counter_u64_free(V_pf_default_rule.states_cur); + counter_u64_free(V_pf_default_rule.states_tot); + counter_u64_free(V_pf_default_rule.src_nodes); + + for (int i = 0; i < PFRES_MAX; i++) + counter_u64_free(V_pf_status.counters[i]); + for (int i = 0; i < LCNT_MAX; i++) + counter_u64_free(V_pf_status.lcounters[i]); + for (int i = 0; i < FCNT_MAX; i++) + counter_u64_free(V_pf_status.fcounters[i]); + for (int i = 0; i < SCNT_MAX; i++) + counter_u64_free(V_pf_status.scounters[i]); } static void From owner-svn-src-head@freebsd.org Fri Jan 25 01:36:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5317F14C6819; Fri, 25 Jan 2019 01:36:18 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8580091872; Fri, 25 Jan 2019 01:36:17 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id mqPkgbMn5nBo4mqPlgxmcJ; Thu, 24 Jan 2019 18:36:15 -0700 X-Authority-Analysis: v=2.3 cv=J8fUEzvS c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=IkcTkHD0fZMA:10 a=xqWC_Br6kY4A:10 a=3JhidrIBZZsA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=FR35MORUfq6qWSmt_NgA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from [IPv6:2605:8d80:401:1152:25e8:5ff:bcad:3987] (unknown [72.143.221.163]) by spqr.komquats.com (Postfix) with ESMTPSA id 3FA8F97B; Thu, 24 Jan 2019 17:36:46 -0800 (PST) Date: Thu, 24 Jan 2019 17:35:42 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <5bf59c74ab2bfaf831811df273ae1adde1599acc.camel@freebsd.org> References: <201901242355.x0ONt4Xl085460@pdx.rh.CN85.dnsmgr.net> <5bf59c74ab2bfaf831811df273ae1adde1599acc.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r343416 - head/bin/sh To: Ian Lepore , rgrimes@freebsd.org, Edward Tomasz Napierala CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: <18A9C567-56ED-45A5-93A7-5863C541C82B@cschubert.com> X-CMAE-Envelope: MS4wfFQhp2tOoNHUnX+JpjCjhCo3gHhpwGw/229CyEQNlG3PFKUGk6IzSK8oopHpx2XNbR5L0mEm3uJSq/lLqJqCmqz+xwCq9YhmVZ1+ENR0oklanMadO5ot W2T2sQAgaZwZpNSrR6Bdqz3+o5ECCEl3vkUBo4kE5/++p/mK/JsnyJBR/0K40jciAXYN3YeBoLqjME4xGKqejN0GZ5S/ecdmI64VGfrbxmlcSqlZDtY0FlEy +7CNABbqc/mA8FBIFR4z+YHrUnpAxEedgYOUHaoPmZckv2rCRbD/Xg/x34VzXhcYZ/RxrHvGfGWRjcrCHspZGyHoTsA5hPQBJPWlCfDHgUSZpOVObJGJu2tL WTeP7Afr X-Rspamd-Queue-Id: 8580091872 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.989,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 01:36:18 -0000 On January 24, 2019 3:59:40 PM PST, Ian Lepore wrote: >On Thu, 2019-01-24 at 15:55 -0800, Rodney W=2E Grimes wrote: >> > Author: trasz >> > Date: Thu Jan 24 23:34:51 2019 >> > New Revision: 343416 >> > URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/343416 >> >=20 >> > Log: >> > Install =2Eshrc for root, and set PS1 for the toor account=2E >>=20 >> And a dozen other aliases :-( >> Please do not contaiminate the prestine environment with >> personal preferences=2E In the start of the project we >> did a great deal of work to remove and eliminate these >> types of things, only the few csh aliases where retained=2E >>=20 >> This is really the domain of a systems administrator to >> decide and making work for them to clean this out is >> not going to make them happy=2E >>=20 >> The commands in an ENV file well be executed by >> every single shell that is started, not just an >> interactive shell, unless I am mis reading the >> man page: >> If the environment variable ENV is set on >> entry to a shell, or is set in the =2Eprofile of a login shell, the >> shell >> then subjects its value to parameter expansion and arithmetic >> expansion >> and reads commands from the named file=2E >> =20 > >I agree with all of tat=2E If the local sysadmin wants to make /bin/sh >friendly as an interactive shell, maybe we could provide some =2Esample >files to make that easy, but we SHOULD NOT put all this junk in by >default=2E > >-- Ian > >> > Reviewed by: jilles >> > MFC after: 2 weeks >> > Sponsored by: DARPA, AFRL >> > Differential Revision: https://reviews=2Efreebsd=2Eorg/D18872 >> >=20 >> > Added: >> > head/bin/sh/dot=2Eshrc >> > - copied unchanged from r343399, head/share/skel/dot=2Eshrc >> > Modified: >> > head/bin/sh/Makefile >> > head/bin/sh/dot=2Eprofile >> >=20 >> > Modified: head/bin/sh/Makefile >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > --- head/bin/sh/Makefile Thu Jan 24 22:34:30 2019 (r343415) >> > +++ head/bin/sh/Makefile Thu Jan 24 23:34:51 2019 (r343416) >> > @@ -3,9 +3,12 @@ >> > =20 >> > =2Einclude >> > =20 >> > -CONFS=3D dot=2Eprofile profile >> > -CONFSDIR_dot=2Eprofile=3D /root >> > -CONFSNAME_dot=2Eprofile=3D =2Eprofile >> > +CONFGROUPS=3D ETC ROOT >> > +ETC=3D profile >> > +ROOT=3D dot=2Eshrc dot=2Eprofile >> > +ROOTDIR=3D /root >> > +ROOTNAME_dot=2Eshrc=3D =2Eshrc >> > +ROOTNAME_dot=2Eprofile=3D =2Eprofile >> > PACKAGE=3Druntime >> > PROG=3D sh >> > INSTALLFLAGS=3D -S >> >=20 >> > Modified: head/bin/sh/dot=2Eprofile >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > --- head/bin/sh/dot=2Eprofile Thu Jan 24 22:34:30 2019 (r343415) >> > +++ head/bin/sh/dot=2Eprofile Thu Jan 24 23:34:51 2019 (r343416) >> > @@ -9,6 +9,9 @@ export TERM >> > PAGER=3Dless >> > export PAGER >> > =20 >> > +# set ENV to a file invoked each time sh is started for >> > interactive use=2E >> > +ENV=3D$HOME/=2Eshrc; export ENV >> > + >> > # Query terminal size; useful for serial lines=2E >> > if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi >> > =20 >> >=20 >> > Copied: head/bin/sh/dot=2Eshrc (from r343399, >> > head/share/skel/dot=2Eshrc) >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > --- /dev/null 00:00:00 1970 (empty, because file is >> > newly added) >> > +++ head/bin/sh/dot=2Eshrc Thu Jan 24 23:34:51 2019 (r343416, >> > copy of r343399, head/share/skel/dot=2Eshrc) >> > @@ -0,0 +1,39 @@ >> > +# $FreeBSD$ >> > +# >> > +# =2Eshrc - bourne shell startup file=20 >> > +# >> > +# This file will be used if the shell is invoked for interactive >> > use and >> > +# the environment variable ENV is set to this file=2E >> > +# >> > +# see also sh(1), environ(7)=2E >> > +# >> > + >> > + >> > +# file permissions: rwxr-xr-x >> > +# >> > +# umask 022 >> > + >> > +# Uncomment this to enable the builtin vi(1) command line editor >> > in sh(1), >> > +# e=2Eg=2E ESC to go into visual mode=2E >> > +# set -o vi >> > + >> > + >> > +# some useful aliases >> > +alias h=3D'fc -l' >> > +alias j=3Djobs >> > +alias m=3D"$PAGER" >> > +alias ll=3D'ls -laFo' >> > +alias l=3D'ls -l' >> > +alias g=3D'egrep -i' >> > +=20 >> > +# # be paranoid >> > +# alias cp=3D'cp -ip' >> > +# alias mv=3D'mv -i' >> > +# alias rm=3D'rm -i' >> > + >> > + >> > +# set prompt: ``username@hostname:directory $ ''=20 >> > +PS1=3D"\u@\h:\w \\$ " >> > + >> > +# search path for cd(1) >> > +# CDPATH=3D:$HOME >> >=20 >> >=20 >>=20 >>=20 Agreed re samples though a comment in the default should point the user to= samples=2E Samples could also include some nifty tricks too, some of which= are in fortune or Power Tools=2E --=20 Pardon the typos and autocorrect, small keyboard in use=2E Cheers, Cy Schubert FreeBSD UNIX: Web: http://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E From owner-svn-src-head@freebsd.org Fri Jan 25 01:44:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C8DD14C6BFD; Fri, 25 Jan 2019 01:44:30 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F414391E2F; Fri, 25 Jan 2019 01:44:29 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=55102 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gmqX4-000NgJ-AC; Thu, 24 Jan 2019 17:43:46 -0800 From: Devin Teske Message-Id: <0D1FAD4B-5E35-4CCE-AA30-E94E3534F890@FreeBSD.org> Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343416 - head/bin/sh Date: Thu, 24 Jan 2019 17:44:15 -0800 In-Reply-To: <201901250023.x0P0NrC0085675@pdx.rh.CN85.dnsmgr.net> Cc: Devin Teske , Ian Lepore , Edward Tomasz Napierala , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: rgrimes@freebsd.org References: <201901250023.x0P0NrC0085675@pdx.rh.CN85.dnsmgr.net> X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: F414391E2F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.979,0] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 01:44:30 -0000 > On Jan 24, 2019, at 4:23 PM, Rodney W. Grimes = wrote: >=20 > [ Charset UTF-8 unsupported, converting... ] >> On Thu, 2019-01-24 at 15:55 -0800, Rodney W. Grimes wrote: >>>> Author: trasz >>>> Date: Thu Jan 24 23:34:51 2019 >>>> New Revision: 343416 >>>> URL: https://svnweb.freebsd.org/changeset/base/343416 >>>>=20 >>>> Log: >>>> Install .shrc for root, and set PS1 for the toor account. >>>=20 >>> And a dozen other aliases :-( >>> Please do not contaiminate the prestine environment with >>> personal preferences. In the start of the project we >>> did a great deal of work to remove and eliminate these >>> types of things, only the few csh aliases where retained. >>>=20 >>> This is really the domain of a systems administrator to >>> decide and making work for them to clean this out is >>> not going to make them happy. >>>=20 >>> The commands in an ENV file well be executed by >>> every single shell that is started, not just an >>> interactive shell, unless I am mis reading the >>> man page: >>> If the environment variable ENV is set on >>> entry to a shell, or is set in the .profile of a login shell, the >>> shell >>> then subjects its value to parameter expansion and arithmetic >>> expansion >>> and reads commands from the named file. >=20 > The man page needs fixed here too, it does infact later state > that THIS version of sh does not always run ENV, only for > interactive shells. Which is a good thing, but there is > still this un needed contaimination with aliases. >=20 > You also just caused me to have to revive my .profile diff > cause the addition of the ENV falls in the context range > of my local mods. I am sure this effects others. Please > do consider that these files have been very very rarely > touched over decades of time. >=20 +1 Will be watching for the revert of this. --=20 Devin From owner-svn-src-head@freebsd.org Fri Jan 25 01:45:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D741D14C6CA5; Fri, 25 Jan 2019 01:45:55 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 693B291FB7; Fri, 25 Jan 2019 01:45:55 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=55128 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gmqYN-000NjF-Ox; Thu, 24 Jan 2019 17:45:07 -0800 From: Devin Teske Message-Id: Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343416 - head/bin/sh Date: Thu, 24 Jan 2019 17:45:52 -0800 In-Reply-To: <18A9C567-56ED-45A5-93A7-5863C541C82B@cschubert.com> Cc: Devin Teske , Ian Lepore , rgrimes@freebsd.org, Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Cy Schubert References: <201901242355.x0ONt4Xl085460@pdx.rh.CN85.dnsmgr.net> <5bf59c74ab2bfaf831811df273ae1adde1599acc.camel@freebsd.org> <18A9C567-56ED-45A5-93A7-5863C541C82B@cschubert.com> X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: 693B291FB7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.978,0] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 01:45:56 -0000 > On Jan 24, 2019, at 5:35 PM, Cy Schubert = wrote: >=20 > Agreed re samples though a comment in the default should point the = user to samples. Samples could also include some nifty tricks too, some = of which are in fortune or Power Tools. What is this "Power Tools" you speak of (honest question) --=20 Devin= From owner-svn-src-head@freebsd.org Fri Jan 25 02:27:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47E8F14C7C1D; Fri, 25 Jan 2019 02:27:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BF7193317; Fri, 25 Jan 2019 02:27:27 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id mrAXgjKxI8uQmmrAYgn4yb; Thu, 24 Jan 2019 19:24:35 -0700 X-Authority-Analysis: v=2.3 cv=XKpOtjpE c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=3JhidrIBZZsA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=8oJCibGMUmJDAxpDk1YA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id ABF74ABC; Thu, 24 Jan 2019 18:25:07 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x0P2OWKb003712; Thu, 24 Jan 2019 18:24:32 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x0P2OW9r003709; Thu, 24 Jan 2019 18:24:32 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201901250224.x0P2OW9r003709@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Devin Teske cc: Cy Schubert , Ian Lepore , rgrimes@freebsd.org, Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343416 - head/bin/sh In-Reply-To: Message from Devin Teske of "Thu, 24 Jan 2019 17:45:52 -0800." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 24 Jan 2019 18:24:32 -0800 X-CMAE-Envelope: MS4wfJYCvl7v//ZEBYCnjGItIh+gd95VWbu8BoQNnEncxRAffkjiUe9UOBPAVqDkcGU2Gkr0WmY1b/6+lku5NjNcvuybqSxd8umj3XS/YdNXDWFkEPj4e0Gx bq5914uWDFQI3INq6OgsRkCfQTT2tqF3i/OCWwvFVGqfKlCfNyY/AsXCgctsIT+FczXPBNCjCpBCUqKNNa0ifv7pdZ8ciib01dV/V7RgETHrn054TAnA8Qwi qoOR6a9lS4lrByebAUL1AJRENn9UslFJGrJ9B4d20F2ikWW4Eqmf1huJKDGxAS8oEULbdooAwpJxhUJUh8QIBLs7b2SSz3C+9C/RQTkEsJFIaj8w2scVPltV DLUogmxX7LuWRVJZqtMgLk/8BBi6Xw== X-Rspamd-Queue-Id: 3BF7193317 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-4.65 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; IP_SCORE(-2.03)[ip: (-5.77), ipnet: 64.59.128.0/20(-2.43), asn: 6327(-1.88), country: CA(-0.09)]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[spqr.komquats.com]; NEURAL_HAM_SHORT(-0.90)[-0.901,0]; RCPT_COUNT_SEVEN(0.00)[8]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[13.134.59.64.list.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 02:27:29 -0000 In message , Devin Teske writ es: > > > --Apple-Mail=_191072C8-B951-49CB-AA8D-792ADC82A31D > Content-Transfer-Encoding: quoted-printable > Content-Type: text/plain; > charset=us-ascii > > > > > On Jan 24, 2019, at 5:35 PM, Cy Schubert = > wrote: > >=20 > > Agreed re samples though a comment in the default should point the = > user to samples. Samples could also include some nifty tricks too, some = > of which are in fortune or Power Tools. > > What is this "Power Tools" you speak of (honest question) UNIX Power Tools. It's an O'Reilly book that should have been entitled Common Sense UNIX. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Fri Jan 25 02:34:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11D6D14C7EAD; Fri, 25 Jan 2019 02:34:27 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 496AE93882; Fri, 25 Jan 2019 02:34:25 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0P2YMHT086179; Thu, 24 Jan 2019 18:34:22 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0P2YMCc086178; Thu, 24 Jan 2019 18:34:22 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901250234.x0P2YMCc086178@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343416 - head/bin/sh In-Reply-To: <201901250224.x0P2OW9r003709@slippy.cwsent.com> To: Cy Schubert Date: Thu, 24 Jan 2019 18:34:22 -0800 (PST) CC: Devin Teske , Ian Lepore , rgrimes@FreeBSD.org, Edward Tomasz Napierala , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 496AE93882 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.951,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 02:34:27 -0000 > In message , Devin > Teske writ > es: > > > > > > --Apple-Mail=_191072C8-B951-49CB-AA8D-792ADC82A31D > > Content-Transfer-Encoding: quoted-printable > > Content-Type: text/plain; > > charset=us-ascii > > > > > > > > > On Jan 24, 2019, at 5:35 PM, Cy Schubert = > > wrote: > > >=20 > > > Agreed re samples though a comment in the default should point the = > > user to samples. Samples could also include some nifty tricks too, some = > > of which are in fortune or Power Tools. > > > > What is this "Power Tools" you speak of (honest question) > > UNIX Power Tools. It's an O'Reilly book that should have been entitled > Common Sense UNIX. If I can find my copy you can have it Devin. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 25 03:33:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A53214A5912; Fri, 25 Jan 2019 03:33:06 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (unknown [IPv6:2001:470:1f0f:3ad::53:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "*.lerctr.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D89395812; Fri, 25 Jan 2019 03:33:04 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date: Content-Transfer-Encoding:Content-Type:MIME-Version:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=92ZTWX2cz5wTXiEVgQR2FSDtCvSQ5TPHabVdDYKfheI=; b=ngJBpdw1QL1Yw96RcfXV9IzyiN 75Sfljya7AG7tzshVXk1HbgX4O+aayxRjtR3/+Lg7RxG2d8eSEOU1wuaZKO2rI4qbNtEnbU4hieNU kDcj22s/9RAiHwZ5gZc3kKP14N/BuBFyynPsan04Tkq0Lw4Zxn5qhJdDdcwQ8ap2VA00=; Received: from thebighonker.lerctr.org ([2001:470:1f0f:3ad:bb:dcff:fe50:d900]:52578 helo=webmail.lerctr.org) by thebighonker.lerctr.org with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1gmsEo-000G28-WA; Thu, 24 Jan 2019 21:33:03 -0600 Received: from 2600:1700:210:b18f:3179:a92e:363e:1ae by webmail.lerctr.org with HTTP (HTTP/1.1 POST); Thu, 24 Jan 2019 21:33:02 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 24 Jan 2019 21:33:02 -0600 From: Larry Rosenman To: rgrimes@freebsd.org Cc: Cy Schubert , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske , Edward Tomasz Napierala , owner-svn-src-all@freebsd.org Subject: Re: svn commit: r343416 - head/bin/sh In-Reply-To: <201901250234.x0P2YMCc086178@pdx.rh.CN85.dnsmgr.net> References: <201901250234.x0P2YMCc086178@pdx.rh.CN85.dnsmgr.net> Message-ID: X-Sender: ler@lerctr.org User-Agent: Roundcube Webmail/1.3.8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 03:33:06 -0000 On 01/24/2019 8:34 pm, Rodney W. Grimes wrote: >> In message , Devin >> Teske writ >> es: >> > >> > >> > --Apple-Mail=_191072C8-B951-49CB-AA8D-792ADC82A31D >> > Content-Transfer-Encoding: quoted-printable >> > Content-Type: text/plain; >> > charset=us-ascii >> > >> > >> > >> > > On Jan 24, 2019, at 5:35 PM, Cy Schubert = >> > wrote: >> > >=20 >> > > Agreed re samples though a comment in the default should point the = >> > user to samples. Samples could also include some nifty tricks too, some = >> > of which are in fortune or Power Tools. >> > >> > What is this "Power Tools" you speak of (honest question) >> >> UNIX Power Tools. It's an O'Reilly book that should have been entitled >> Common Sense UNIX. > > If I can find my copy you can have it Devin. If you can't find yours, Rod, I can send mine. -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 E-Mail: ler@lerctr.org US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106 From owner-svn-src-head@freebsd.org Fri Jan 25 06:34:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1ACA214A974E; Fri, 25 Jan 2019 06:34:46 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD5096BA4A; Fri, 25 Jan 2019 06:34:45 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 8F81FB7DF; Fri, 25 Jan 2019 06:34:45 +0000 (UTC) Date: Fri, 25 Jan 2019 06:34:45 +0000 From: Alexey Dokuchaev To: Ian Lepore Cc: rgrimes@freebsd.org, Edward Tomasz Napierala , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r343416 - head/bin/sh Message-ID: <20190125063445.GA6058@FreeBSD.org> References: <201901242355.x0ONt4Xl085460@pdx.rh.CN85.dnsmgr.net> <5bf59c74ab2bfaf831811df273ae1adde1599acc.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5bf59c74ab2bfaf831811df273ae1adde1599acc.camel@freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: AD5096BA4A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.91 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.91)[-0.911,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 06:34:46 -0000 On Thu, Jan 24, 2019 at 04:59:40PM -0700, Ian Lepore wrote: > On Thu, 2019-01-24 at 15:55 -0800, Rodney W. Grimes wrote: > > > New Revision: 343416 > > > URL: https://svnweb.freebsd.org/changeset/base/343416 > > > > > > Log: > > > Install .shrc for root, and set PS1 for the toor account. > > > > And a dozen other aliases :-( > > Please do not contaiminate the prestine environment with > > personal preferences. In the start of the project we > > did a great deal of work to remove and eliminate these > > types of things, only the few csh aliases where retained. I fully concur, please back this out trasz@. > I agree with all of tat. If the local sysadmin wants to make /bin/sh > friendly as an interactive shell, maybe we could provide some .sample > files to make that easy No matter what sample files we provide, there are far better and complete examples can be found all over the Internet. If anyone wants to customize their shell, there are plenty of good sources for this information, let's not spam the filesystem with another one. ./danfe From owner-svn-src-head@freebsd.org Fri Jan 25 08:55:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19A0614AD725; Fri, 25 Jan 2019 08:55:21 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 854A170741; Fri, 25 Jan 2019 08:55:20 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm1-x32e.google.com with SMTP id d15so5942669wmb.3; Fri, 25 Jan 2019 00:55:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=hSm4D1dy7upM0Ie1zBdF3XUhruPao6tM9F5xeS6A1m0=; b=P76pTk5uPcVawgYhDeJjfifPMOy+HbuFHeQCblXPzw/Ta5u8RuaAQHEbbD1mCHnr3g b+4F+ZcjSFC1fpLGdmiDiTq88hTt4Cm1SixV7IPAd9172pdlUhDayi7VNXq9ZqrJ4RJv YNCtTcPV6MhJpWsAJBngkZpk5QfNe3+niTRatrOHCwAyPvNjo8YKbtolFQdlX80amuOg QCNJU/K5pFWU6NXjlQ/ggaX6w7jFqurfBUxHNXog2MjD6thvct2p2i7lHgfVwZ3TkBt7 SR67mzX5QvCApWi4rCy5FFc03kOFrlLQC+vB2p3CFSLnj+rJBWndN4DidjW/uuOe53f6 0wMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=hSm4D1dy7upM0Ie1zBdF3XUhruPao6tM9F5xeS6A1m0=; b=g5Wc/kkfqZs44kElU33BHZVJ0HSs3jqvxV3fyTlmYRk6ntOfROKwa9W7zyuAd84QdG 3HTCvPU6FYYlu9BJhUV8ACm6DiAoiNN/baI6d9vnG3SIB3cutTiFmQg1VZxpyT+RY1rV +V5l8Ra27W7Ojq/2ARz3Uqny6iFcz+j9XBry2ARAXqta0yFpWx8p11R/ZEcY2KeZ0Ffj Tm8psuYgGU8X2/mLP9JiIL1opuKjHUNM30+dq/DbhCDVTWgiwxy9JeXMIP3fko0ghUGz nu6NmZzpO/7SSf17n7XWNggoa7eaLs6AuI6tnjfHAnjldRHK5kMbfsl8LEoWj+PQDupG Z9Lw== X-Gm-Message-State: AJcUukeHsXl7v/AT4VXcJzNmbEv7aY5qRsUAVwq+esojw2H1ujpPY3Hw PM0xAkpNUvOwN9HzxWZFSvUaFte/ X-Google-Smtp-Source: ALg8bN6cDyKlnXzk+wZ9X+csmkBK5dgrmEV/FE+AHvp1QHCJMw7+KQMakOLae8cp7DoOhlKymM0Ipw== X-Received: by 2002:a7b:c08f:: with SMTP id r15mr6078023wmh.118.1548406518777; Fri, 25 Jan 2019 00:55:18 -0800 (PST) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id m4sm40314763wml.2.2019.01.25.00.55.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 00:55:17 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 24 Jan 2019 22:45:54 +0000 From: Edward Tomasz Napierala To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343416 - head/bin/sh Message-ID: <20190124224554.GA23558@v2> Mail-Followup-To: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901242334.x0ONYpNU047048@repo.freebsd.org> <201901242355.x0ONt4Xl085460@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201901242355.x0ONt4Xl085460@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 854A170741 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.962,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 08:55:21 -0000 On 0124T1555, Rodney W. Grimes wrote: > > Author: trasz > > Date: Thu Jan 24 23:34:51 2019 > > New Revision: 343416 > > URL: https://svnweb.freebsd.org/changeset/base/343416 > > > > Log: > > Install .shrc for root, and set PS1 for the toor account. > > And a dozen other aliases :-( Six, and they are exactly the same as for ordinary users. But yeah, I can see the point of not defining any aliases by default for the root user. Would the change be acceptable if the aliases were commented out? This would be still quite close to the situation for csh. > Please do not contaiminate the prestine environment with > personal preferences. In the start of the project we > did a great deal of work to remove and eliminate these > types of things, only the few csh aliases where retained. Indeed, and those are pretty much the same aliases. > This is really the domain of a systems administrator to > decide and making work for them to clean this out is > not going to make them happy. Problem is, we're in a strage situation where we ship with root shell which is just broken - basic shell syntax doesn't work - and the out-of-box alternative provides you with a VMS prompt. Not the best first impression to make, I'd say. [..] From owner-svn-src-head@freebsd.org Fri Jan 25 11:24:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B85214B1710; Fri, 25 Jan 2019 11:24:45 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 417DC7659A; Fri, 25 Jan 2019 11:24:44 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0PBOdI8088151; Fri, 25 Jan 2019 03:24:39 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0PBOd7i088150; Fri, 25 Jan 2019 03:24:39 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901251124.x0PBOd7i088150@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343416 - head/bin/sh In-Reply-To: <20190124224554.GA23558@v2> To: Edward Tomasz Napierala Date: Fri, 25 Jan 2019 03:24:39 -0800 (PST) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 417DC7659A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.950,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 11:24:45 -0000 > On 0124T1555, Rodney W. Grimes wrote: > > > Author: trasz > > > Date: Thu Jan 24 23:34:51 2019 > > > New Revision: 343416 > > > URL: https://svnweb.freebsd.org/changeset/base/343416 > > > > > > Log: > > > Install .shrc for root, and set PS1 for the toor account. > > > > And a dozen other aliases :-( > > Six, and they are exactly the same as for ordinary users. Your right, I drifted to hyperbolie on that, but 1 is too many in this case. > But yeah, I can see the point of not defining any aliases > by default for the root user. Would the change be acceptable > if the aliases were commented out? This would be still quite > close to the situation for csh. There is also the issue that we are now going to open 1 more file every time an interactive /bin/sh is spawned, and that file is full of comments, to me thats a waste of cycles for probably 95% of the systems out there. People that want a Borne shell type interactive shell invariable choose bash, ksh or some other shell, not our /bin/sh which is lean mean and a fast machine because the base system uses it so much. > > > Please do not contaiminate the prestine environment with > > personal preferences. In the start of the project we > > did a great deal of work to remove and eliminate these > > types of things, only the few csh aliases where retained. > > Indeed, and those are pretty much the same aliases. But those alias have never been there for sh, the few we did keep was for historerical history, they had been in roots .cshrc for a decade and people got upset when we tried to remove them, thus we settled on just the few people stated as being the most wanted and used. I am sure there are a few of us around that would actually like to see the ones left go away and view them as contamination to what should be the domain of a site administrator or personal taste. Just as some of us would really rather have cd home return the proper error rather than doing some magic when there is not a ./home to cd into. And having ls .. ; cd ..; ls give 2 different outputs is just.. well something that should confuse the heck out of a new user, yet seems completely fine to have in the system. Note the above becomes a fatal mistake when the second ls is a rm with wild cards. Howerver I do understand the need to assist the new person or less informed that do not pack an emacs size environment with them that there are nifty things they can do to make life easier. Perhaps making more extensive comments in the skel files, or even adding pointers in them to a set of /usr/share/example/ files? Perhaps pointers in roots .files to the skel files as "for a better example of what can be done in this file see foo". > > > This is really the domain of a systems administrator to > > decide and making work for them to clean this out is > > not going to make them happy. > > Problem is, we're in a strage situation where we ship with > root shell which is just broken - basic shell syntax doesn't > work - and the out-of-box alternative provides you with > a VMS prompt. Not the best first impression to make, I'd say. Huh? Now I think you have gone off the other end, would you please explain how some alias in .shrc fix anything broken with /bin/sh or roots use of it? Can you expand on exactly what syntax this commit fixes please? And FYI, the $ prompt from a unix /bin/sh predates VMS by a decade or so, so VMS copied unix on that one. And historically interactive prompts have been 1 character since.. well.. interactive prompts appeared. . . .r pip/l I miss my OS/8 ".". :-) -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 25 12:41:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C186714B4977; Fri, 25 Jan 2019 12:41:22 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2AC08186B; Fri, 25 Jan 2019 12:41:21 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-oi1-f169.google.com with SMTP id i6so7552050oia.6; Fri, 25 Jan 2019 04:41:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=QOGB2izpsZbU07zr/Gvc3tYA1fYdpaUtfdFmFx5oxlo=; b=FgFxw+LtH/T0xN1Zu+daRPxwb8jxcMbttSZsSEOKCvoGwiiJLnA8vI3yloqRZVY9ai 9Ylc2CWYbzfh2sdjgsyEOy6RXZCuodsqmpsKUh8m7X0Tp4H6BaKFfZllcvCnUtSiDz2r 8WSiWqR1L7ahQl3jgHYNELmpI9aqZjvSQ+mcmjng+JXmnQ3E/BOS+HgvTdunrsYPLFc/ GNDfIX8oJpS5qXhYRQ20jRnMknEcXw/XF6YRGPRqNNfZ0re/HCWxTYvD4UglWZkLp4jP WBI+2yGfUd++5jOb7cGuUTCMCnHvAbpA9RCjSdWLD6Z6o0GAyGmToG3tEQ6k7pYY0/Sn w37Q== X-Gm-Message-State: AJcUukdlrj5tbzGpmZMBNkgW0CZLkpvAadMrlrIu7MSgamSnBlp+2T2U zM8Tk56RSdjbb6OJ63aUKeZpQdcpAH7HHv3/PlBGoPNO X-Google-Smtp-Source: ALg8bN6DNxCv6icTAKzkfv2p17t+p8vyUnHE/OqhyCtaoPDOcXXQ22anP743Ettd/WAcLzEzSPj9Nobm/DWIOoIPT/Q= X-Received: by 2002:aca:e884:: with SMTP id f126mr1270075oih.181.1548420074877; Fri, 25 Jan 2019 04:41:14 -0800 (PST) MIME-Version: 1.0 References: <20190124224554.GA23558@v2> <201901251124.x0PBOd7i088150@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201901251124.x0PBOd7i088150@pdx.rh.CN85.dnsmgr.net> From: Edward Napierala Date: Fri, 25 Jan 2019 12:41:03 +0000 Message-ID: Subject: Re: svn commit: r343416 - head/bin/sh To: rgrimes@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: F2AC08186B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.927,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 12:41:23 -0000 pt., 25 sty 2019 o 11:24 Rodney W. Grimes napisa=C5=82(a): > > > On 0124T1555, Rodney W. Grimes wrote: > > > > Author: trasz > > > > Date: Thu Jan 24 23:34:51 2019 > > > > New Revision: 343416 > > > > URL: https://svnweb.freebsd.org/changeset/base/343416 > > > > > > > > Log: > > > > Install .shrc for root, and set PS1 for the toor account. > > > > > > And a dozen other aliases :-( > > > > Six, and they are exactly the same as for ordinary users. > > Your right, I drifted to hyperbolie on that, > but 1 is too many in this case. Okay, I don't have a problem with removing the default aliases. (And from all the aliases that are actually there in the default shrc, the only one I actually do like and use is "ll"). > > But yeah, I can see the point of not defining any aliases > > by default for the root user. Would the change be acceptable > > if the aliases were commented out? This would be still quite > > close to the situation for csh. > > There is also the issue that we are now going to open 1 > more file every time an interactive /bin/sh is spawned, > and that file is full of comments, to me thats a waste > of cycles for probably 95% of the systems out there. True, but I don't think that's even measurable, at least for interactive shells (as opposed to shells used to run scripts, for which the commit changes nothing). > People that want a Borne shell type interactive shell > invariable choose bash, ksh or some other shell, not > our /bin/sh which is lean mean and a fast machine > because the base system uses it so much. That's true. But we discourage using shells from ports/packages as root shell. The easiest thing for a new user to do if they want a Bourne-compatible shell for root is to just use chsh(1). And here's what happens: you get greeted with an alien-looking (new folks usually come from Linux or OSX background) '$' prompt. Which is not a problem, of course, just define PS1, and perhaps some aliases, in a newly created /root/.shrc. Except... that doesn't work, despite the fact that it works just fine for accounts other than root, and that's also how you would fix it with bash. And then you end up having to read the sh(1) manual page to discover the ENV. > > > Please do not contaiminate the prestine environment with > > > personal preferences. In the start of the project we > > > did a great deal of work to remove and eliminate these > > > types of things, only the few csh aliases where retained. > > > > Indeed, and those are pretty much the same aliases. > > But those alias have never been there for sh, the few > we did keep was for historerical history, they had been > in roots .cshrc for a decade and people got upset when > we tried to remove them, thus we settled on just the > few people stated as being the most wanted and used. They are there in share/skel/dot.shrc, just not for root. But again - I agree regarding the aliases. > I am sure there are a few of us around that would actually > like to see the ones left go away and view them as contamination > to what should be the domain of a site administrator or > personal taste. > > Just as some of us would really rather have > cd home > return the proper error rather than doing some > magic when there is not a ./home to cd into. > And having ls .. ; cd ..; ls give 2 different outputs > is just.. well something that should confuse the > heck out of a new user, yet seems completely fine > to have in the system. Note the above becomes > a fatal mistake when the second ls is a rm > with wild cards. That's a historical mistake we can't really fix, I'm afraid, unless we want to break compatibility with other systems. > Howerver I do understand the need to assist the new person > or less informed that do not pack an emacs size environment > with them that there are nifty things they can do > to make life easier. Perhaps making more extensive > comments in the skel files, or even adding pointers in them > to a set of /usr/share/example/ files? Perhaps pointers > in roots .files to the skel files as "for a better example > of what can be done in this file see foo". I'd expect pretty much every user new to FreeBSD to already know about what they can do with shell files. And there's plenty of advice for that too, including the sources mentioned by Cy. There are two things, however: first, they don't neccessarily know about things specific to FreeBSD sh(1), such as requiring the ENV to be set to actually read the ~/.shrc. And second, it's just nice to new users to make stuff just a tiny bit more familiar looking. This includes installing the file they can edit (/root/.shrc), and setting the prompt to something that resembles other systems. That's exactly what we do for csh(1). > > > This is really the domain of a systems administrator to > > > decide and making work for them to clean this out is > > > not going to make them happy. > > > > Problem is, we're in a strage situation where we ship with > > root shell which is just broken - basic shell syntax doesn't > > work - and the out-of-box alternative provides you with > > a VMS prompt. Not the best first impression to make, I'd say. > > Huh? Now I think you have gone off the other end, > would you please explain how some alias in .shrc fix anything > broken with /bin/sh or roots use of it? > > Can you expand on exactly what syntax this commit fixes please? The way this commit fixes syntax problems of the default root shell (which is csh(1)) is that you can easily change the root shell and end up with something that looks just like before, but this time accepting the Bourne syntax. That's how it works for non-root users; this commit makes the same apply to root. > And FYI, the $ prompt from a unix /bin/sh predates VMS > by a decade or so, so VMS copied unix on that one. And > historically interactive prompts have been 1 character > since.. well.. interactive prompts appeared. > > . > . > .r pip/l > I miss my OS/8 ".". :-) Well, back them it could actually make a lot of sense; with a hardcopy terminal the "." prompt is just easier to ears :-) From owner-svn-src-head@freebsd.org Fri Jan 25 12:58:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 962A514B4F9B for ; Fri, 25 Jan 2019 12:58:50 +0000 (UTC) (envelope-from ram.vegesna@broadcom.com) Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C8078250C for ; Fri, 25 Jan 2019 12:58:49 +0000 (UTC) (envelope-from ram.vegesna@broadcom.com) Received: by mail-lj1-x22c.google.com with SMTP id k15-v6so8274083ljc.8 for ; Fri, 25 Jan 2019 04:58:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=J5vvXaU+VF6Ikajo6H09m/1hX+miWyWTjYfzCL1TMT4=; b=dB7YWWIXF2H9gEMm2kznGJr9auYv20SOzdVNCa8uUpA0cyWLU0HBv/s5ka2/pUmGkI a3DjnPfaAqQnlu7W16vshqSXsqtpgEWVVED+cTpD5UiXzNgxx+1ccQClYCSJuANTggzv yn7hBpYxAWTRK5g1gjMZpS+tMYsA6i3Fqwk+SktjKAG2fzgmf3Ogrcme15xzENfIufuX KtmvrtYOe2ZGv4yKMwbe9LuO35IWymbzoDLaaOr1j2exY88fWHFn5OwTl7naVBJJQcNI ojTlQjsRw8f0PSt569aUEC6B1rMe7rx1xKu73wSL8XEPw4BZcaJNJR0eynQQlQMpsjGV 7CtQ== X-Gm-Message-State: AJcUukc5aomwxPwoeefNKrWQScIEix8GZSIz4S/QspXKBOWQl0kaaNci RAVjoPFKwTEYRk1VEgxYcz2AgkYFUF7v+MVx659XAg== X-Google-Smtp-Source: ALg8bN53TZSciOWO6nlqLHGOYEQykSkUq8eJC4u6RWbQzDdvAIvQUk7e4jcLJp3zqNkZrBCxn+P9Ks3xeczwfGqF9vw= X-Received: by 2002:a2e:80d3:: with SMTP id r19-v6mr9760744ljg.151.1548421127148; Fri, 25 Jan 2019 04:58:47 -0800 (PST) MIME-Version: 1.0 References: <201901231734.x0NHY11I004644@repo.freebsd.org> <201901231857.x0NIvmbS080005@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201901231857.x0NIvmbS080005@pdx.rh.CN85.dnsmgr.net> From: Ram Kishore Vegesna Date: Fri, 25 Jan 2019 18:28:35 +0530 Message-ID: Subject: Re: svn commit: r343349 - head/sys/dev/ocs_fc To: "Rodney W. Grimes" Cc: Ram Kishore Vegesna , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 0C8078250C X-Spamd-Bar: ------- X-Spamd-Result: default: False [-7.69 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[broadcom.com:s=google]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; DWL_DNSWL_LOW(-1.00)[broadcom.com.dwl.dnswl.org : 127.0.9.1]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[broadcom.com:+]; MIME_BASE64_TEXT(0.10)[]; DMARC_POLICY_ALLOW(-0.50)[broadcom.com,quarantine]; RCVD_IN_DNSWL_NONE(0.00)[c.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; IP_SCORE(-2.79)[ip: (-9.72), ipnet: 2a00:1450::/32(-2.23), asn: 15169(-1.92), country: US(-0.08)]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,aspmx.l.google.com,alt3.aspmx.l.google.com,alt2.aspmx.l.google.com,alt4.aspmx.l.google.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 12:58:51 -0000 Hi Rodney, I fixed many coverity tool warnings as part of this commit. Adding all the warnings and fix details seemed over kill. I will use a better commit message when I do MFC commit of this revision. Thanks, Ram On Thu, Jan 24, 2019 at 12:28 AM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > Author: ram > > Date: Wed Jan 23 17:34:01 2019 > > New Revision: 343349 > > URL: https://svnweb.freebsd.org/changeset/base/343349 > > > > Log: > > Fixed issues reported by coverity scan. > > The quality of this commit message is rather low, > it should of at least included some details about > what was wrong, why it was wrong, and how it was > fixed. > > Thanks, > Rod > > > > Approved by: mav > > MFC after: 3 weeks > > > > Modified: > > head/sys/dev/ocs_fc/ocs_cam.c > > head/sys/dev/ocs_fc/ocs_hw.c > > head/sys/dev/ocs_fc/ocs_hw_queues.c > > head/sys/dev/ocs_fc/ocs_ioctl.c > > head/sys/dev/ocs_fc/ocs_mgmt.c > > head/sys/dev/ocs_fc/ocs_node.c > > head/sys/dev/ocs_fc/ocs_pci.c > > head/sys/dev/ocs_fc/ocs_xport.c > > head/sys/dev/ocs_fc/sli4.c > > > > Modified: head/sys/dev/ocs_fc/ocs_cam.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -1164,15 +1164,24 @@ ocs_scsi_del_target(ocs_node_t *node, > ocs_scsi_del_tar > > struct ocs_softc *ocs = node->ocs; > > ocs_fcport *fcp = NULL; > > ocs_fc_target_t *tgt = NULL; > > - uint32_t tgt_id; > > + int32_t tgt_id; > > > > + if (ocs == NULL) { > > + ocs_log_err(ocs,"OCS is NULL \n"); > > + return -1; > > + } > > + > > fcp = node->sport->tgt_data; > > if (fcp == NULL) { > > ocs_log_err(ocs,"FCP is NULL \n"); > > - return 0; > > + return -1; > > } > > > > tgt_id = ocs_tgt_find(fcp, node); > > + if (tgt_id == -1) { > > + ocs_log_err(ocs,"target is invalid\n"); > > + return -1; > > + } > > > > tgt = &fcp->tgt[tgt_id]; > > > > @@ -1781,13 +1790,9 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb > *ccb > > ocs_io_t *io = NULL; > > ocs_scsi_sgl_t sgl[OCS_FC_MAX_SGL]; > > int32_t sgl_count; > > + ocs_fcport *fcp; > > > > - ocs_fcport *fcp = NULL; > > fcp = FCPORT(ocs, cam_sim_bus(xpt_path_sim((ccb)->ccb_h.path))); > > - if (fcp == NULL) { > > - device_printf(ocs->dev, "%s: fcp is NULL\n", __func__); > > - return -1; > > - } > > > > if (fcp->tgt[ccb_h->target_id].state == OCS_TGT_STATE_LOST) { > > device_printf(ocs->dev, "%s: device LOST %d\n", __func__, > > @@ -2250,8 +2255,11 @@ ocs_action(struct cam_sim *sim, union ccb *ccb) > > } > > case XPT_RESET_BUS: > > if (ocs_xport_control(ocs->xport, OCS_XPORT_PORT_OFFLINE) > == 0) { > > - ocs_xport_control(ocs->xport, > OCS_XPORT_PORT_ONLINE); > > - > > + rc = ocs_xport_control(ocs->xport, > OCS_XPORT_PORT_ONLINE); > > + if (rc) { > > + ocs_log_debug(ocs, "Failed to bring port > online" > > + " : %d\n", > rc); > > + } > > ocs_set_ccb_status(ccb, CAM_REQ_CMP); > > } else { > > ocs_set_ccb_status(ccb, CAM_REQ_CMP_ERR); > > > > Modified: head/sys/dev/ocs_fc/ocs_hw.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/ocs_hw.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/ocs_hw.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -242,10 +242,7 @@ ocs_hw_get_num_chutes(ocs_hw_t *hw) > > static ocs_hw_rtn_e > > ocs_hw_link_event_init(ocs_hw_t *hw) > > { > > - if (hw == NULL) { > > - ocs_log_err(hw->os, "bad parameter hw=%p\n", hw); > > - return OCS_HW_RTN_ERROR; > > - } > > + ocs_hw_assert(hw); > > > > hw->link.status = SLI_LINK_STATUS_MAX; > > hw->link.topology = SLI_LINK_TOPO_NONE; > > @@ -1757,6 +1754,7 @@ ocs_hw_get(ocs_hw_t *hw, ocs_hw_property_e prop, > uint3 > > break; > > case OCS_HW_MAX_VPORTS: > > *value = sli_get_max_rsrc(&hw->sli, SLI_RSRC_FCOE_VPI); > > + break; > > default: > > ocs_log_test(hw->os, "unsupported property %#x\n", prop); > > rc = OCS_HW_RTN_ERROR; > > @@ -1996,6 +1994,7 @@ ocs_hw_set(ocs_hw_t *hw, ocs_hw_property_e prop, > uint3 > > break; > > case OCS_ESOC: > > hw->config.esoc = value; > > + break; > > case OCS_HW_HIGH_LOGIN_MODE: > > rc = sli_set_hlm(&hw->sli, value); > > break; > > @@ -4395,7 +4394,7 @@ ocs_hw_send_frame(ocs_hw_t *hw, fc_header_le_t > *hdr, u > > > > OCS_STAT(wq->use_count++); > > > > - return rc ? OCS_HW_RTN_ERROR : OCS_HW_RTN_SUCCESS; > > + return OCS_HW_RTN_SUCCESS; > > } > > > > ocs_hw_rtn_e > > @@ -4696,7 +4695,7 @@ ocs_hw_io_overflow_sgl(ocs_hw_t *hw, ocs_hw_io_t > *io) > > } > > > > /* fail if we don't have an overflow SGL registered */ > > - if (io->ovfl_sgl == NULL) { > > + if (io->ovfl_io == NULL || io->ovfl_sgl == NULL) { > > return OCS_HW_RTN_ERROR; > > } > > > > @@ -6321,6 +6320,11 @@ ocs_hw_config_watchdog_timer(ocs_hw_t *hw) > > ocs_hw_rtn_e rc = OCS_HW_RTN_SUCCESS; > > uint8_t *buf = ocs_malloc(hw->os, SLI4_BMBX_SIZE, OCS_M_NOWAIT); > > > > + if (!buf) { > > + ocs_log_err(hw->os, "no buffer for command\n"); > > + return OCS_HW_RTN_NO_MEMORY; > > + } > > + > > sli4_cmd_lowlevel_set_watchdog(&hw->sli, buf, SLI4_BMBX_SIZE, > hw->watchdog_timeout); > > rc = ocs_hw_command(hw, buf, OCS_CMD_NOWAIT, > ocs_hw_cb_cfg_watchdog, NULL); > > if (rc) { > > @@ -8486,7 +8490,14 @@ ocs_hw_cq_process(ocs_hw_t *hw, hw_cq_t *cq) > > break; > > case SLI_QENTRY_WQ_RELEASE: { > > uint32_t wq_id = rid; > > - uint32_t index = > ocs_hw_queue_hash_find(hw->wq_hash, wq_id); > > + int32_t index = > ocs_hw_queue_hash_find(hw->wq_hash, wq_id); > > + > > + if (unlikely(index < 0)) { > > + ocs_log_err(hw->os, "unknown idx=%#x > rid=%#x\n", > > + index, rid); > > + break; > > + } > > + > > hw_wq_t *wq = hw->hw_wq[index]; > > > > /* Submit any HW IOs that are on the WQ pending > list */ > > @@ -9300,7 +9311,8 @@ ocs_hw_cb_link(void *ctx, void *e) > > > > hw->link.status = event->status; > > > > - for (i = 0; d = hw->domains[i], i < SLI4_MAX_FCFI; i++) { > > + for (i = 0; i < SLI4_MAX_FCFI; i++) { > > + d = hw->domains[i]; > > if (d != NULL && > > hw->callback.domain != NULL) { > > hw->callback.domain(hw->args.domain, > OCS_HW_DOMAIN_LOST, d); > > @@ -9322,6 +9334,9 @@ ocs_hw_cb_fip(void *ctx, void *e) > > ocs_domain_t *domain = NULL; > > sli4_fip_event_t *event = e; > > > > + ocs_hw_assert(event); > > + ocs_hw_assert(hw); > > + > > /* Find the associated domain object */ > > if (event->type == SLI4_FCOE_FIP_FCF_CLEAR_VLINK) { > > ocs_domain_t *d = NULL; > > @@ -9330,7 +9345,8 @@ ocs_hw_cb_fip(void *ctx, void *e) > > /* Clear VLINK is different from the other FIP events as > it passes back > > * a VPI instead of a FCF index. Check all attached SLI > ports for a > > * matching VPI */ > > - for (i = 0; d = hw->domains[i], i < SLI4_MAX_FCFI; i++) { > > + for (i = 0; i < SLI4_MAX_FCFI; i++) { > > + d = hw->domains[i]; > > if (d != NULL) { > > ocs_sport_t *sport = NULL; > > > > @@ -11202,6 +11218,7 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t > status, > > ocs_hw_io_t *io_next = NULL; > > uint64_t ticks_current = ocs_get_os_ticks(); > > uint32_t sec_elapsed; > > + ocs_hw_rtn_e rc; > > > > sli4_mbox_command_header_t *hdr = (sli4_mbox_command_header_t > *)mqe; > > > > @@ -11213,34 +11230,39 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t > status, > > > > /* loop through active WQE list and check for timeouts */ > > ocs_lock(&hw->io_lock); > > - ocs_list_foreach_safe(&hw->io_timed_wqe, io, io_next) { > > - sec_elapsed = ((ticks_current - io->submit_ticks) > / ocs_get_os_tick_freq()); > > + ocs_list_foreach_safe(&hw->io_timed_wqe, io, io_next) { > > + sec_elapsed = ((ticks_current - io->submit_ticks) / > ocs_get_os_tick_freq()); > > > > - /* > > - * If elapsed time > timeout, abort it. No need to > check type since > > - * it wouldn't be on this list unless it was a > target WQE > > - */ > > - if (sec_elapsed > io->tgt_wqe_timeout) { > > - ocs_log_test(hw->os, "IO timeout xri=0x%x > tag=0x%x type=%d\n", > > - io->indicator, io->reqtag, > io->type); > > + /* > > + * If elapsed time > timeout, abort it. No need to check > type since > > + * it wouldn't be on this list unless it was a target WQE > > + */ > > + if (sec_elapsed > io->tgt_wqe_timeout) { > > + ocs_log_test(hw->os, "IO timeout xri=0x%x tag=0x%x > type=%d\n", > > + io->indicator, io->reqtag, io->type); > > > > - /* remove from active_wqe list so won't > try to abort again */ > > - ocs_list_remove(&hw->io_timed_wqe, io); > > + /* remove from active_wqe list so won't try to > abort again */ > > + ocs_list_remove(&hw->io_timed_wqe, io); > > > > - /* save status of "timed out" for when > abort completes */ > > - io->status_saved = 1; > > - io->saved_status = > SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT; > > - io->saved_ext = 0; > > - io->saved_len = 0; > > + /* save status of "timed out" for when abort > completes */ > > + io->status_saved = 1; > > + io->saved_status = > SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT; > > + io->saved_ext = 0; > > + io->saved_len = 0; > > > > - /* now abort outstanding IO */ > > - ocs_hw_io_abort(hw, io, FALSE, NULL, NULL); > > + /* now abort outstanding IO */ > > + rc = ocs_hw_io_abort(hw, io, FALSE, NULL, NULL); > > + if (rc) { > > + ocs_log_test(hw->os, > > + "abort failed xri=%#x tag=%#x > rc=%d\n", > > + io->indicator, io->reqtag, rc); > > } > > - /* > > - * need to go through entire list since each IO > could have a > > - * different timeout value > > - */ > > } > > + /* > > + * need to go through entire list since each IO could have > a > > + * different timeout value > > + */ > > + } > > ocs_unlock(&hw->io_lock); > > > > /* if we're not in the middle of shutting down, schedule next > timer */ > > > > Modified: head/sys/dev/ocs_fc/ocs_hw_queues.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/ocs_hw_queues.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/ocs_hw_queues.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -149,13 +149,16 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t > *qtop) > > default_lengths[QTOP_CQ] = len; > > break; > > } > > + > > + if (!eq || !next_qt) { > > + goto fail; > > + } > > > > /* If this CQ is for MRQ, then delay the creation > */ > > if (!use_mrq || next_qt->entry != QTOP_RQ) { > > cq = hw_new_cq(eq, len); > > if (cq == NULL) { > > - hw_queue_teardown(hw); > > - return OCS_HW_RTN_NO_MEMORY; > > + goto fail; > > } > > } > > break; > > @@ -173,11 +176,13 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t > *qtop) > > hw_queue_teardown(hw); > > return OCS_HW_RTN_NO_MEMORY; > > } > > + > > + if (cq == NULL) > > + goto fail; > > > > wq = hw_new_wq(cq, len, qt->class, hw->ulp_start + > qt->ulp); > > if (wq == NULL) { > > - hw_queue_teardown(hw); > > - return OCS_HW_RTN_NO_MEMORY; > > + goto fail; > > } > > > > /* Place this WQ on the EQ WQ array */ > > @@ -249,10 +254,12 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t > *qtop) > > break; > > } > > > > + if (cq == NULL) > > + goto fail; > > + > > mq = hw_new_mq(cq, len); > > if (mq == NULL) { > > - hw_queue_teardown(hw); > > - return OCS_HW_RTN_NO_MEMORY; > > + goto fail; > > } > > break; > > > > @@ -332,6 +339,9 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) > > } > > > > return OCS_HW_RTN_SUCCESS; > > +fail: > > + hw_queue_teardown(hw); > > + return OCS_HW_RTN_NO_MEMORY; > > > > } > > > > @@ -737,8 +747,9 @@ error: > > for (i = 0; i < num_rq_pairs; i++) { > > if (rqs[i] != NULL) { > > if (rqs[i]->rq_tracker != NULL) { > > - ocs_free(hw->os, rq->rq_tracker, > > - sizeof(ocs_hw_sequence_t*) * > rq->entry_count); > > + ocs_free(hw->os, rqs[i]->rq_tracker, > > + sizeof(ocs_hw_sequence_t*) * > > + rqs[i]->entry_count); > > } > > ocs_free(hw->os, rqs[i], sizeof(*rqs[i])); > > } > > @@ -861,9 +872,9 @@ hw_del_wq(hw_wq_t *wq) > > void > > hw_del_rq(hw_rq_t *rq) > > { > > - ocs_hw_t *hw = rq->cq->eq->hw; > > > > if (rq != NULL) { > > + ocs_hw_t *hw = rq->cq->eq->hw; > > /* Free RQ tracker */ > > if (rq->rq_tracker != NULL) { > > ocs_free(hw->os, rq->rq_tracker, > sizeof(ocs_hw_sequence_t*) * rq->entry_count); > > > > Modified: head/sys/dev/ocs_fc/ocs_ioctl.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/ocs_ioctl.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/ocs_ioctl.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -243,9 +243,13 @@ ocs_process_mbx_ioctl(ocs_t *ocs, > ocs_ioctl_elxu_mbox_ > > * 6. ioctl code releases the lock > > */ > > mtx_lock(&ocs->dbg_lock); > > - ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, > > - __ocs_ioctl_mbox_cb, ocs); > > - msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); > > + if (ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, > > + __ocs_ioctl_mbox_cb, ocs)) { > > + > > + device_printf(ocs->dev, "%s: command- %x failed\n", > __func__, > > + ((sli4_mbox_command_header_t > *)mcmd->payload)->command); > > + } > > + msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); > > mtx_unlock(&ocs->dbg_lock); > > > > if( SLI4_MBOX_COMMAND_SLI_CONFIG == ((sli4_mbox_command_header_t > *)mcmd->payload)->command > > > > Modified: head/sys/dev/ocs_fc/ocs_mgmt.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -2129,7 +2129,7 @@ set_port_protocol(ocs_t *ocs, char *name, char > *value) > > if (ocs_sem_p(&(result.semaphore), OCS_SEM_FOREVER) != 0) { > > /* Undefined failure */ > > ocs_log_err(ocs, "ocs_sem_p failed\n"); > > - rc = -ENXIO; > > + return -ENXIO; > > } > > if (result.status == 0) { > > /* Success. */ > > @@ -2321,7 +2321,7 @@ set_active_profile(ocs_t *ocs, char *name, char > *value > > if (ocs_sem_p(&(result.semaphore), OCS_SEM_FOREVER) != 0) { > > /* Undefined failure */ > > ocs_log_err(ocs, "ocs_sem_p failed\n"); > > - rc = -ENXIO; > > + return -ENXIO; > > } > > if (result.status == 0) { > > /* Success. */ > > @@ -2527,8 +2527,8 @@ set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) > > char *wwpn_p = NULL; > > char *wwnn_p = NULL; > > int32_t rc = -1; > > - int wwpn; > > - int wwnn; > > + int wwpn = 0; > > + int wwnn = 0; > > int i; > > > > /* This is a read-modify-write operation, so first we have to read > > @@ -2556,8 +2556,13 @@ set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) > > wwnn_p = wwn_p; > > } > > > > - wwpn = ocs_strcmp(wwpn_p, "NA"); > > - wwnn = ocs_strcmp(wwnn_p, "NA"); > > + if (wwpn_p != NULL) { > > + wwpn = ocs_strcmp(wwpn_p, "NA"); > > + } > > + > > + if (wwnn_p != NULL) { > > + wwnn = ocs_strcmp(wwnn_p, "NA"); > > + } > > > > /* Parse the new WWPN */ > > if ((wwpn_p != NULL) && (wwpn != 0)) { > > > > Modified: head/sys/dev/ocs_fc/ocs_node.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/ocs_node.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/ocs_node.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -253,7 +253,7 @@ ocs_node_create_pool(ocs_t *ocs, uint32_t node_count) > > > > if (0 == ocs_hw_get(&ocs->hw, OCS_HW_MAX_SGE, &max_sge) && > > 0 == ocs_hw_get(&ocs->hw, OCS_HW_N_SGL, &num_sgl)) { > > - max_xfer_size = max_sge * num_sgl; > > + max_xfer_size = (max_sge * (uint64_t)num_sgl); > > } else { > > max_xfer_size = 65536; > > } > > > > Modified: head/sys/dev/ocs_fc/ocs_pci.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/ocs_pci.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/ocs_pci.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -591,7 +591,7 @@ ocs_device_detach(ocs_t *ocs) > > } > > > > ocs_cam_detach(ocs); > > - ocs_free(ocs, ocs->fcports, sizeof(ocs->fcports)); > > + ocs_free(ocs, ocs->fcports, sizeof(*(ocs->fcports))); > > > > for (i = 0; (io = ocs_io_get_instance(ocs, i)); i++) { > > if (bus_dmamap_destroy(ocs->buf_dmat, > io->tgt_io.dmap)) { > > > > Modified: head/sys/dev/ocs_fc/ocs_xport.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/ocs_xport.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/ocs_xport.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -292,10 +292,6 @@ ocs_xport_attach_cleanup: > > ocs_node_free_pool(ocs); > > } > > > > - if (rq_threads_created) { > > - ocs_xport_rq_threads_teardown(xport); > > - } > > - > > return -1; > > } > > > > > > Modified: head/sys/dev/ocs_fc/sli4.c > > > ============================================================================== > > --- head/sys/dev/ocs_fc/sli4.c Wed Jan 23 17:28:39 2019 > (r343348) > > +++ head/sys/dev/ocs_fc/sli4.c Wed Jan 23 17:34:01 2019 > (r343349) > > @@ -1867,10 +1867,7 @@ sli_cmd_common_create_cq(sli4_t *sli4, void *buf, > size > > } > > } > > break; > > - default: > > - ocs_log_test(sli4->os, "unsupported IF_TYPE %d\n", > if_type); > > - return -1; > > - } > > + } > > > > return (sli_config_off + cmd_size); > > } > > @@ -4637,6 +4634,8 @@ sli_cq_alloc_set(sli4_t *sli4, sli4_queue_t *qs[], > uin > > return -1; > > } > > > > + memset(&dma, 0, sizeof(dma)); > > + > > /* Align the queue DMA memory */ > > for (i = 0; i < num_cqs; i++) { > > if (__sli_queue_init(sli4, qs[i], SLI_QTYPE_CQ, > SLI4_CQE_BYTES, > > @@ -4886,7 +4885,7 @@ sli_queue_reset(sli4_t *sli4, sli4_queue_t *q) > > } > > > > if (q->dma.virt != NULL) { > > - ocs_memset(q->dma.virt, 0, (q->size * q->length)); > > + ocs_memset(q->dma.virt, 0, (q->size * > (uint64_t)q->length)); > > } > > > > ocs_unlock(&q->lock); > > @@ -8479,6 +8478,8 @@ sli_fc_rq_set_alloc(sli4_t *sli4, uint32_t > num_rq_pair > > ocs_dma_t dma; > > sli4_res_common_create_queue_set_t *rsp = NULL; > > sli4_req_fcoe_rq_create_v2_t *req = NULL; > > + > > + ocs_memset(&dma, 0, sizeof(dma)); > > > > for (i = 0; i < (num_rq_pairs * 2); i++) { > > if (__sli_queue_init(sli4, qs[i], SLI_QTYPE_RQ, > SLI4_FCOE_RQE_SIZE, > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Fri Jan 25 13:39:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9633414B5F3B; Fri, 25 Jan 2019 13:39:10 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0CA483BE1; Fri, 25 Jan 2019 13:39:09 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0PDd5gG088602; Fri, 25 Jan 2019 05:39:05 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0PDd5sG088601; Fri, 25 Jan 2019 05:39:05 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901251339.x0PDd5sG088601@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343416 - head/bin/sh In-Reply-To: To: Edward Napierala Date: Fri, 25 Jan 2019 05:39:05 -0800 (PST) CC: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: B0CA483BE1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 13:39:10 -0000 > pt., 25 sty 2019 o 11:24 Rodney W. Grimes > napisa?(a): > > > > > On 0124T1555, Rodney W. Grimes wrote: > > > > > Author: trasz > > > > > Date: Thu Jan 24 23:34:51 2019 > > > > > New Revision: 343416 > > > > > URL: https://svnweb.freebsd.org/changeset/base/343416 > > > > > > > > > > Log: > > > > > Install .shrc for root, and set PS1 for the toor account. > > > > > > > > And a dozen other aliases :-( > > > > > > Six, and they are exactly the same as for ordinary users. > > > > Your right, I drifted to hyperbolie on that, > > but 1 is too many in this case. > > Okay, I don't have a problem with removing the default aliases. > (And from all the aliases that are actually there in the default shrc, > the only one I actually do like and use is "ll"). > > > > But yeah, I can see the point of not defining any aliases > > > by default for the root user. Would the change be acceptable > > > if the aliases were commented out? This would be still quite > > > close to the situation for csh. > > > > There is also the issue that we are now going to open 1 > > more file every time an interactive /bin/sh is spawned, > > and that file is full of comments, to me thats a waste > > of cycles for probably 95% of the systems out there. > > True, but I don't think that's even measurable, at least for > interactive shells (as opposed to shells used to run scripts, > for which the commit changes nothing). > > > People that want a Borne shell type interactive shell > > invariable choose bash, ksh or some other shell, not > > our /bin/sh which is lean mean and a fast machine > > because the base system uses it so much. > > That's true. But we discourage using shells from ports/packages > as root shell. I am not so sure on that, it use to be more so because /bin/sh was statically linked and needed no lib's to run, well that is gone out the window. There is also the issue that other shells are installed into /usr/local/bin, which may or may not be mounted (less likely now that zfs and be's are all the rage.) Most of the reasons to discourage a pkg root shell are now gone. > The easiest thing for a new user to do if they want > a Bourne-compatible shell for root is to just use chsh(1). And > here's what happens: you get greeted with an alien-looking > (new folks usually come from Linux or OSX background) '$' If that is alien looking then they need some education on how the tool they are using works and how to use it. > prompt. Which is not a problem, of course, just define PS1, > and perhaps some aliases, in a newly created /root/.shrc. > Except... that doesn't work, despite the fact that it works just > fine for accounts other than root, and that's also how you would > fix it with bash. And then you end up having to read the sh(1) > manual page to discover the ENV. Or read the .profile of there user account and actually understand some of these details. IMHO this is about user education and rather than dumb the system down we should try to raise the level of knowledge. > > > > > Please do not contaiminate the prestine environment with > > > > personal preferences. In the start of the project we > > > > did a great deal of work to remove and eliminate these > > > > types of things, only the few csh aliases where retained. > > > > > > Indeed, and those are pretty much the same aliases. > > > > But those alias have never been there for sh, the few > > we did keep was for historerical history, they had been > > in roots .cshrc for a decade and people got upset when > > we tried to remove them, thus we settled on just the > > few people stated as being the most wanted and used. > > They are there in share/skel/dot.shrc, just not for root. > But again - I agree regarding the aliases. > > > I am sure there are a few of us around that would actually > > like to see the ones left go away and view them as contamination > > to what should be the domain of a site administrator or > > personal taste. > > > > Just as some of us would really rather have > > cd home > > return the proper error rather than doing some > > magic when there is not a ./home to cd into. > > And having ls .. ; cd ..; ls give 2 different outputs > > is just.. well something that should confuse the > > heck out of a new user, yet seems completely fine > > to have in the system. Note the above becomes > > a fatal mistake when the second ls is a rm > > with wild cards. > > That's a historical mistake we can't really fix, I'm afraid, > unless we want to break compatibility with other systems. I seriously doubt that are a lot of people depending on cd home to do what it does, most would be lazy like me and type cd ~. > > > Howerver I do understand the need to assist the new person > > or less informed that do not pack an emacs size environment > > with them that there are nifty things they can do > > to make life easier. Perhaps making more extensive > > comments in the skel files, or even adding pointers in them > > to a set of /usr/share/example/ files? Perhaps pointers > > in roots .files to the skel files as "for a better example > > of what can be done in this file see foo". > > I'd expect pretty much every user new to FreeBSD to already > know about what they can do with shell files. And there's > plenty of advice for that too, including the sources mentioned > by Cy. > > There are two things, however: first, they don't neccessarily > know about things specific to FreeBSD sh(1), such as requiring > the ENV to be set to actually read the ~/.shrc. Is that only the freebsd shell, I thought most shells need special stuff done to get them to do much more than processes .profile. > > And second, it's just nice to new users to make stuff just a tiny > bit more familiar looking. This includes installing the file they can > edit (/root/.shrc), and setting the prompt to something that > resembles other systems. That's exactly what we do for csh(1). I am ok installing .shrc, I am ok putting a commented ENV in /root/.profile to say uncomment this if you want .shrc to be read for interactive shells. Document document document, but changing the existing very long standing behavior in the name of "just nice to new users" at the cost of agitating many of the current users is no good. As to prompts, well, those are very personalized things and vary more than the colors of bike sheds, best left to the site or personal admin. > > > > This is really the domain of a systems administrator to > > > > decide and making work for them to clean this out is > > > > not going to make them happy. > > > > > > Problem is, we're in a strage situation where we ship with > > > root shell which is just broken - basic shell syntax doesn't > > > work - and the out-of-box alternative provides you with > > > a VMS prompt. Not the best first impression to make, I'd say. > > > > Huh? Now I think you have gone off the other end, > > would you please explain how some alias in .shrc fix anything > > broken with /bin/sh or roots use of it? > > > > Can you expand on exactly what syntax this commit fixes please? > > The way this commit fixes syntax problems of the default root > shell (which is csh(1)) is that you can easily change the root shell > and end up with something that looks just like before, but this > time accepting the Bourne syntax. That's how it works for non-root > users; this commit makes the same apply to root. That is not a syntax problem. That is a difference of the fact that roots environment is pretty sanitary and a users is not, and for good reason on the former. > > > And FYI, the $ prompt from a unix /bin/sh predates VMS > > by a decade or so, so VMS copied unix on that one. And > > historically interactive prompts have been 1 character > > since.. well.. interactive prompts appeared. > > > > . > > . > > .r pip/l > > I miss my OS/8 ".". :-) > > Well, back them it could actually make a lot of sense; with > a hardcopy terminal the "." prompt is just easier to ears :-) -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 25 13:44:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 978FB14B6238; Fri, 25 Jan 2019 13:44:22 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0886840AB; Fri, 25 Jan 2019 13:44:21 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0PDiHvi088638; Fri, 25 Jan 2019 05:44:17 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0PDiGZP088635; Fri, 25 Jan 2019 05:44:16 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901251344.x0PDiGZP088635@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343349 - head/sys/dev/ocs_fc In-Reply-To: To: Ram Kishore Vegesna Date: Fri, 25 Jan 2019 05:44:16 -0800 (PST) CC: "Rodney W. Grimes" , Ram Kishore Vegesna , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: B0886840AB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.937,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 13:44:23 -0000 > Hi Rodney, > > I fixed many coverity tool warnings as part of this commit. Adding all the > warnings and fix details seemed over kill. It seems like overkill when your commiting, but if you have have to go digging through commit history trying to find something it helps a great deal to have good information present there. You do not need to include the output from coverty, but some amount of detail is very helpful. Seeing returns 0 changed into return -1 just seems a strange thing to need to do to fix a static analysis issue. > > I will use a better commit message when I do MFC commit of this revision. Those commits should usually just duplicate the ^head message with a 1 liner at the top that is a MFC: rXXXXXX one line summary of original commit. Original commit message here > Thanks, > Ram > > > > On Thu, Jan 24, 2019 at 12:28 AM Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > Author: ram > > > Date: Wed Jan 23 17:34:01 2019 > > > New Revision: 343349 > > > URL: https://svnweb.freebsd.org/changeset/base/343349 > > > > > > Log: > > > Fixed issues reported by coverity scan. > > > > The quality of this commit message is rather low, > > it should of at least included some details about > > what was wrong, why it was wrong, and how it was > > fixed. > > > > Thanks, > > Rod > > > > > > Approved by: mav > > > MFC after: 3 weeks > > > > > > Modified: > > > head/sys/dev/ocs_fc/ocs_cam.c > > > head/sys/dev/ocs_fc/ocs_hw.c > > > head/sys/dev/ocs_fc/ocs_hw_queues.c > > > head/sys/dev/ocs_fc/ocs_ioctl.c > > > head/sys/dev/ocs_fc/ocs_mgmt.c > > > head/sys/dev/ocs_fc/ocs_node.c > > > head/sys/dev/ocs_fc/ocs_pci.c > > > head/sys/dev/ocs_fc/ocs_xport.c > > > head/sys/dev/ocs_fc/sli4.c > > > > > > Modified: head/sys/dev/ocs_fc/ocs_cam.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/ocs_cam.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -1164,15 +1164,24 @@ ocs_scsi_del_target(ocs_node_t *node, > > ocs_scsi_del_tar > > > struct ocs_softc *ocs = node->ocs; > > > ocs_fcport *fcp = NULL; > > > ocs_fc_target_t *tgt = NULL; > > > - uint32_t tgt_id; > > > + int32_t tgt_id; > > > > > > + if (ocs == NULL) { > > > + ocs_log_err(ocs,"OCS is NULL \n"); > > > + return -1; > > > + } > > > + > > > fcp = node->sport->tgt_data; > > > if (fcp == NULL) { > > > ocs_log_err(ocs,"FCP is NULL \n"); > > > - return 0; > > > + return -1; > > > } > > > > > > tgt_id = ocs_tgt_find(fcp, node); > > > + if (tgt_id == -1) { > > > + ocs_log_err(ocs,"target is invalid\n"); > > > + return -1; > > > + } > > > > > > tgt = &fcp->tgt[tgt_id]; > > > > > > @@ -1781,13 +1790,9 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb > > *ccb > > > ocs_io_t *io = NULL; > > > ocs_scsi_sgl_t sgl[OCS_FC_MAX_SGL]; > > > int32_t sgl_count; > > > + ocs_fcport *fcp; > > > > > > - ocs_fcport *fcp = NULL; > > > fcp = FCPORT(ocs, cam_sim_bus(xpt_path_sim((ccb)->ccb_h.path))); > > > - if (fcp == NULL) { > > > - device_printf(ocs->dev, "%s: fcp is NULL\n", __func__); > > > - return -1; > > > - } > > > > > > if (fcp->tgt[ccb_h->target_id].state == OCS_TGT_STATE_LOST) { > > > device_printf(ocs->dev, "%s: device LOST %d\n", __func__, > > > @@ -2250,8 +2255,11 @@ ocs_action(struct cam_sim *sim, union ccb *ccb) > > > } > > > case XPT_RESET_BUS: > > > if (ocs_xport_control(ocs->xport, OCS_XPORT_PORT_OFFLINE) > > == 0) { > > > - ocs_xport_control(ocs->xport, > > OCS_XPORT_PORT_ONLINE); > > > - > > > + rc = ocs_xport_control(ocs->xport, > > OCS_XPORT_PORT_ONLINE); > > > + if (rc) { > > > + ocs_log_debug(ocs, "Failed to bring port > > online" > > > + " : %d\n", > > rc); > > > + } > > > ocs_set_ccb_status(ccb, CAM_REQ_CMP); > > > } else { > > > ocs_set_ccb_status(ccb, CAM_REQ_CMP_ERR); > > > > > > Modified: head/sys/dev/ocs_fc/ocs_hw.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/ocs_hw.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/ocs_hw.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -242,10 +242,7 @@ ocs_hw_get_num_chutes(ocs_hw_t *hw) > > > static ocs_hw_rtn_e > > > ocs_hw_link_event_init(ocs_hw_t *hw) > > > { > > > - if (hw == NULL) { > > > - ocs_log_err(hw->os, "bad parameter hw=%p\n", hw); > > > - return OCS_HW_RTN_ERROR; > > > - } > > > + ocs_hw_assert(hw); > > > > > > hw->link.status = SLI_LINK_STATUS_MAX; > > > hw->link.topology = SLI_LINK_TOPO_NONE; > > > @@ -1757,6 +1754,7 @@ ocs_hw_get(ocs_hw_t *hw, ocs_hw_property_e prop, > > uint3 > > > break; > > > case OCS_HW_MAX_VPORTS: > > > *value = sli_get_max_rsrc(&hw->sli, SLI_RSRC_FCOE_VPI); > > > + break; > > > default: > > > ocs_log_test(hw->os, "unsupported property %#x\n", prop); > > > rc = OCS_HW_RTN_ERROR; > > > @@ -1996,6 +1994,7 @@ ocs_hw_set(ocs_hw_t *hw, ocs_hw_property_e prop, > > uint3 > > > break; > > > case OCS_ESOC: > > > hw->config.esoc = value; > > > + break; > > > case OCS_HW_HIGH_LOGIN_MODE: > > > rc = sli_set_hlm(&hw->sli, value); > > > break; > > > @@ -4395,7 +4394,7 @@ ocs_hw_send_frame(ocs_hw_t *hw, fc_header_le_t > > *hdr, u > > > > > > OCS_STAT(wq->use_count++); > > > > > > - return rc ? OCS_HW_RTN_ERROR : OCS_HW_RTN_SUCCESS; > > > + return OCS_HW_RTN_SUCCESS; > > > } > > > > > > ocs_hw_rtn_e > > > @@ -4696,7 +4695,7 @@ ocs_hw_io_overflow_sgl(ocs_hw_t *hw, ocs_hw_io_t > > *io) > > > } > > > > > > /* fail if we don't have an overflow SGL registered */ > > > - if (io->ovfl_sgl == NULL) { > > > + if (io->ovfl_io == NULL || io->ovfl_sgl == NULL) { > > > return OCS_HW_RTN_ERROR; > > > } > > > > > > @@ -6321,6 +6320,11 @@ ocs_hw_config_watchdog_timer(ocs_hw_t *hw) > > > ocs_hw_rtn_e rc = OCS_HW_RTN_SUCCESS; > > > uint8_t *buf = ocs_malloc(hw->os, SLI4_BMBX_SIZE, OCS_M_NOWAIT); > > > > > > + if (!buf) { > > > + ocs_log_err(hw->os, "no buffer for command\n"); > > > + return OCS_HW_RTN_NO_MEMORY; > > > + } > > > + > > > sli4_cmd_lowlevel_set_watchdog(&hw->sli, buf, SLI4_BMBX_SIZE, > > hw->watchdog_timeout); > > > rc = ocs_hw_command(hw, buf, OCS_CMD_NOWAIT, > > ocs_hw_cb_cfg_watchdog, NULL); > > > if (rc) { > > > @@ -8486,7 +8490,14 @@ ocs_hw_cq_process(ocs_hw_t *hw, hw_cq_t *cq) > > > break; > > > case SLI_QENTRY_WQ_RELEASE: { > > > uint32_t wq_id = rid; > > > - uint32_t index = > > ocs_hw_queue_hash_find(hw->wq_hash, wq_id); > > > + int32_t index = > > ocs_hw_queue_hash_find(hw->wq_hash, wq_id); > > > + > > > + if (unlikely(index < 0)) { > > > + ocs_log_err(hw->os, "unknown idx=%#x > > rid=%#x\n", > > > + index, rid); > > > + break; > > > + } > > > + > > > hw_wq_t *wq = hw->hw_wq[index]; > > > > > > /* Submit any HW IOs that are on the WQ pending > > list */ > > > @@ -9300,7 +9311,8 @@ ocs_hw_cb_link(void *ctx, void *e) > > > > > > hw->link.status = event->status; > > > > > > - for (i = 0; d = hw->domains[i], i < SLI4_MAX_FCFI; i++) { > > > + for (i = 0; i < SLI4_MAX_FCFI; i++) { > > > + d = hw->domains[i]; > > > if (d != NULL && > > > hw->callback.domain != NULL) { > > > hw->callback.domain(hw->args.domain, > > OCS_HW_DOMAIN_LOST, d); > > > @@ -9322,6 +9334,9 @@ ocs_hw_cb_fip(void *ctx, void *e) > > > ocs_domain_t *domain = NULL; > > > sli4_fip_event_t *event = e; > > > > > > + ocs_hw_assert(event); > > > + ocs_hw_assert(hw); > > > + > > > /* Find the associated domain object */ > > > if (event->type == SLI4_FCOE_FIP_FCF_CLEAR_VLINK) { > > > ocs_domain_t *d = NULL; > > > @@ -9330,7 +9345,8 @@ ocs_hw_cb_fip(void *ctx, void *e) > > > /* Clear VLINK is different from the other FIP events as > > it passes back > > > * a VPI instead of a FCF index. Check all attached SLI > > ports for a > > > * matching VPI */ > > > - for (i = 0; d = hw->domains[i], i < SLI4_MAX_FCFI; i++) { > > > + for (i = 0; i < SLI4_MAX_FCFI; i++) { > > > + d = hw->domains[i]; > > > if (d != NULL) { > > > ocs_sport_t *sport = NULL; > > > > > > @@ -11202,6 +11218,7 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t > > status, > > > ocs_hw_io_t *io_next = NULL; > > > uint64_t ticks_current = ocs_get_os_ticks(); > > > uint32_t sec_elapsed; > > > + ocs_hw_rtn_e rc; > > > > > > sli4_mbox_command_header_t *hdr = (sli4_mbox_command_header_t > > *)mqe; > > > > > > @@ -11213,34 +11230,39 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t > > status, > > > > > > /* loop through active WQE list and check for timeouts */ > > > ocs_lock(&hw->io_lock); > > > - ocs_list_foreach_safe(&hw->io_timed_wqe, io, io_next) { > > > - sec_elapsed = ((ticks_current - io->submit_ticks) > > / ocs_get_os_tick_freq()); > > > + ocs_list_foreach_safe(&hw->io_timed_wqe, io, io_next) { > > > + sec_elapsed = ((ticks_current - io->submit_ticks) / > > ocs_get_os_tick_freq()); > > > > > > - /* > > > - * If elapsed time > timeout, abort it. No need to > > check type since > > > - * it wouldn't be on this list unless it was a > > target WQE > > > - */ > > > - if (sec_elapsed > io->tgt_wqe_timeout) { > > > - ocs_log_test(hw->os, "IO timeout xri=0x%x > > tag=0x%x type=%d\n", > > > - io->indicator, io->reqtag, > > io->type); > > > + /* > > > + * If elapsed time > timeout, abort it. No need to check > > type since > > > + * it wouldn't be on this list unless it was a target WQE > > > + */ > > > + if (sec_elapsed > io->tgt_wqe_timeout) { > > > + ocs_log_test(hw->os, "IO timeout xri=0x%x tag=0x%x > > type=%d\n", > > > + io->indicator, io->reqtag, io->type); > > > > > > - /* remove from active_wqe list so won't > > try to abort again */ > > > - ocs_list_remove(&hw->io_timed_wqe, io); > > > + /* remove from active_wqe list so won't try to > > abort again */ > > > + ocs_list_remove(&hw->io_timed_wqe, io); > > > > > > - /* save status of "timed out" for when > > abort completes */ > > > - io->status_saved = 1; > > > - io->saved_status = > > SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT; > > > - io->saved_ext = 0; > > > - io->saved_len = 0; > > > + /* save status of "timed out" for when abort > > completes */ > > > + io->status_saved = 1; > > > + io->saved_status = > > SLI4_FC_WCQE_STATUS_TARGET_WQE_TIMEOUT; > > > + io->saved_ext = 0; > > > + io->saved_len = 0; > > > > > > - /* now abort outstanding IO */ > > > - ocs_hw_io_abort(hw, io, FALSE, NULL, NULL); > > > + /* now abort outstanding IO */ > > > + rc = ocs_hw_io_abort(hw, io, FALSE, NULL, NULL); > > > + if (rc) { > > > + ocs_log_test(hw->os, > > > + "abort failed xri=%#x tag=%#x > > rc=%d\n", > > > + io->indicator, io->reqtag, rc); > > > } > > > - /* > > > - * need to go through entire list since each IO > > could have a > > > - * different timeout value > > > - */ > > > } > > > + /* > > > + * need to go through entire list since each IO could have > > a > > > + * different timeout value > > > + */ > > > + } > > > ocs_unlock(&hw->io_lock); > > > > > > /* if we're not in the middle of shutting down, schedule next > > timer */ > > > > > > Modified: head/sys/dev/ocs_fc/ocs_hw_queues.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/ocs_hw_queues.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/ocs_hw_queues.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -149,13 +149,16 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t > > *qtop) > > > default_lengths[QTOP_CQ] = len; > > > break; > > > } > > > + > > > + if (!eq || !next_qt) { > > > + goto fail; > > > + } > > > > > > /* If this CQ is for MRQ, then delay the creation > > */ > > > if (!use_mrq || next_qt->entry != QTOP_RQ) { > > > cq = hw_new_cq(eq, len); > > > if (cq == NULL) { > > > - hw_queue_teardown(hw); > > > - return OCS_HW_RTN_NO_MEMORY; > > > + goto fail; > > > } > > > } > > > break; > > > @@ -173,11 +176,13 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t > > *qtop) > > > hw_queue_teardown(hw); > > > return OCS_HW_RTN_NO_MEMORY; > > > } > > > + > > > + if (cq == NULL) > > > + goto fail; > > > > > > wq = hw_new_wq(cq, len, qt->class, hw->ulp_start + > > qt->ulp); > > > if (wq == NULL) { > > > - hw_queue_teardown(hw); > > > - return OCS_HW_RTN_NO_MEMORY; > > > + goto fail; > > > } > > > > > > /* Place this WQ on the EQ WQ array */ > > > @@ -249,10 +254,12 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t > > *qtop) > > > break; > > > } > > > > > > + if (cq == NULL) > > > + goto fail; > > > + > > > mq = hw_new_mq(cq, len); > > > if (mq == NULL) { > > > - hw_queue_teardown(hw); > > > - return OCS_HW_RTN_NO_MEMORY; > > > + goto fail; > > > } > > > break; > > > > > > @@ -332,6 +339,9 @@ ocs_hw_init_queues(ocs_hw_t *hw, ocs_hw_qtop_t *qtop) > > > } > > > > > > return OCS_HW_RTN_SUCCESS; > > > +fail: > > > + hw_queue_teardown(hw); > > > + return OCS_HW_RTN_NO_MEMORY; > > > > > > } > > > > > > @@ -737,8 +747,9 @@ error: > > > for (i = 0; i < num_rq_pairs; i++) { > > > if (rqs[i] != NULL) { > > > if (rqs[i]->rq_tracker != NULL) { > > > - ocs_free(hw->os, rq->rq_tracker, > > > - sizeof(ocs_hw_sequence_t*) * > > rq->entry_count); > > > + ocs_free(hw->os, rqs[i]->rq_tracker, > > > + sizeof(ocs_hw_sequence_t*) * > > > + rqs[i]->entry_count); > > > } > > > ocs_free(hw->os, rqs[i], sizeof(*rqs[i])); > > > } > > > @@ -861,9 +872,9 @@ hw_del_wq(hw_wq_t *wq) > > > void > > > hw_del_rq(hw_rq_t *rq) > > > { > > > - ocs_hw_t *hw = rq->cq->eq->hw; > > > > > > if (rq != NULL) { > > > + ocs_hw_t *hw = rq->cq->eq->hw; > > > /* Free RQ tracker */ > > > if (rq->rq_tracker != NULL) { > > > ocs_free(hw->os, rq->rq_tracker, > > sizeof(ocs_hw_sequence_t*) * rq->entry_count); > > > > > > Modified: head/sys/dev/ocs_fc/ocs_ioctl.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/ocs_ioctl.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/ocs_ioctl.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -243,9 +243,13 @@ ocs_process_mbx_ioctl(ocs_t *ocs, > > ocs_ioctl_elxu_mbox_ > > > * 6. ioctl code releases the lock > > > */ > > > mtx_lock(&ocs->dbg_lock); > > > - ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, > > > - __ocs_ioctl_mbox_cb, ocs); > > > - msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); > > > + if (ocs_hw_command(&ocs->hw, mcmd->payload, OCS_CMD_NOWAIT, > > > + __ocs_ioctl_mbox_cb, ocs)) { > > > + > > > + device_printf(ocs->dev, "%s: command- %x failed\n", > > __func__, > > > + ((sli4_mbox_command_header_t > > *)mcmd->payload)->command); > > > + } > > > + msleep(ocs, &ocs->dbg_lock, 0, "ocsmbx", 0); > > > mtx_unlock(&ocs->dbg_lock); > > > > > > if( SLI4_MBOX_COMMAND_SLI_CONFIG == ((sli4_mbox_command_header_t > > *)mcmd->payload)->command > > > > > > Modified: head/sys/dev/ocs_fc/ocs_mgmt.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/ocs_mgmt.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -2129,7 +2129,7 @@ set_port_protocol(ocs_t *ocs, char *name, char > > *value) > > > if (ocs_sem_p(&(result.semaphore), OCS_SEM_FOREVER) != 0) { > > > /* Undefined failure */ > > > ocs_log_err(ocs, "ocs_sem_p failed\n"); > > > - rc = -ENXIO; > > > + return -ENXIO; > > > } > > > if (result.status == 0) { > > > /* Success. */ > > > @@ -2321,7 +2321,7 @@ set_active_profile(ocs_t *ocs, char *name, char > > *value > > > if (ocs_sem_p(&(result.semaphore), OCS_SEM_FOREVER) != 0) { > > > /* Undefined failure */ > > > ocs_log_err(ocs, "ocs_sem_p failed\n"); > > > - rc = -ENXIO; > > > + return -ENXIO; > > > } > > > if (result.status == 0) { > > > /* Success. */ > > > @@ -2527,8 +2527,8 @@ set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) > > > char *wwpn_p = NULL; > > > char *wwnn_p = NULL; > > > int32_t rc = -1; > > > - int wwpn; > > > - int wwnn; > > > + int wwpn = 0; > > > + int wwnn = 0; > > > int i; > > > > > > /* This is a read-modify-write operation, so first we have to read > > > @@ -2556,8 +2556,13 @@ set_nv_wwn(ocs_t *ocs, char *name, char *wwn_p) > > > wwnn_p = wwn_p; > > > } > > > > > > - wwpn = ocs_strcmp(wwpn_p, "NA"); > > > - wwnn = ocs_strcmp(wwnn_p, "NA"); > > > + if (wwpn_p != NULL) { > > > + wwpn = ocs_strcmp(wwpn_p, "NA"); > > > + } > > > + > > > + if (wwnn_p != NULL) { > > > + wwnn = ocs_strcmp(wwnn_p, "NA"); > > > + } > > > > > > /* Parse the new WWPN */ > > > if ((wwpn_p != NULL) && (wwpn != 0)) { > > > > > > Modified: head/sys/dev/ocs_fc/ocs_node.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/ocs_node.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/ocs_node.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -253,7 +253,7 @@ ocs_node_create_pool(ocs_t *ocs, uint32_t node_count) > > > > > > if (0 == ocs_hw_get(&ocs->hw, OCS_HW_MAX_SGE, &max_sge) && > > > 0 == ocs_hw_get(&ocs->hw, OCS_HW_N_SGL, &num_sgl)) { > > > - max_xfer_size = max_sge * num_sgl; > > > + max_xfer_size = (max_sge * (uint64_t)num_sgl); > > > } else { > > > max_xfer_size = 65536; > > > } > > > > > > Modified: head/sys/dev/ocs_fc/ocs_pci.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/ocs_pci.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/ocs_pci.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -591,7 +591,7 @@ ocs_device_detach(ocs_t *ocs) > > > } > > > > > > ocs_cam_detach(ocs); > > > - ocs_free(ocs, ocs->fcports, sizeof(ocs->fcports)); > > > + ocs_free(ocs, ocs->fcports, sizeof(*(ocs->fcports))); > > > > > > for (i = 0; (io = ocs_io_get_instance(ocs, i)); i++) { > > > if (bus_dmamap_destroy(ocs->buf_dmat, > > io->tgt_io.dmap)) { > > > > > > Modified: head/sys/dev/ocs_fc/ocs_xport.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/ocs_xport.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/ocs_xport.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -292,10 +292,6 @@ ocs_xport_attach_cleanup: > > > ocs_node_free_pool(ocs); > > > } > > > > > > - if (rq_threads_created) { > > > - ocs_xport_rq_threads_teardown(xport); > > > - } > > > - > > > return -1; > > > } > > > > > > > > > Modified: head/sys/dev/ocs_fc/sli4.c > > > > > ============================================================================== > > > --- head/sys/dev/ocs_fc/sli4.c Wed Jan 23 17:28:39 2019 > > (r343348) > > > +++ head/sys/dev/ocs_fc/sli4.c Wed Jan 23 17:34:01 2019 > > (r343349) > > > @@ -1867,10 +1867,7 @@ sli_cmd_common_create_cq(sli4_t *sli4, void *buf, > > size > > > } > > > } > > > break; > > > - default: > > > - ocs_log_test(sli4->os, "unsupported IF_TYPE %d\n", > > if_type); > > > - return -1; > > > - } > > > + } > > > > > > return (sli_config_off + cmd_size); > > > } > > > @@ -4637,6 +4634,8 @@ sli_cq_alloc_set(sli4_t *sli4, sli4_queue_t *qs[], > > uin > > > return -1; > > > } > > > > > > + memset(&dma, 0, sizeof(dma)); > > > + > > > /* Align the queue DMA memory */ > > > for (i = 0; i < num_cqs; i++) { > > > if (__sli_queue_init(sli4, qs[i], SLI_QTYPE_CQ, > > SLI4_CQE_BYTES, > > > @@ -4886,7 +4885,7 @@ sli_queue_reset(sli4_t *sli4, sli4_queue_t *q) > > > } > > > > > > if (q->dma.virt != NULL) { > > > - ocs_memset(q->dma.virt, 0, (q->size * q->length)); > > > + ocs_memset(q->dma.virt, 0, (q->size * > > (uint64_t)q->length)); > > > } > > > > > > ocs_unlock(&q->lock); > > > @@ -8479,6 +8478,8 @@ sli_fc_rq_set_alloc(sli4_t *sli4, uint32_t > > num_rq_pair > > > ocs_dma_t dma; > > > sli4_res_common_create_queue_set_t *rsp = NULL; > > > sli4_req_fcoe_rq_create_v2_t *req = NULL; > > > + > > > + ocs_memset(&dma, 0, sizeof(dma)); > > > > > > for (i = 0; i < (num_rq_pairs * 2); i++) { > > > if (__sli_queue_init(sli4, qs[i], SLI_QTYPE_RQ, > > SLI4_FCOE_RQE_SIZE, > > > > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 25 13:48:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EFCC14B636E; Fri, 25 Jan 2019 13:48:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03ABA84327; Fri, 25 Jan 2019 13:48:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E77748ECF; Fri, 25 Jan 2019 13:48:46 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PDmkoI088944; Fri, 25 Jan 2019 13:48:46 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PDmfkG088912; Fri, 25 Jan 2019 13:48:41 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901251348.x0PDmfkG088912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 25 Jan 2019 13:48:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343427 - in head: share/man/man4 sys/amd64/conf sys/conf sys/i386/conf sys/mips/conf sys/modules/ath_hal_ar5416 sys/powerpc/conf sys/sparc64/conf tools/tools/ath/ath_ee_9300_print tool... X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head: share/man/man4 sys/amd64/conf sys/conf sys/i386/conf sys/mips/conf sys/modules/ath_hal_ar5416 sys/powerpc/conf sys/sparc64/conf tools/tools/ath/ath_ee_9300_print tools/tools/ath/athaggrstats ... X-SVN-Commit-Revision: 343427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03ABA84327 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 13:48:47 -0000 Author: avos Date: Fri Jan 25 13:48:40 2019 New Revision: 343427 URL: https://svnweb.freebsd.org/changeset/base/343427 Log: Garbage collect AH_SUPPORT_AR5416 config option. It does nothing since r318857. Modified: head/share/man/man4/ath.4 head/share/man/man4/ath_hal.4 head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/options head/sys/i386/conf/GENERIC head/sys/mips/conf/ERL head/sys/mips/conf/OCTEON1 head/sys/mips/conf/PB92 head/sys/mips/conf/std.AR_MIPS_BASE head/sys/modules/ath_hal_ar5416/Makefile head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/sparc64/conf/GENERIC head/tools/tools/ath/ath_ee_9300_print/Makefile head/tools/tools/ath/athaggrstats/Makefile head/tools/tools/ath/athdecode/Makefile head/tools/tools/ath/athkey/Makefile head/tools/tools/ath/athpoke/Makefile head/tools/tools/ath/athprom/Makefile head/tools/tools/ath/athradar/Makefile head/tools/tools/ath/athratestats/Makefile head/tools/tools/ath/athregs/Makefile head/tools/tools/ath/athspectral/Makefile head/tools/tools/ath/athstats/Makefile head/tools/tools/ath/athsurvey/Makefile head/tools/tools/nanobsd/pcengines/ALIX_DSK Modified: head/share/man/man4/ath.4 ============================================================================== --- head/share/man/man4/ath.4 Fri Jan 25 11:46:07 2019 (r343426) +++ head/share/man/man4/ath.4 Fri Jan 25 13:48:40 2019 (r343427) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd April 14, 2014 +.Dd January 25, 2019 .Dt ATH 4 .Os .Sh NAME @@ -42,7 +42,6 @@ kernel configuration file: .Cd "device ath" .Cd "device ath_pci" .Cd "device ath_hal" -.Cd "options AH_SUPPORT_AR5416" .Cd "device ath_rate_sample" .Cd "device wlan" .Ed Modified: head/share/man/man4/ath_hal.4 ============================================================================== --- head/share/man/man4/ath_hal.4 Fri Jan 25 11:46:07 2019 (r343426) +++ head/share/man/man4/ath_hal.4 Fri Jan 25 13:48:40 2019 (r343427) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd July 22, 2013 +.Dd January 25, 2019 .Dt ATH_HAL 4 .Os .Sh NAME @@ -36,7 +36,6 @@ .Nd "Atheros Hardware Access Layer (HAL)" .Sh SYNOPSIS .Cd "device ath_hal" -.Cd "options AH_SUPPORT_AR5416" or .Cd "device ath_ar5210" .Cd "device ath_ar5211" @@ -57,12 +56,11 @@ or .Cd "device ath_ar9285" .Cd "device ath_ar9287" .Cd "device ath_ar9300" -.Cd "options AH_SUPPORT_AR5416" .Sh DESCRIPTION The hal provides hardware support for wireless network adapters based on the Atheros AR5210, AR5211, AR5212, AR5213, AR2413, AR2417, AR2425, -AR5413, AR5416, AR5418, AR5424, AR9160, AR9220, AR9280, AR9285, AR9287, -AR9380, AR9390, AR9580, AR9590, AR9562 and QCA9565 +AR5413, AR5416, AR5418, AR5424, AR9130, AR9160, AR9220, AR9280, AR9285, +AR9287, AR9380, AR9390, AR9580, AR9590, AR9562 and QCA9565 chips (and companion RF/baseband parts). This code is part of the .Xr ath 4 @@ -71,11 +69,6 @@ over the set of chips supported. Selecting .Nm enables support for all PCI and Cardbus devices. -Note this includes AR5416, AR5418, AR9130, AR9160, AR9220, AR9280, AR9285 -and AR9287 devices and must be accompanied by the -AH_SUPPORT_AR5416 -option to enable the extended hardware descriptor format used by -AR5416 and later devices. .Pp Some devices come in Cardbus/MiniPCI/PCI format. Others (for example AR2413, AR2427, AR5418, AR9280, AR9285, AR9287) come in Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/amd64/conf/GENERIC Fri Jan 25 13:48:40 2019 (r343427) @@ -293,7 +293,6 @@ device an # Aironet 4500/4800 802.11 wireless NICs. device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later device ath_rate_sample # SampleRate tx rate control for ath Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/conf/NOTES Fri Jan 25 13:48:40 2019 (r343427) @@ -2121,7 +2121,6 @@ device ath_hal # pci/cardbus chip support #device ath_rf5112 #device ath_rf5413 #device ath_ar5416 # AR5416 chips -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors # All of the AR5212 parts have a problem when paired with the AR71xx # CPUS. These parts have a bug that triggers a fatal bus error on the AR71xx # only. Details of the exact nature of the bug are sketchy, but some can be Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/conf/options Fri Jan 25 13:48:40 2019 (r343427) @@ -828,7 +828,6 @@ ATH_DEBUG_ALQ opt_ath.h ATH_KTR_INTR_DEBUG opt_ath.h # options for the Atheros hal -AH_SUPPORT_AR5416 opt_ah.h # XXX For now, this breaks non-AR9130 chipsets, so only use it # XXX when actually targeting AR9130. AH_SUPPORT_AR9130 opt_ah.h Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/i386/conf/GENERIC Fri Jan 25 13:48:40 2019 (r343427) @@ -289,7 +289,6 @@ device an # Aironet 4500/4800 802.11 wireless NICs. device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors options AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation options ATH_ENABLE_11N # Enable 802.11n support for AR5416 and later device ath_rate_sample # SampleRate tx rate control for ath Modified: head/sys/mips/conf/ERL ============================================================================== --- head/sys/mips/conf/ERL Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/mips/conf/ERL Fri Jan 25 13:48:40 2019 (r343427) @@ -144,7 +144,6 @@ device wlan_amrr # AMRR transmit rate control algorit #device ath # Atheros NIC's #device ath_pci # Atheros pci/cardbus glue #device ath_hal # pci/cardbus chip support -#options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors #device ath_rate_sample # SampleRate tx rate control for ath # Pseudo devices. Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/mips/conf/OCTEON1 Fri Jan 25 13:48:40 2019 (r343427) @@ -177,7 +177,6 @@ device wlan_amrr # AMRR transmit rate control algorit device ath # Atheros NIC's device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors device ath_rate_sample # SampleRate tx rate control for ath device ral # Ralink Technology RT2500 wireless NICs. Modified: head/sys/mips/conf/PB92 ============================================================================== --- head/sys/mips/conf/PB92 Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/mips/conf/PB92 Fri Jan 25 13:48:40 2019 (r343427) @@ -84,7 +84,6 @@ options ATH_ENABLE_11N options ATH_DIAGAPI # device ath_hal -options AH_SUPPORT_AR5416 options AH_DEBUG options AH_DEBUG_ALQ Modified: head/sys/mips/conf/std.AR_MIPS_BASE ============================================================================== --- head/sys/mips/conf/std.AR_MIPS_BASE Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/mips/conf/std.AR_MIPS_BASE Fri Jan 25 13:48:40 2019 (r343427) @@ -55,7 +55,6 @@ options ATH_ENABLE_DFS options AH_DEBUG_ALQ options AH_DEBUG -options AH_SUPPORT_AR5416 options AH_AR5416_INTERRUPT_MITIGATION options AH_RXCFG_SDMAMW_4BYTES Modified: head/sys/modules/ath_hal_ar5416/Makefile ============================================================================== --- head/sys/modules/ath_hal_ar5416/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/modules/ath_hal_ar5416/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -40,9 +40,6 @@ SRCS= ah_osdep_ar5416.c # # AR5416, AR9130, AR9160, AR9220, AR9280, AR9285, AR9287 support. - -# Note enabling this support requires defining AH_SUPPORT_AR5416 -# in opt_ah.h so the 11n tx/rx descriptor format is handled. # # NB: 9160 depends on 5416 but 5416 does not require 9160 # Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/powerpc/conf/GENERIC Fri Jan 25 13:48:40 2019 (r343427) @@ -200,7 +200,6 @@ device kue # Kawasaki LSI USB Ethernet # Wireless NIC cards options IEEE80211_SUPPORT_MESH -options AH_SUPPORT_AR5416 # Misc device iicbus # I2C bus code Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/powerpc/conf/GENERIC64 Fri Jan 25 13:48:40 2019 (r343427) @@ -214,7 +214,6 @@ device kue # Kawasaki LSI USB Ethernet # Wireless NIC cards options IEEE80211_SUPPORT_MESH -options AH_SUPPORT_AR5416 # FireWire support device firewire # FireWire bus code Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri Jan 25 11:46:07 2019 (r343426) +++ head/sys/sparc64/conf/GENERIC Fri Jan 25 13:48:40 2019 (r343427) @@ -225,7 +225,6 @@ device wlan_amrr # AMRR transmit rate control algorit device ath # Atheros NICs device ath_pci # Atheros pci/cardbus glue device ath_hal # Atheros HAL (Hardware Access Layer) -options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors device ath_rate_sample # SampleRate tx rate control for ath # Pseudo devices. Modified: head/tools/tools/ath/ath_ee_9300_print/Makefile ============================================================================== --- head/tools/tools/ath/ath_ee_9300_print/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/ath_ee_9300_print/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -11,7 +11,6 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h .include <../Makefile.inc> Modified: head/tools/tools/ath/athaggrstats/Makefile ============================================================================== --- head/tools/tools/ath/athaggrstats/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athaggrstats/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -18,7 +18,6 @@ LIBADD+= bsdstat opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h ah_osdep.h: echo 'typedef void *HAL_SOFTC;' >ah_osdep.h Modified: head/tools/tools/ath/athdecode/Makefile ============================================================================== --- head/tools/tools/ath/athdecode/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athdecode/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -17,7 +17,6 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h .include <../Makefile.inc> Modified: head/tools/tools/ath/athkey/Makefile ============================================================================== --- head/tools/tools/ath/athkey/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athkey/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -10,7 +10,6 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h .include <../Makefile.inc> Modified: head/tools/tools/ath/athpoke/Makefile ============================================================================== --- head/tools/tools/ath/athpoke/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athpoke/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -17,7 +17,6 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h .include <../Makefile.inc> Modified: head/tools/tools/ath/athprom/Makefile ============================================================================== --- head/tools/tools/ath/athprom/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athprom/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -14,7 +14,6 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h CFLAGS+=-DDIR_TEMPLATE='"${TEMPLATEDIR}"' Modified: head/tools/tools/ath/athradar/Makefile ============================================================================== --- head/tools/tools/ath/athradar/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athradar/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -11,6 +11,5 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h .include Modified: head/tools/tools/ath/athratestats/Makefile ============================================================================== --- head/tools/tools/ath/athratestats/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athratestats/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -19,7 +19,6 @@ CFLAGS+=-DATH_SUPPORT_TDMA opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h ah_osdep.h: echo 'typedef void *HAL_SOFTC;' >ah_osdep.h Modified: head/tools/tools/ath/athregs/Makefile ============================================================================== --- head/tools/tools/ath/athregs/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athregs/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -19,7 +19,6 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h .include <../Makefile.inc> Modified: head/tools/tools/ath/athspectral/Makefile ============================================================================== --- head/tools/tools/ath/athspectral/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athspectral/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -11,6 +11,5 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h .include Modified: head/tools/tools/ath/athstats/Makefile ============================================================================== --- head/tools/tools/ath/athstats/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athstats/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -30,7 +30,6 @@ LIBADD= bsdstat opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h ah_osdep.h: echo 'typedef void *HAL_SOFTC;' >ah_osdep.h Modified: head/tools/tools/ath/athsurvey/Makefile ============================================================================== --- head/tools/tools/ath/athsurvey/Makefile Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/ath/athsurvey/Makefile Fri Jan 25 13:48:40 2019 (r343427) @@ -11,6 +11,5 @@ CLEANFILES+= opt_ah.h opt_ah.h: echo "#define AH_DEBUG 1" > opt_ah.h echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h - echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h .include Modified: head/tools/tools/nanobsd/pcengines/ALIX_DSK ============================================================================== --- head/tools/tools/nanobsd/pcengines/ALIX_DSK Fri Jan 25 11:46:07 2019 (r343426) +++ head/tools/tools/nanobsd/pcengines/ALIX_DSK Fri Jan 25 13:48:40 2019 (r343427) @@ -62,7 +62,6 @@ device wlan_amrr device an device ath device ath_hal -options AH_SUPPORT_AR5416 device ath_rate_sample device wi device loop From owner-svn-src-head@freebsd.org Fri Jan 25 13:55:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AE5B14B69F9; Fri, 25 Jan 2019 13:55:18 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9292984A03; Fri, 25 Jan 2019 13:55:17 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lj1-f176.google.com with SMTP id v1-v6so8474053ljd.0; Fri, 25 Jan 2019 05:55:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BWAOJUdGRzA68AYFUaWyeHGnKWknI5G/2Af/Z5IE6v0=; b=KJ/U4RuBHNomT7FV4sf4heAfaPqvkSboLsZqSzILeSXOc9LSbYovNbACK0ATixoYry EXQ6Z1yu5l6lffPexUt8K3Vrx+bwHAa1D7YLZUHUN4L4R/ni48WyCUImPjwYeid5jqpR 8yxrMS6PcXp58gxwoxtB8Ds1q4QGSmofezacjUv9Yj41EkpJ982UWpxWCwo2B5zzbFRr AZRhytz0cEv53daGr/y70LLF5UPwdclEyIUupK9NOfqQBuCBjk0cYYa7rqwy7wRpcUJQ kpXWvbv+pyg9wiqYMYMofQS5oWjnHQ+VWLnspoGA1lDQYIOJhDyRcPlCBRsANEhU05IO uMCw== X-Gm-Message-State: AJcUukeLgZelVhKN/MdEzK3jF+VHbWkAo8yCR7Sa3ZRLqLiuumTOQqc1 Pu30eob4Qp06CrUmhy4VmcwuvQnq X-Google-Smtp-Source: ALg8bN4OrGU/Ju5xobMfkUuosSJLHGGz1OAOiS3VS/QGTyu1rYatcjhDWDwdBgvIuBdSQPO75dYDrA== X-Received: by 2002:a2e:20f:: with SMTP id 15-v6mr9290759ljc.172.1548424105885; Fri, 25 Jan 2019 05:48:25 -0800 (PST) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com. [209.85.208.178]) by smtp.gmail.com with ESMTPSA id o5-v6sm1475533ljh.75.2019.01.25.05.48.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jan 2019 05:48:25 -0800 (PST) Received: by mail-lj1-f178.google.com with SMTP id q2-v6so8413851lji.10; Fri, 25 Jan 2019 05:48:24 -0800 (PST) X-Received: by 2002:a2e:710a:: with SMTP id m10-v6mr8836459ljc.66.1548424104712; Fri, 25 Jan 2019 05:48:24 -0800 (PST) MIME-Version: 1.0 References: <201901251344.x0PDiGZP088635@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201901251344.x0PDiGZP088635@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Fri, 25 Jan 2019 07:47:52 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r343349 - head/sys/dev/ocs_fc To: "Rodney W. Grimes" Cc: Ram Kishore Vegesna , Ram Kishore Vegesna , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 9292984A03 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 13:55:18 -0000 On Fri, Jan 25, 2019 at 7:44 AM Rodney W. Grimes wrote: > > > Hi Rodney, > > > > I fixed many coverity tool warnings as part of this commit. Adding all the > > warnings and fix details seemed over kill. > > It seems like overkill when your commiting, but if you have > have to go digging through commit history trying to find > something it helps a great deal to have good information > present there. > > You do not need to include the output from coverty, > but some amount of detail is very helpful. > We do have a tendency to note CIDs in commit messages and that's pretty helpful -- I don't know that omitting them will generally ruffle any feathers, though. From owner-svn-src-head@freebsd.org Fri Jan 25 13:57:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5A7F14B6B21; Fri, 25 Jan 2019 13:57:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C12484C31; Fri, 25 Jan 2019 13:57:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B7039088; Fri, 25 Jan 2019 13:57:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PDvAAp094303; Fri, 25 Jan 2019 13:57:10 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PDvAJl094298; Fri, 25 Jan 2019 13:57:10 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901251357.x0PDvAJl094298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 25 Jan 2019 13:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343428 - in head/sys/netinet: . cc tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . cc tcp_stacks X-SVN-Commit-Revision: 343428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1C12484C31 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 13:57:11 -0000 Author: tuexen Date: Fri Jan 25 13:57:09 2019 New Revision: 343428 URL: https://svnweb.freebsd.org/changeset/base/343428 Log: Fix a bug in the restart window computation of TCP New Reno When implementing support for IW10, an update in the computation of the restart window used after an idle phase was missed. To minimize code duplication, implement the logic in tcp_compute_initwnd() and call it. This fixes a bug in NewReno, which was not aware of IW10. Submitted by: Richard Scheffenegger Reviewed by: tuexen@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18940 Modified: head/sys/netinet/cc/cc_newreno.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- head/sys/netinet/cc/cc_newreno.c Fri Jan 25 13:48:40 2019 (r343427) +++ head/sys/netinet/cc/cc_newreno.c Fri Jan 25 13:57:09 2019 (r343428) @@ -199,7 +199,7 @@ newreno_ack_received(struct cc_var *ccv, uint16_t type static void newreno_after_idle(struct cc_var *ccv) { - int rw; + uint32_t rw; /* * If we've been idle for more than one retransmit timeout the old @@ -214,11 +214,7 @@ newreno_after_idle(struct cc_var *ccv) * * See RFC5681 Section 4.1. "Restarting Idle Connections". */ - if (V_tcp_do_rfc3390) - rw = min(4 * CCV(ccv, t_maxseg), - max(2 * CCV(ccv, t_maxseg), 4380)); - else - rw = CCV(ccv, t_maxseg) * 2; + rw = tcp_compute_initwnd(tcp_maxseg(ccv->ccvc.tcp)); CCV(ccv, snd_cwnd) = min(rw, CCV(ccv, snd_cwnd)); } Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri Jan 25 13:48:40 2019 (r343427) +++ head/sys/netinet/tcp_input.c Fri Jan 25 13:57:09 2019 (r343428) @@ -371,31 +371,14 @@ cc_conn_init(struct tcpcb *tp) /* * Set the initial slow-start flight size. * - * RFC5681 Section 3.1 specifies the default conservative values. - * RFC3390 specifies slightly more aggressive values. - * RFC6928 increases it to ten segments. - * Support for user specified value for initial flight size. - * * If a SYN or SYN/ACK was lost and retransmitted, we have to * reduce the initial CWND to one segment as congestion is likely * requiring us to be cautious. */ if (tp->snd_cwnd == 1) tp->snd_cwnd = maxseg; /* SYN(-ACK) lost */ - else if (V_tcp_initcwnd_segments) - tp->snd_cwnd = min(V_tcp_initcwnd_segments * maxseg, - max(2 * maxseg, V_tcp_initcwnd_segments * 1460)); - else if (V_tcp_do_rfc3390) - tp->snd_cwnd = min(4 * maxseg, max(2 * maxseg, 4380)); - else { - /* Per RFC5681 Section 3.1 */ - if (maxseg > 2190) - tp->snd_cwnd = 2 * maxseg; - else if (maxseg > 1095) - tp->snd_cwnd = 3 * maxseg; - else - tp->snd_cwnd = 4 * maxseg; - } + else + tp->snd_cwnd = tcp_compute_initwnd(maxseg); if (CC_ALGO(tp)->conn_init != NULL) CC_ALGO(tp)->conn_init(tp->ccv); @@ -3817,4 +3800,31 @@ tcp_compute_pipe(struct tcpcb *tp) return (tp->snd_max - tp->snd_una + tp->sackhint.sack_bytes_rexmit - tp->sackhint.sacked_bytes); +} + +uint32_t +tcp_compute_initwnd(uint32_t maxseg) +{ + /* + * Calculate the Initial Window, also used as Restart Window + * + * RFC5681 Section 3.1 specifies the default conservative values. + * RFC3390 specifies slightly more aggressive values. + * RFC6928 increases it to ten segments. + * Support for user specified value for initial flight size. + */ + if (V_tcp_initcwnd_segments) + return min(V_tcp_initcwnd_segments * maxseg, + max(2 * maxseg, V_tcp_initcwnd_segments * 1460)); + else if (V_tcp_do_rfc3390) + return min(4 * maxseg, max(2 * maxseg, 4380)); + else { + /* Per RFC5681 Section 3.1 */ + if (maxseg > 2190) + return (2 * maxseg); + else if (maxseg > 1095) + return (3 * maxseg); + else + return (4 * maxseg); + } } Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Fri Jan 25 13:48:40 2019 (r343427) +++ head/sys/netinet/tcp_stacks/rack.c Fri Jan 25 13:57:09 2019 (r343428) @@ -1425,21 +1425,9 @@ rack_cc_after_idle(struct tcpcb *tp, int reduce_larges if (tp->snd_cwnd == 1) i_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */ - else if (V_tcp_initcwnd_segments) - i_cwnd = min((V_tcp_initcwnd_segments * tp->t_maxseg), - max(2 * tp->t_maxseg, V_tcp_initcwnd_segments * 1460)); - else if (V_tcp_do_rfc3390) - i_cwnd = min(4 * tp->t_maxseg, - max(2 * tp->t_maxseg, 4380)); - else { - /* Per RFC5681 Section 3.1 */ - if (tp->t_maxseg > 2190) - i_cwnd = 2 * tp->t_maxseg; - else if (tp->t_maxseg > 1095) - i_cwnd = 3 * tp->t_maxseg; - else - i_cwnd = 4 * tp->t_maxseg; - } + else + i_cwnd = tcp_compute_initwnd(tcp_maxseg(tp)); + if (reduce_largest) { /* * Do we reduce the largest cwnd to make Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Fri Jan 25 13:48:40 2019 (r343427) +++ head/sys/netinet/tcp_var.h Fri Jan 25 13:57:09 2019 (r343428) @@ -942,6 +942,7 @@ void tcp_sack_partialack(struct tcpcb *, struct tcphd void tcp_free_sackholes(struct tcpcb *tp); int tcp_newreno(struct tcpcb *, struct tcphdr *); int tcp_compute_pipe(struct tcpcb *); +uint32_t tcp_compute_initwnd(uint32_t); void tcp_sndbuf_autoscale(struct tcpcb *, struct socket *, uint32_t); struct mbuf * tcp_m_copym(struct mbuf *m, int32_t off0, int32_t *plen, From owner-svn-src-head@freebsd.org Fri Jan 25 14:00:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3751314B6CD6; Fri, 25 Jan 2019 14:00:50 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2EAF84F45; Fri, 25 Jan 2019 14:00:49 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0PE0lll088750; Fri, 25 Jan 2019 06:00:47 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0PE0lrG088749; Fri, 25 Jan 2019 06:00:47 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901251400.x0PE0lrG088749@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343349 - head/sys/dev/ocs_fc In-Reply-To: To: Kyle Evans Date: Fri, 25 Jan 2019 06:00:47 -0800 (PST) CC: "Rodney W. Grimes" , Ram Kishore Vegesna , Ram Kishore Vegesna , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: A2EAF84F45 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 14:00:50 -0000 > On Fri, Jan 25, 2019 at 7:44 AM Rodney W. Grimes > wrote: > > > > > Hi Rodney, > > > > > > I fixed many coverity tool warnings as part of this commit. Adding all the > > > warnings and fix details seemed over kill. > > > > It seems like overkill when your commiting, but if you have > > have to go digging through commit history trying to find > > something it helps a great deal to have good information > > present there. > > > > You do not need to include the output from coverty, > > but some amount of detail is very helpful. > > > > We do have a tendency to note CIDs in commit messages and that's pretty > helpful -- I don't know that omitting them will generally ruffle any > feathers, though. yes, CIDs are fine, I should of clarified that, I would not want to see the full output from coverty in a commit message unless it was needed to express what was fixed and why in some way. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 25 14:46:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FF4714B7D09; Fri, 25 Jan 2019 14:46:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20B9886AC9; Fri, 25 Jan 2019 14:46:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12C96995F; Fri, 25 Jan 2019 14:46:14 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PEkD8A020319; Fri, 25 Jan 2019 14:46:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PEkDKi020318; Fri, 25 Jan 2019 14:46:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901251446.x0PEkDKi020318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 25 Jan 2019 14:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343429 - head/contrib/llvm/tools/clang/lib/Driver/ToolChains X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/llvm/tools/clang/lib/Driver/ToolChains X-SVN-Commit-Revision: 343429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 20B9886AC9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 14:46:14 -0000 Author: emaste Date: Fri Jan 25 14:46:13 2019 New Revision: 343429 URL: https://svnweb.freebsd.org/changeset/base/343429 Log: clang: default to DWARF 4 as of FreeBSD 13 FreeBSD previously defaulted to DWARF 2 because several tools (gdb, ctfconvert, etc.) did not support later versions. These have either been fixed or are deprecated. Note that gdb 6 still exists but has been moved out of $PATH into /usr/libexec and is intended only for use by crashinfo(8). The kernel build sets the DWARF version explicitly via -gdwarf2, so this should have no effect there. PR: 234887 [exp-run] Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17930 Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp Fri Jan 25 13:57:09 2019 (r343428) +++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp Fri Jan 25 14:46:13 2019 (r343429) @@ -357,6 +357,13 @@ ToolChain::CXXStdlibType FreeBSD::GetDefaultCXXStdlibT return ToolChain::CST_Libstdcxx; } +unsigned FreeBSD::GetDefaultDwarfVersion() const { + // Default to use DWARF 2 before FreeBSD 13. + if (getTriple().getOSMajorVersion() < 13) + return 2; + return 4; +} + void FreeBSD::addLibStdCxxIncludePaths( const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const { Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h Fri Jan 25 13:57:09 2019 (r343428) +++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h Fri Jan 25 14:46:13 2019 (r343429) @@ -70,7 +70,7 @@ class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic const llvm::opt::ArgList &Args) const override; bool isPIEDefault() const override; SanitizerMask getSupportedSanitizers() const override; - unsigned GetDefaultDwarfVersion() const override { return 2; } + unsigned GetDefaultDwarfVersion() const override; // Until dtrace (via CTF) and LLDB can deal with distributed debug info, // FreeBSD defaults to standalone/full debug info. bool GetDefaultStandaloneDebug() const override { return true; } From owner-svn-src-head@freebsd.org Fri Jan 25 15:02:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 163B714B87B0; Fri, 25 Jan 2019 15:02:20 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A10487A53; Fri, 25 Jan 2019 15:02:19 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 662459BA3; Fri, 25 Jan 2019 15:02:19 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PF2Jln030167; Fri, 25 Jan 2019 15:02:19 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PF2JJv030166; Fri, 25 Jan 2019 15:02:19 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201901251502.x0PF2JJv030166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Fri, 25 Jan 2019 15:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343430 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 343430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7A10487A53 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 15:02:20 -0000 Author: gallatin Date: Fri Jan 25 15:02:18 2019 New Revision: 343430 URL: https://svnweb.freebsd.org/changeset/base/343430 Log: Fix an iflib driver unload panic introduced in r343085 The new loop to sync and unload descriptors was indexed by "i", rather than "j". The panic was caused by "i" being advanced rather than "j", and eventually becoming out of bounds. Reviewed by: kib MFC after: 3 days Sponsored by: Netflix Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Fri Jan 25 14:46:13 2019 (r343429) +++ head/sys/net/iflib.c Fri Jan 25 15:02:18 2019 (r343430) @@ -2197,17 +2197,17 @@ iflib_rx_sds_free(iflib_rxq_t rxq) fl = &rxq->ifr_fl[i]; if (fl->ifl_desc_tag != NULL) { if (fl->ifl_sds.ifsd_map != NULL) { - for (j = 0; j < fl->ifl_size; i++) { - if (fl->ifl_sds.ifsd_map[i] == + for (j = 0; j < fl->ifl_size; j++) { + if (fl->ifl_sds.ifsd_map[j] == NULL) - continue; + continue; bus_dmamap_sync( fl->ifl_desc_tag, - fl->ifl_sds.ifsd_map[i], + fl->ifl_sds.ifsd_map[j], BUS_DMASYNC_POSTREAD); bus_dmamap_unload( fl->ifl_desc_tag, - fl->ifl_sds.ifsd_map[i]); + fl->ifl_sds.ifsd_map[j]); } } bus_dma_tag_destroy(fl->ifl_desc_tag); From owner-svn-src-head@freebsd.org Fri Jan 25 16:16:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CC5214BA88E; Fri, 25 Jan 2019 16:16:12 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E09EE8ADD8; Fri, 25 Jan 2019 16:16:11 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3DACA8D6; Fri, 25 Jan 2019 16:16:11 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PGGBeD067755; Fri, 25 Jan 2019 16:16:11 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PGGBvL067751; Fri, 25 Jan 2019 16:16:11 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <201901251616.x0PGGBvL067751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Fri, 25 Jan 2019 16:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343438 - in head: sys/dev/tpm usr.sbin/acpi/acpidump X-SVN-Group: head X-SVN-Commit-Author: takawata X-SVN-Commit-Paths: in head: sys/dev/tpm usr.sbin/acpi/acpidump X-SVN-Commit-Revision: 343438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E09EE8ADD8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 16:16:12 -0000 Author: takawata Date: Fri Jan 25 16:16:10 2019 New Revision: 343438 URL: https://svnweb.freebsd.org/changeset/base/343438 Log: Use ACPI TPM2 table to probe tpmtis and tpmcrb device. Differential Revision: https://reviews.freebsd.org/D18937 Modified: head/sys/dev/tpm/tpm20.h head/sys/dev/tpm/tpm_crb.c head/sys/dev/tpm/tpm_tis.c head/usr.sbin/acpi/acpidump/acpi.c Modified: head/sys/dev/tpm/tpm20.h ============================================================================== --- head/sys/dev/tpm/tpm20.h Fri Jan 25 15:48:00 2019 (r343437) +++ head/sys/dev/tpm/tpm20.h Fri Jan 25 16:16:10 2019 (r343438) @@ -93,6 +93,12 @@ __FBSDID("$FreeBSD$"); #define TPM_CDEV_NAME "tpm0" #define TPM_CDEV_PERM_FLAG 0600 + +#define TPM2_START_METHOD_ACPI 2 +#define TPM2_START_METHOD_TIS 6 +#define TPM2_START_METHOD_CRB 7 +#define TPM2_START_METHOD_CRB_ACPI 8 + struct tpm_sc { device_t dev; Modified: head/sys/dev/tpm/tpm_crb.c ============================================================================== --- head/sys/dev/tpm/tpm_crb.c Fri Jan 25 15:48:00 2019 (r343437) +++ head/sys/dev/tpm/tpm_crb.c Fri Jan 25 16:16:10 2019 (r343438) @@ -104,27 +104,20 @@ char *tpmcrb_ids[] = {"MSFT0101", NULL}; static int tpmcrb_acpi_probe(device_t dev) { - struct resource *res; - int err, rid = 0; - uint32_t caps; - + int err; + ACPI_TABLE_TPM23 *tbl; + ACPI_STATUS status; err = ACPI_ID_PROBE(device_get_parent(dev), dev, tpmcrb_ids, NULL); if (err > 0) return (err); + /*Find TPM2 Header*/ + status = AcpiGetTable(ACPI_SIG_TPM2, 1, (ACPI_TABLE_HEADER **) &tbl); + if(ACPI_FAILURE(status) || + tbl->StartMethod != TPM2_START_METHOD_CRB) + err = ENXIO; - /* Check if device is in CRB mode */ - res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (res == NULL) - return (ENXIO); - - caps = bus_read_4(res, TPM_CRB_INTF_ID); - bus_release_resource(dev, SYS_RES_MEMORY, rid, res); - - if ((caps & TPM_CRB_INTF_ID_TYPE) != TPM_CRB_INTF_ID_TYPE_CRB) - return (ENXIO); - device_set_desc(dev, "Trusted Platform Module 2.0, CRB mode"); - return (BUS_PROBE_DEFAULT); + return (err); } static ACPI_STATUS Modified: head/sys/dev/tpm/tpm_tis.c ============================================================================== --- head/sys/dev/tpm/tpm_tis.c Fri Jan 25 15:48:00 2019 (r343437) +++ head/sys/dev/tpm/tpm_tis.c Fri Jan 25 16:16:10 2019 (r343438) @@ -100,26 +100,21 @@ char *tpmtis_ids[] = {"MSFT0101", NULL}; static int tpmtis_acpi_probe(device_t dev) { - struct resource *res; - int err, rid = 0; - uint32_t caps; + int err; + ACPI_TABLE_TPM23 *tbl; + ACPI_STATUS status; err = ACPI_ID_PROBE(device_get_parent(dev), dev, tpmtis_ids, NULL); if (err > 0) return (err); + /*Find TPM2 Header*/ + status = AcpiGetTable(ACPI_SIG_TPM2, 1, (ACPI_TABLE_HEADER **) &tbl); + if(ACPI_FAILURE(status) || + tbl->StartMethod != TPM2_START_METHOD_TIS) + err = ENXIO; - /* Check if device is in TPM 2.0 TIS mode */ - res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (res == NULL) - return (ENXIO); - - caps = bus_read_4(res, TPM_INTF_CAPS); - bus_release_resource(dev, SYS_RES_MEMORY, rid, res); - if ((caps & TPM_INTF_CAPS_VERSION) != TPM_INTF_CAPS_TPM20) - return (ENXIO); - device_set_desc(dev, "Trusted Platform Module 2.0, FIFO mode"); - return (BUS_PROBE_DEFAULT); + return (err); } static int Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Fri Jan 25 15:48:00 2019 (r343437) +++ head/usr.sbin/acpi/acpidump/acpi.c Fri Jan 25 16:16:10 2019 (r343438) @@ -970,7 +970,18 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp) printf(END_COMMENT); } - +static void acpi_handle_tpm2(ACPI_TABLE_HEADER *sdp) +{ + ACPI_TABLE_TPM2 *tpm2; + + printf (BEGIN_COMMENT); + acpi_print_sdt(sdp); + tpm2 = (ACPI_TABLE_TPM2 *) sdp; + printf ("\t\tControlArea=%lx\n", tpm2->ControlAddress); + printf ("\t\tStartMethod=%x\n", tpm2->StartMethod); + printf (END_COMMENT); +} + static const char * devscope_type2str(int type) { @@ -1769,6 +1780,8 @@ acpi_handle_rsdt(ACPI_TABLE_HEADER *rsdp) acpi_handle_wddt(sdp); else if (!memcmp(sdp->Signature, ACPI_SIG_LPIT, 4)) acpi_handle_lpit(sdp); + else if (!memcmp(sdp->Signature, ACPI_SIG_TPM2, 4)) + acpi_handle_tpm2(sdp); else { printf(BEGIN_COMMENT); acpi_print_sdt(sdp); From owner-svn-src-head@freebsd.org Fri Jan 25 17:08:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA04F14BB75A; Fri, 25 Jan 2019 17:08:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 58EFE8C70F; Fri, 25 Jan 2019 17:08:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 483F9B172; Fri, 25 Jan 2019 17:08:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PH8T9H094166; Fri, 25 Jan 2019 17:08:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PH8Tqe094165; Fri, 25 Jan 2019 17:08:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201901251708.x0PH8Tqe094165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 25 Jan 2019 17:08:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343439 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 343439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 58EFE8C70F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 17:08:29 -0000 Author: tuexen Date: Fri Jan 25 17:08:28 2019 New Revision: 343439 URL: https://svnweb.freebsd.org/changeset/base/343439 Log: Don't include two header files when not needed. This allows the part of the rewrite of TCP reassembly in this files to be MFCed to stable/11 with manual change. MFC after: 3 days Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_reass.c Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Fri Jan 25 16:16:10 2019 (r343438) +++ head/sys/netinet/tcp_reass.c Fri Jan 25 17:08:28 2019 (r343439) @@ -38,6 +38,10 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_tcpdebug.h" +/* For debugging we want counters and BB logging */ +/* #define TCP_REASS_COUNTERS 1 */ +/* #define TCP_REASS_LOGGING 1 */ + #include #include #include @@ -72,8 +76,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef TCP_REASS_LOGGING #include #include +#endif #include #include #ifdef TCPDEBUG @@ -91,10 +97,6 @@ __FBSDID("$FreeBSD$"); #define TCP_R_LOG_ZERO 9 #define TCP_R_LOG_DUMP 10 #define TCP_R_LOG_TRIM 11 - -/* For debugging we want counters and BB logging */ -/* #define TCP_REASS_COUNTERS 1 */ -/* #define TCP_REASS_LOGGING 1 */ static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, "TCP Segment Reassembly Queue"); From owner-svn-src-head@freebsd.org Fri Jan 25 17:09:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D32D914BB7D8; Fri, 25 Jan 2019 17:09:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 728B28C886; Fri, 25 Jan 2019 17:09:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CB2BB174; Fri, 25 Jan 2019 17:09:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PH9RUV094380; Fri, 25 Jan 2019 17:09:27 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PH9Rc4094379; Fri, 25 Jan 2019 17:09:27 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201901251709.x0PH9Rc4094379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 25 Jan 2019 17:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343440 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 343440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 728B28C886 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 17:09:28 -0000 Author: trasz Date: Fri Jan 25 17:09:26 2019 New Revision: 343440 URL: https://svnweb.freebsd.org/changeset/base/343440 Log: Comment out the default sh(1) aliases for root, introduced in r343416. The rest of this stuff is still to be discussed, but I think at this point we have the agreement that the aliases should go. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/bin/sh/dot.shrc Modified: head/bin/sh/dot.shrc ============================================================================== --- head/bin/sh/dot.shrc Fri Jan 25 17:08:28 2019 (r343439) +++ head/bin/sh/dot.shrc Fri Jan 25 17:09:26 2019 (r343440) @@ -18,13 +18,13 @@ # set -o vi -# some useful aliases -alias h='fc -l' -alias j=jobs -alias m="$PAGER" -alias ll='ls -laFo' -alias l='ls -l' -alias g='egrep -i' +# # some useful aliases +# alias h='fc -l' +# alias j=jobs +# alias m="$PAGER" +# alias ll='ls -laFo' +# alias l='ls -l' +# alias g='egrep -i' # # be paranoid # alias cp='cp -ip' From owner-svn-src-head@freebsd.org Fri Jan 25 17:51:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A91CE14BCB94; Fri, 25 Jan 2019 17:51:14 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D1848E5D3; Fri, 25 Jan 2019 17:51:14 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x442.google.com with SMTP id r10so11194967wrs.10; Fri, 25 Jan 2019 09:51:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=AbPSQOKc4fpbKBQbOI4GvE9uFwXNsA9+vNjnNoRmIVs=; b=HM5rHUCOWSRkTmQl+xVPoivpxt9G2PGFDt9oKd3VQ7mk3jScvpdT6CO+Ffvum+pRwf s5R5TFsBPEeFeqIIdQg9z3qtnOFZtJHvIpEzZj8ttBlZXv+pWyHBDSSwqUm04rGI3MEJ kHmkyt1aqYM+GNCaRahLc4RYCAkJ/qYcEZJ3ktg5aaZUmbreONYB4n7qAvMgtt+Jn7Rt 9rqn4t1LI+JKlSxRJ3FveoZ2sQViSYBXNbMqP49JyDbckvVFxxmKIn6cQUhDtecdTfu2 pQU5j+J19smvAogkLKxIxLedzS6itC4FscakFP37bBGMfv+bzHl/JNlmxQuHP5YyunXh YIGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=AbPSQOKc4fpbKBQbOI4GvE9uFwXNsA9+vNjnNoRmIVs=; b=D4YXYCm+329ucsB+oycQ8LWAVfvB9Wus1gkVblH/7oFMgMSWbxfYIBLxauk7koNAQt OP8ABtNTzhM1cXA30gfE7t7UeDHRB1C9iKZOxk2lnZ5xFh7T46HF2m0pz7Ur2gqEId9P k3HIKbknGlWRKHjSaPPWFQ1euKg1LNIGoZx1M8NvsfjFe9OlxdPSpdsXyNTFYol0OOgH uNtSHLeE0DiAw4EoxJmTztYOYyx8hdKQgKcZklPJVL3q6Q8yGg2lfqnZ10k4yV6btlXH wjmfskQcfUZnFUOVpIp1kyOcdZTbyRcFQ1r6l5RPwQ0m9S0FSWVPypAl7EVGQ/HhRhX1 NOcQ== X-Gm-Message-State: AJcUukeG2FmX8okQJSUyi7tSv2t0ZEhdSGGf3DovzMiqinVc/OaGS0jO OKd9k0phrGzZ0bQWdm1VLnPsFF+n X-Google-Smtp-Source: ALg8bN63mEap8rOPcMNSEXwoex4IfeLuw9X8Q0jEQFds4Ylg93FvmEeX/szJh4UZp6k8JWKsUkyaHQ== X-Received: by 2002:adf:b190:: with SMTP id q16mr12450018wra.95.1548438672305; Fri, 25 Jan 2019 09:51:12 -0800 (PST) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id t5sm72885599wmd.15.2019.01.25.09.51.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 09:51:11 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 25 Jan 2019 06:02:58 +0000 From: Edward Napierala To: rgrimes@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343416 - head/bin/sh Message-ID: <20190125060258.GA25351@v2> Mail-Followup-To: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901251339.x0PDd5sG088601@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201901251339.x0PDd5sG088601@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 1D1848E5D3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 17:51:14 -0000 The aliases are gone, let's continue on the remaining bits below. On 0125T0539, Rodney W. Grimes wrote: > > pt., 25 sty 2019 o 11:24 Rodney W. Grimes > > napisa?(a): > > > > > > > On 0124T1555, Rodney W. Grimes wrote: > > > > > > Author: trasz > > > > > > Date: Thu Jan 24 23:34:51 2019 > > > > > > New Revision: 343416 [..] > > > People that want a Borne shell type interactive shell > > > invariable choose bash, ksh or some other shell, not > > > our /bin/sh which is lean mean and a fast machine > > > because the base system uses it so much. > > > > That's true. But we discourage using shells from ports/packages > > as root shell. > > I am not so sure on that, it use to be more so because /bin/sh > was statically linked and needed no lib's to run, well that > is gone out the window. There is also the issue that other > shells are installed into /usr/local/bin, which may or may > not be mounted (less likely now that zfs and be's are all > the rage.) Most of the reasons to discourage a pkg root > shell are now gone. Yeah. Still, the commit doesn't make it in any way harder, and provides a more familiar default. > > The easiest thing for a new user to do if they want > > a Bourne-compatible shell for root is to just use chsh(1). And > > here's what happens: you get greeted with an alien-looking > > (new folks usually come from Linux or OSX background) '$' > If that is alien looking then they need some education on > how the tool they are using works and how to use it. It is alien, because it's different from their experience from other systems they are used to. Sure, they will know it is _a_ prompt. It's just that they'll consider it quite weird and not very useful, in particular the lack of directory part. There's also the consistency argument - our tcsh doesn't use a plain '%'. > > prompt. Which is not a problem, of course, just define PS1, > > and perhaps some aliases, in a newly created /root/.shrc. > > Except... that doesn't work, despite the fact that it works just > > fine for accounts other than root, and that's also how you would > > fix it with bash. And then you end up having to read the sh(1) > > manual page to discover the ENV. > Or read the .profile of there user account and actually > understand some of these details. IMHO this is about user > education and rather than dumb the system down we should > try to raise the level of knowledge. I think this is the main point of disagreement. Sure, learning is good, but I'm a big fan of providing useful defaults if possible. Our default csh prompt - now also used by sh - is a pretty good, imho. And it's not just FreeBSD that's been using it (with csh) for years - Ubuntu comes with something pretty close. [..] > > > I am sure there are a few of us around that would actually > > > like to see the ones left go away and view them as contamination > > > to what should be the domain of a site administrator or > > > personal taste. > > > > > > Just as some of us would really rather have > > > cd home > > > return the proper error rather than doing some > > > magic when there is not a ./home to cd into. > > > And having ls .. ; cd ..; ls give 2 different outputs > > > is just.. well something that should confuse the > > > heck out of a new user, yet seems completely fine > > > to have in the system. Note the above becomes > > > a fatal mistake when the second ls is a rm > > > with wild cards. > > > > That's a historical mistake we can't really fix, I'm afraid, > > unless we want to break compatibility with other systems. > > I seriously doubt that are a lot of people depending > on cd home to do what it does, most would be lazy > like me and type cd ~. This is somewhat orthogonal to the main topic. But it's not about 'cd home' at all; it's the result of an architectural problem in Unix kernel that most shells try to work around. > > > Howerver I do understand the need to assist the new person > > > or less informed that do not pack an emacs size environment > > > with them that there are nifty things they can do > > > to make life easier. Perhaps making more extensive > > > comments in the skel files, or even adding pointers in them > > > to a set of /usr/share/example/ files? Perhaps pointers > > > in roots .files to the skel files as "for a better example > > > of what can be done in this file see foo". > > > > I'd expect pretty much every user new to FreeBSD to already > > know about what they can do with shell files. And there's > > plenty of advice for that too, including the sources mentioned > > by Cy. > > > > There are two things, however: first, they don't neccessarily > > know about things specific to FreeBSD sh(1), such as requiring > > the ENV to be set to actually read the ~/.shrc. > > Is that only the freebsd shell, I thought most shells need > special stuff done to get them to do much more than processes > .profile. Bash - which is what I'd expect most new users to have experience with - reads ~/.bashrc automatically, without the ENV. (Bash is somewhat weird, and so the ~/.bash_profile usually sources ~/.bashrc, but that's unrelated). Zsh reads ~/.zshrc automatically as well. So yeah, new users probably don't expect they have to set something in ~/.profile. > > And second, it's just nice to new users to make stuff just a tiny > > bit more familiar looking. This includes installing the file they can > > edit (/root/.shrc), and setting the prompt to something that > > resembles other systems. That's exactly what we do for csh(1). > > I am ok installing .shrc, I am ok putting a commented ENV in > /root/.profile to say uncomment this if you want .shrc to be > read for interactive shells. > > Document document document, but changing the existing very > long standing behavior in the name of "just nice to new users" > at the cost of agitating many of the current users is no > good. Can the change actually break anything for existing users? It doesn't affect existing installs. It doesn't affect people who run the default root shell (tcsh), nor folks who use shells from ports/packages. And it doesn't affect the ones who actually have their own /root/.shrc to copy over. My understanding is that the only ones affected are the current users who depend on _not_ having /root/.shrc despite using sh(1) as their root shell. And for folks who do have their own tree with their preferred /root/.shrc to "make distribution" from, it should actually make their diff to upstream smaller. > As to prompts, well, those are very personalized things > and vary more than the colors of bike sheds, best left > to the site or personal admin. Again, my arguments for doing this are being more familiar to newcomers and being consistent with ourselves in the remaining three cases (csh(1) for both root and non-root users, and sh(1) for non-root users). > > > > > This is really the domain of a systems administrator to > > > > > decide and making work for them to clean this out is > > > > > not going to make them happy. > > > > > > > > Problem is, we're in a strage situation where we ship with > > > > root shell which is just broken - basic shell syntax doesn't > > > > work - and the out-of-box alternative provides you with > > > > a VMS prompt. Not the best first impression to make, I'd say. > > > > > > Huh? Now I think you have gone off the other end, > > > would you please explain how some alias in .shrc fix anything > > > broken with /bin/sh or roots use of it? > > > > > > Can you expand on exactly what syntax this commit fixes please? > > > > The way this commit fixes syntax problems of the default root > > shell (which is csh(1)) is that you can easily change the root shell > > and end up with something that looks just like before, but this > > time accepting the Bourne syntax. That's how it works for non-root > > users; this commit makes the same apply to root. > > That is not a syntax problem. That is a difference of the fact that > roots environment is pretty sanitary and a users is not, and for good > reason on the former. It is a syntax problem: trasz@v2:~ % while :; do date; sleep 1; done while: Expression Syntax. do: Command not found. done: Command not found. Obviously I'm not recommending changing the default root shell, but this commit makes it easier for the user to change theirs. [..] From owner-svn-src-head@freebsd.org Fri Jan 25 18:13:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7235514BD1BF; Fri, 25 Jan 2019 18:13:21 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13C468F443; Fri, 25 Jan 2019 18:13:21 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id D18DD17172; Fri, 25 Jan 2019 18:13:20 +0000 (UTC) Date: Fri, 25 Jan 2019 18:13:20 +0000 From: Alexey Dokuchaev To: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343416 - head/bin/sh Message-ID: <20190125181320.GA5015@FreeBSD.org> References: <201901251339.x0PDd5sG088601@pdx.rh.CN85.dnsmgr.net> <20190125060258.GA25351@v2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190125060258.GA25351@v2> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 13C468F443 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.87 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.87)[-0.873,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 18:13:21 -0000 On Fri, Jan 25, 2019 at 06:02:58AM +0000, Edward Napierala wrote: > The aliases are gone, let's continue on the remaining bits below. They are not gone, they were commented out; also, bogus double linefeeds are not gone. But most importantly, this whole file is useless and IMHO should just be removed. /bin/sh is not supposed to be one's interactive shell. > It is alien, because it's different from their experience > from other systems they are used to. This argument does not really hold because /bin/sh is not... see above. > It doesn't affect existing installs. It doesn't affect people > who run the default root shell (tcsh), nor folks who use shells AFAICT default root shell is /bin/csh, not tcsh. ;-) But that also means that /usr/src/bin/sh/dot.shrc doesn't have to exist: those who change the root shell should either pick another interactive shell, or if they want /bin/sh be ready to deal with sanitary environment. > And for folks who do have their own tree with their preferred > /root/.shrc to "make distribution" from, it should actually make > their diff to upstream smaller. I don't like extra files, esp. configuration files that look like they are for interactive shell while our /bin/sh is in fact not. This is confusing, and FreeBSD is not supposed to be confusing. > It is a syntax problem: > > trasz@v2:~ % while :; do date; sleep 1; done > while: Expression Syntax. > do: Command not found. > done: Command not found. Are you trying to use sh(1) loop in (t)csh? Why? And what does it have to do with the /usr/src/bin/sh/dot.shrc issue? ./danfe From owner-svn-src-head@freebsd.org Fri Jan 25 18:23:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6347714BD5E7 for ; Fri, 25 Jan 2019 18:23:15 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0FBD8FB4C for ; Fri, 25 Jan 2019 18:23:14 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb1-xb36.google.com with SMTP id k9so3684391ybg.1 for ; Fri, 25 Jan 2019 10:23:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Objjj4un4U35y7rbuOftV4znjkTzyQQSM7KheT0gsZk=; b=WbAOQDNxIE6eAoFiHmvq2McFgWfclfg+1IDzfE45DMj8wFO68TxFy+zdAFTQqHb0lL Tb+l9nYlGx+625DfhFElzOIp5C9y6eQWC2SXlsvkcYClZ8wKT0LYRo7NDI4SlmUgJOcZ ytoPOln8WwwK2HxiSr4s80aeWImwX1h/b1d/Q1BhLqQXC4U44VL2z7VY3MNtCeySF/dU vLHoK8O+TdLeQpiIbHfRpHwIRPPJdU289rXe2QFnt3abDvqcxhBwcoQCm9QYd35L0Ojw EbGmcanxbQEDDRV8HxU2eXdIF+msna0srFeXcZ7oKbHDQbtqL1+pk7452/s+VTqHqm2Z pYUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Objjj4un4U35y7rbuOftV4znjkTzyQQSM7KheT0gsZk=; b=M7BERnLV/2UQXHJY1O8dc7L6KjCyQwaAjYSCX5Pjw28juemvG8GuHKpjlVsouXSsiL kHx2En/HTyTOYVJimGMQmVfrF1fk2rQCPd2hwLnqELDajJGDJVd7OG2goorPr6QsaYbS TkdoDwseuTzrg/CcapUORS+1Pnv2ASk3/purS8Y5TD2IM4OBXBMq2KfwZ1Q5gnrjWqJD Z9k4xgxgnGBkO+E2MXMxUJUfVSx9PJOai+sJe/veTItBXFMk+Exh+D+pK3U6JC79J/sb O+Xav0WB9KusUwgyIl7Bm4FLL+wWzxZE9hKedbIBtOpGdgqxSieXtJyUyVuynhKvnpMg R1Ow== X-Gm-Message-State: AJcUukf75Nf3/BXVU9WsWnyEQLXsW99r3LZPxicTpOcQjYs/i7PeXzIv bDIWUiKCTlaBgZsMCKAfgXW4HrS+Y9z8i6bIVro/og== X-Google-Smtp-Source: ALg8bN75mFjUSnq/dNeHISIjILIf0pUOIrl2S5LNaj0fcXs16VtWF5SQdM5D3GUs1V168lVI23364FsuI4fiY8sNwvs= X-Received: by 2002:a25:bd5:: with SMTP id 204mr11658825ybl.486.1548440594319; Fri, 25 Jan 2019 10:23:14 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5b:ec8:0:0:0:0:0 with HTTP; Fri, 25 Jan 2019 10:23:13 -0800 (PST) In-Reply-To: <20190125181320.GA5015@FreeBSD.org> References: <201901251339.x0PDd5sG088601@pdx.rh.CN85.dnsmgr.net> <20190125060258.GA25351@v2> <20190125181320.GA5015@FreeBSD.org> From: Oliver Pinter Date: Fri, 25 Jan 2019 19:23:13 +0100 Message-ID: Subject: Re: svn commit: r343416 - head/bin/sh To: Alexey Dokuchaev Cc: "rgrimes@freebsd.org" , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: F0FBD8FB4C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.978,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 18:23:15 -0000 On Friday, January 25, 2019, Alexey Dokuchaev wrote: > On Fri, Jan 25, 2019 at 06:02:58AM +0000, Edward Napierala wrote: > > The aliases are gone, let's continue on the remaining bits below. > > They are not gone, they were commented out; also, bogus double linefeeds > are not gone. But most importantly, this whole file is useless and IMHO > should just be removed. /bin/sh is not supposed to be one's interactive > shell. False. Since the ability to install the system from pkg, and the ability to remove the tcsh package easily, someone really want to or try to use sh as their default interactive shell. >From other hand there are no clear communication about the fact that the /bin/sh isn't suitable for interactive in non-developer visible place - like in motd or in official documentations, fix me if I'm wrong. > > > It is alien, because it's different from their experience > > from other systems they are used to. > > This argument does not really hold because /bin/sh is not... see above. > > > It doesn't affect existing installs. It doesn't affect people > > who run the default root shell (tcsh), nor folks who use shells > > AFAICT default root shell is /bin/csh, not tcsh. ;-) But that also > means that /usr/src/bin/sh/dot.shrc doesn't have to exist: those who > change the root shell should either pick another interactive shell, > or if they want /bin/sh be ready to deal with sanitary environment. > > > And for folks who do have their own tree with their preferred > > /root/.shrc to "make distribution" from, it should actually make > > their diff to upstream smaller. > > I don't like extra files, esp. configuration files that look like they > are for interactive shell while our /bin/sh is in fact not. This is > confusing, and FreeBSD is not supposed to be confusing. > > > It is a syntax problem: > > > > trasz@v2:~ % while :; do date; sleep 1; done > > while: Expression Syntax. > > do: Command not found. > > done: Command not found. > > Are you trying to use sh(1) loop in (t)csh? Why? And what does it have > to do with the /usr/src/bin/sh/dot.shrc issue? > > ./danfe > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Fri Jan 25 18:40:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D0E314BE38B; Fri, 25 Jan 2019 18:40:13 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C94469DDF; Fri, 25 Jan 2019 18:40:12 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm1-x329.google.com with SMTP id y139so7645760wmc.5; Fri, 25 Jan 2019 10:40:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=F72dsnYucTEvLWFiMeZq782aDMFJuV0wADbrGL6ZDSg=; b=bDdixyN0ldIot7x7Qq59MR5R8Lxsh3orxHc/L4nEhC73vGNPOBDF6oqVitwXdHnIhn niqdcf7zoS9OQUYHHtl4OKDDa0wPE5mlGqSatlhEsFMk+NUvrnc1mBpdBZ19uESFZJ0r mSj5h/zUgOeoIHqU5oPJDw83JdGtqvNBWNacmk3tjZ+PAuULRGJclay5VVo8ngAkpcA9 b3/sLwdcCWTw1cZwD5LuUyU30tOPgn2oyT6Wzsc0IYkvFXhnwszJeC7Xtlli61EChV2P pWRO2sCH8PAIHjnpx79h3AY0lJFWxdyb9Xdp9fZjffCN5UEw4isl70HUDmZJkgqYoumB W5TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=F72dsnYucTEvLWFiMeZq782aDMFJuV0wADbrGL6ZDSg=; b=UdKwfZfCpXlg9VzbWyjPH426ldVywjD+ckviXOXDpLJzqKe9lJfKohwkJCg6SilP13 Ffh4dGewbwog8yH79DfItt75aoMRN4bpd3CqBK0JqdGdGOgWHmwO5FYOxVwxSqjLUJYe byKWq8yzgfx7aiwyikpY6OaJaDZlfl+l9DlwEBoeoZn7bxmJds845aOqHkh+xeY0fKg6 VybAXqAQKNvYVhtTYq3mjLKPjI9sjjG0l7hon0bixHZ96Egtu7Kif4F7xLP6IGOh4Kq8 dDnpcfW0W78eGy8vZW+6wxGHi5p8/9USinIrQy5PJlcDGuv6Mbzcxs8Pndms4SKad0Os tYgg== X-Gm-Message-State: AJcUukfxesmQp2uPV8grSMVdKw+m99+FcGmaIWEK2HIymqc7kmoI2neP eEoO4eDRMVsgov2LDzOl799pTMcG X-Google-Smtp-Source: ALg8bN4zhBwdam0x4vW04sqr3kgH5OqeCZbI9dYvXsxrsOyfXAcRlVPMgSUIdlFejhyr1MFWbTs0uA== X-Received: by 2002:a1c:13d1:: with SMTP id 200mr7738419wmt.4.1548441610752; Fri, 25 Jan 2019 10:40:10 -0800 (PST) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id v16sm87112016wrs.75.2019.01.25.10.40.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 10:40:09 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 25 Jan 2019 06:51:56 +0000 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Alexey Dokuchaev Cc: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343416 - head/bin/sh Message-ID: <20190125065156.GA25806@v2> Mail-Followup-To: Alexey Dokuchaev , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901251339.x0PDd5sG088601@pdx.rh.CN85.dnsmgr.net> <20190125060258.GA25351@v2> <20190125181320.GA5015@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190125181320.GA5015@FreeBSD.org> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 6C94469DDF X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 18:40:13 -0000 On 0125T1813, Alexey Dokuchaev wrote: > On Fri, Jan 25, 2019 at 06:02:58AM +0000, Edward Napierala wrote: > > The aliases are gone, let's continue on the remaining bits below. > > They are not gone, they were commented out; also, bogus double linefeeds > are not gone. Yeah, I've matched the existing comment style in that file. > But most importantly, this whole file is useless and IMHO > should just be removed. /bin/sh is not supposed to be one's interactive > shell. Of course it is an interactive shell. We've been using it as the default interactive shell for non-root accounts since... ages. > > It is alien, because it's different from their experience > > from other systems they are used to. > > This argument does not really hold because /bin/sh is not... see above. > > > It doesn't affect existing installs. It doesn't affect people > > who run the default root shell (tcsh), nor folks who use shells > > AFAICT default root shell is /bin/csh, not tcsh. ;-) But that also Our csh _is_ tcsh. > means that /usr/src/bin/sh/dot.shrc doesn't have to exist: those who > change the root shell should either pick another interactive shell, > or if they want /bin/sh be ready to deal with sanitary environment. See above. > > And for folks who do have their own tree with their preferred > > /root/.shrc to "make distribution" from, it should actually make > > their diff to upstream smaller. > > I don't like extra files, esp. configuration files that look like they > are for interactive shell while our /bin/sh is in fact not. This is > confusing, and FreeBSD is not supposed to be confusing. Again, sh(1) is an interactive shell. > > It is a syntax problem: > > > > trasz@v2:~ % while :; do date; sleep 1; done > > while: Expression Syntax. > > do: Command not found. > > done: Command not found. > > Are you trying to use sh(1) loop in (t)csh? Why? And what does it have > to do with the /usr/src/bin/sh/dot.shrc issue? I'm trying to explain the basic problem with our default shell: it doesn't work, because it can't handle what people call the shell syntax. From owner-svn-src-head@freebsd.org Fri Jan 25 18:48:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1436214BE612; Fri, 25 Jan 2019 18:48:22 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF5246A353; Fri, 25 Jan 2019 18:48:21 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FAB9C494; Fri, 25 Jan 2019 18:48:21 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PImLpY047229; Fri, 25 Jan 2019 18:48:21 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PImL5F047228; Fri, 25 Jan 2019 18:48:21 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201901251848.x0PImL5F047228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 25 Jan 2019 18:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343442 - in head: contrib/netbsd-tests/lib/libm lib/msun/tests X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head: contrib/netbsd-tests/lib/libm lib/msun/tests X-SVN-Commit-Revision: 343442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF5246A353 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 18:48:22 -0000 Author: lwhsu Date: Fri Jan 25 18:48:20 2019 New Revision: 343442 URL: https://svnweb.freebsd.org/changeset/base/343442 Log: Temporarily mark lib.msun.{cbrt_test.cbrtl_powl,trig_test.reduction} expected failure after clang700-import merge PR: 234040 Reviewed by: ngie, markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18938 Modified: head/contrib/netbsd-tests/lib/libm/t_cbrt.c head/lib/msun/tests/trig_test.c Modified: head/contrib/netbsd-tests/lib/libm/t_cbrt.c ============================================================================== --- head/contrib/netbsd-tests/lib/libm/t_cbrt.c Fri Jan 25 18:30:12 2019 (r343441) +++ head/contrib/netbsd-tests/lib/libm/t_cbrt.c Fri Jan 25 18:48:20 2019 (r343442) @@ -268,6 +268,10 @@ ATF_TC_BODY(cbrtl_powl, tc) long double y, z; size_t i; +#if defined(__amd64__) && defined(__clang__) && __clang_major__ >= 7 + atf_tc_expect_fail("test fails with clang 7+ - bug 234040"); +#endif + for (i = 0; i < __arraycount(x); i++) { y = cbrtl(x[i]); Modified: head/lib/msun/tests/trig_test.c ============================================================================== --- head/lib/msun/tests/trig_test.c Fri Jan 25 18:30:12 2019 (r343441) +++ head/lib/msun/tests/trig_test.c Fri Jan 25 18:48:20 2019 (r343442) @@ -160,6 +160,10 @@ ATF_TC_BODY(reduction, tc) unsigned i; +#if defined(__amd64__) && defined(__clang__) && __clang_major__ >= 7 + atf_tc_expect_fail("test fails with clang 7+ - bug 234040"); +#endif + for (i = 0; i < nitems(f_pi_odd); i++) { ATF_CHECK(fabs(sinf(f_pi_odd[i])) < FLT_EPSILON); ATF_CHECK(cosf(f_pi_odd[i]) == -1.0); From owner-svn-src-head@freebsd.org Fri Jan 25 19:36:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA93D14BF85E; Fri, 25 Jan 2019 19:36:21 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70D916C1D7; Fri, 25 Jan 2019 19:36:21 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F947CD4E; Fri, 25 Jan 2019 19:36:21 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PJaLCD073231; Fri, 25 Jan 2019 19:36:21 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PJaL8e073230; Fri, 25 Jan 2019 19:36:21 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901251936.x0PJaL8e073230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 25 Jan 2019 19:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343443 - head/sys/mips/nlm X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/mips/nlm X-SVN-Commit-Revision: 343443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 70D916C1D7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 19:36:22 -0000 Author: gonzo Date: Fri Jan 25 19:36:20 2019 New Revision: 343443 URL: https://svnweb.freebsd.org/changeset/base/343443 Log: [mips] remove dublicate values in enable mask in nlm_usb_intr_en PR: 230572 Submitted by: David Binderman MFC after: 1 week Modified: head/sys/mips/nlm/usb_init.c Modified: head/sys/mips/nlm/usb_init.c ============================================================================== --- head/sys/mips/nlm/usb_init.c Fri Jan 25 18:48:20 2019 (r343442) +++ head/sys/mips/nlm/usb_init.c Fri Jan 25 19:36:20 2019 (r343443) @@ -52,8 +52,7 @@ nlm_usb_intr_en(int node, int port) port_addr = nlm_get_usb_regbase(node, port); val = nlm_read_usb_reg(port_addr, USB_INT_EN); val = USB_CTRL_INTERRUPT_EN | USB_OHCI_INTERRUPT_EN | - USB_OHCI_INTERRUPT1_EN | USB_CTRL_INTERRUPT_EN | - USB_OHCI_INTERRUPT_EN | USB_OHCI_INTERRUPT2_EN; + USB_OHCI_INTERRUPT1_EN | USB_OHCI_INTERRUPT2_EN; nlm_write_usb_reg(port_addr, USB_INT_EN, val); } From owner-svn-src-head@freebsd.org Fri Jan 25 19:56:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9725614C06EC; Fri, 25 Jan 2019 19:56:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14C596D201; Fri, 25 Jan 2019 19:56:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0159CD0BE; Fri, 25 Jan 2019 19:56:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PJu2lJ083445; Fri, 25 Jan 2019 19:56:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PJu28l083444; Fri, 25 Jan 2019 19:56:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201901251956.x0PJu28l083444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Fri, 25 Jan 2019 19:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343444 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 343444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 14C596D201 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 19:56:03 -0000 Author: ngie Date: Fri Jan 25 19:56:02 2019 New Revision: 343444 URL: https://svnweb.freebsd.org/changeset/base/343444 Log: Document that `sendfile` will return an invalid value for `sbytes` if provided an invalid address This is meant to clarify the fact that the system call will not fail with -1/EFAULT, as one might expect, when reading the sendfile(2) manpage today. While here, pet the mandoc linter, when dealing with the section that describes valid values for `flags`. PR: 232210 MFC after: 2 weeks Approved by: emaste (mentor) Reviewed by: glebius, 0mp Differential Revision: https://reviews.freebsd.org/D18949 Modified: head/lib/libc/sys/sendfile.2 Modified: head/lib/libc/sys/sendfile.2 ============================================================================== --- head/lib/libc/sys/sendfile.2 Fri Jan 25 19:36:20 2019 (r343443) +++ head/lib/libc/sys/sendfile.2 Fri Jan 25 19:56:02 2019 (r343444) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 12, 2018 +.Dd January 25, 2019 .Dt SENDFILE 2 .Os .Sh NAME @@ -104,7 +104,7 @@ variable pointed to by The least significant 16 bits of .Fa flags argument is a bitmap of these values: -.Bl -tag -offset indent +.Bl -tag -offset indent -width "SF_USER_READAHEAD" .It Dv SF_NODISKIO This flag causes .Nm @@ -403,3 +403,14 @@ The .Fx 11 implementation was written by .An Gleb Smirnoff Aq Mt glebius@FreeBSD.org . +.Sh BUGS +The +.Fn sendfile +system call will not fail, i.e., return +.Dv -1 +and set +.Va errno +to +.Er EFAULT , +if provided an invalid address for +.Fa sbytes . From owner-svn-src-head@freebsd.org Fri Jan 25 19:57:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FBB814C085F; Fri, 25 Jan 2019 19:57:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 937206D6E3; Fri, 25 Jan 2019 19:57:41 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0PJvdmE089918; Fri, 25 Jan 2019 11:57:39 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0PJvdTL089917; Fri, 25 Jan 2019 11:57:39 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343440 - head/bin/sh In-Reply-To: <201901251709.x0PH9Rc4094379@repo.freebsd.org> To: Edward Tomasz Napierala Date: Fri, 25 Jan 2019 11:57:39 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 937206D6E3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 19:57:42 -0000 > Author: trasz > Date: Fri Jan 25 17:09:26 2019 > New Revision: 343440 > URL: https://svnweb.freebsd.org/changeset/base/343440 > > Log: > Comment out the default sh(1) aliases for root, introduced in r343416. > The rest of this stuff is still to be discussed, but I think at this > point we have the agreement that the aliases should go. > > MFC after: 2 weeks > Sponsored by: DARPA, AFRL Please just revert this and the prior commit out, and when the path forward is clear commit it. I would not want any of this merged to 12/ or 11/ until the time that it is all settled. Rod > Modified: > head/bin/sh/dot.shrc > > Modified: head/bin/sh/dot.shrc > ============================================================================== > --- head/bin/sh/dot.shrc Fri Jan 25 17:08:28 2019 (r343439) > +++ head/bin/sh/dot.shrc Fri Jan 25 17:09:26 2019 (r343440) > @@ -18,13 +18,13 @@ > # set -o vi > > > -# some useful aliases > -alias h='fc -l' > -alias j=jobs > -alias m="$PAGER" > -alias ll='ls -laFo' > -alias l='ls -l' > -alias g='egrep -i' > +# # some useful aliases > +# alias h='fc -l' > +# alias j=jobs > +# alias m="$PAGER" > +# alias ll='ls -laFo' > +# alias l='ls -l' > +# alias g='egrep -i' > > # # be paranoid > # alias cp='cp -ip' > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 25 19:59:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FE7214C0A1E; Fri, 25 Jan 2019 19:59:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 377296DC6C; Fri, 25 Jan 2019 19:59:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C7C8D0E0; Fri, 25 Jan 2019 19:58:57 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PJwu15085073; Fri, 25 Jan 2019 19:58:56 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PJwuIb085072; Fri, 25 Jan 2019 19:58:56 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901251958.x0PJwuIb085072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 25 Jan 2019 19:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343446 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 343446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 377296DC6C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 19:59:00 -0000 Author: gonzo Date: Fri Jan 25 19:58:56 2019 New Revision: 343446 URL: https://svnweb.freebsd.org/changeset/base/343446 Log: [mips] remove check that is always false (unsinged < 0) cpuid and local cpu variable are unsigned so checking if value is less than zero always yields false. PR: 211088 Submitted by: David Binderman MFC after: 1 week Modified: head/sys/mips/mips/tlb.c Modified: head/sys/mips/mips/tlb.c ============================================================================== --- head/sys/mips/mips/tlb.c Fri Jan 25 19:56:06 2019 (r343445) +++ head/sys/mips/mips/tlb.c Fri Jan 25 19:58:56 2019 (r343446) @@ -348,7 +348,7 @@ DB_SHOW_COMMAND(tlb, ddb_dump_tlb) else cpu = PCPU_GET(cpuid); - if (cpu < 0 || cpu >= mp_ncpus) { + if (cpu >= mp_ncpus) { db_printf("Invalid CPU %u\n", cpu); return; } From owner-svn-src-head@freebsd.org Fri Jan 25 20:02:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71AA814C1124; Fri, 25 Jan 2019 20:02:56 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 188A16F3C2; Fri, 25 Jan 2019 20:02:56 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0ADF1D2AF; Fri, 25 Jan 2019 20:02:56 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PK2tev092534; Fri, 25 Jan 2019 20:02:55 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PK2tB2092533; Fri, 25 Jan 2019 20:02:55 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901252002.x0PK2tB2092533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 25 Jan 2019 20:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343448 - head/sys/mips/ingenic X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/mips/ingenic X-SVN-Commit-Revision: 343448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 188A16F3C2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:02:56 -0000 Author: gonzo Date: Fri Jan 25 20:02:55 2019 New Revision: 343448 URL: https://svnweb.freebsd.org/changeset/base/343448 Log: [mips] Fix counter mask in jz4780 timer driver Fix dublicate value in what is apparent copypaste mistake. The last value in mask is supposed to be for counter 7, not counter 3. PR: 229790 Submitted by: David Binderman MFC after: 1 week Modified: head/sys/mips/ingenic/jz4780_timer.c Modified: head/sys/mips/ingenic/jz4780_timer.c ============================================================================== --- head/sys/mips/ingenic/jz4780_timer.c Fri Jan 25 20:00:59 2019 (r343447) +++ head/sys/mips/ingenic/jz4780_timer.c Fri Jan 25 20:02:55 2019 (r343448) @@ -185,7 +185,7 @@ jz4780_timer_attach(device_t dev) CSR_WRITE_4(sc, JZ_TC_TECR, TESR_OST); /* Stop all other channels as well */ CSR_WRITE_4(sc, JZ_TC_TECR, TESR_TCST0 | TESR_TCST1 | TESR_TCST2 | - TESR_TCST3 | TESR_TCST4 | TESR_TCST5 | TESR_TCST6 | TESR_TCST3); + TESR_TCST3 | TESR_TCST4 | TESR_TCST5 | TESR_TCST6 | TESR_TCST7); /* Clear detect mask flags */ CSR_WRITE_4(sc, JZ_TC_TFCR, 0xFFFFFFFF); /* Mask all interrupts */ From owner-svn-src-head@freebsd.org Fri Jan 25 20:07:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F47D14C13B8; Fri, 25 Jan 2019 20:07:19 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 359BB6F91F; Fri, 25 Jan 2019 20:07:19 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29771D2B9; Fri, 25 Jan 2019 20:07:19 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PK7J8j092928; Fri, 25 Jan 2019 20:07:19 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PK7IVr092925; Fri, 25 Jan 2019 20:07:18 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201901252007.x0PK7IVr092925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 25 Jan 2019 20:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343449 - in head/sbin: newfs tunefs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sbin: newfs tunefs X-SVN-Commit-Revision: 343449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 359BB6F91F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:07:19 -0000 Author: mckusick Date: Fri Jan 25 20:07:18 2019 New Revision: 343449 URL: https://svnweb.freebsd.org/changeset/base/343449 Log: Allow tunefs to include '_' as a legal character in label names to make it consistent with newfs. Document the legality of '_' in label names in both tunefs(8) and newfs(8). PR: 235182 Submitted by: darius@dons.net.au Reviewed by: Conrad Meyer MFC after: 3 days Sponsored by: Netflix Modified: head/sbin/newfs/newfs.8 head/sbin/tunefs/tunefs.8 head/sbin/tunefs/tunefs.c Modified: head/sbin/newfs/newfs.8 ============================================================================== --- head/sbin/newfs/newfs.8 Fri Jan 25 20:02:55 2019 (r343448) +++ head/sbin/newfs/newfs.8 Fri Jan 25 20:07:18 2019 (r343449) @@ -89,6 +89,7 @@ See for details. .It Fl L Ar volname Add a volume label to the new file system. +Legal characters are alphanumerics and underscores. .It Fl N Cause the file system parameters to be printed out without really creating the file system. Modified: head/sbin/tunefs/tunefs.8 ============================================================================== --- head/sbin/tunefs/tunefs.8 Fri Jan 25 20:02:55 2019 (r343448) +++ head/sbin/tunefs/tunefs.8 Fri Jan 25 20:07:18 2019 (r343449) @@ -112,6 +112,7 @@ By default sets it to half of the space reserved to minfree. .It Fl L Ar volname Add/modify an optional file system volume label. +Legal characters are alphanumerics and underscores. .It Fl l Cm enable | disable Turn on/off MAC multilabel flag. .It Fl m Ar minfree Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Fri Jan 25 20:02:55 2019 (r343448) +++ head/sbin/tunefs/tunefs.c Fri Jan 25 20:07:18 2019 (r343449) @@ -189,7 +189,7 @@ main(int argc, char *argv[]) name = "volume label"; Lvalue = optarg; i = -1; - while (isalnum(Lvalue[++i])); + while (isalnum(Lvalue[++i]) || Lvalue[i] == '_'); if (Lvalue[i] != '\0') { errx(10, "bad %s. Valid characters are alphanumerics.", From owner-svn-src-head@freebsd.org Fri Jan 25 20:10:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD66714C1583; Fri, 25 Jan 2019 20:10:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54B246FBEC; Fri, 25 Jan 2019 20:10:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47635D2EA; Fri, 25 Jan 2019 20:10:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PKAwIZ096120; Fri, 25 Jan 2019 20:10:58 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PKAw7H096119; Fri, 25 Jan 2019 20:10:58 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901252010.x0PKAw7H096119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 25 Jan 2019 20:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343450 - head/sys/mips/ingenic X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/mips/ingenic X-SVN-Commit-Revision: 343450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54B246FBEC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:10:58 -0000 Author: gonzo Date: Fri Jan 25 20:10:57 2019 New Revision: 343450 URL: https://svnweb.freebsd.org/changeset/base/343450 Log: [mips] Unbreak kernel build for CI20 - Include header required for boot_parse_XXX functions - Use boot_parse_args when parsing argc/argv style arguments - Remove unused function Modified: head/sys/mips/ingenic/jz4780_machdep.c Modified: head/sys/mips/ingenic/jz4780_machdep.c ============================================================================== --- head/sys/mips/ingenic/jz4780_machdep.c Fri Jan 25 20:07:18 2019 (r343449) +++ head/sys/mips/ingenic/jz4780_machdep.c Fri Jan 25 20:10:57 2019 (r343450) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -173,20 +174,6 @@ mips_init(void) #endif } -#ifdef FDT -static void -_parse_bootargs(char *cmdline) -{ - char *v; - - while ((v = strsep(&cmdline, " \n")) != NULL) { - if (*v == '\0') - continue; - boothowto |= boot_parse_arg(v); - } -} -#endif - void platform_start(__register_t a0, __register_t a1, __register_t a2 __unused, __register_t a3 __unused) @@ -247,7 +234,7 @@ platform_start(__register_t a0, __register_t a1, /* Parse cmdline from U-Boot */ argc = a0; argv = (char **)a1; - boothowto |= boot_parse_cmdline(argc, argv); + boothowto |= boot_parse_args(argc, argv); mips_init(); } From owner-svn-src-head@freebsd.org Fri Jan 25 20:13:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36F0E14C1891; Fri, 25 Jan 2019 20:13:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D17FE70107; Fri, 25 Jan 2019 20:13:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCFEBD47F; Fri, 25 Jan 2019 20:13:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PKDSek097908; Fri, 25 Jan 2019 20:13:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PKDSGx097907; Fri, 25 Jan 2019 20:13:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901252013.x0PKDSGx097907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 25 Jan 2019 20:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343451 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 343451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D17FE70107 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:13:29 -0000 Author: hselasky Date: Fri Jan 25 20:13:28 2019 New Revision: 343451 URL: https://svnweb.freebsd.org/changeset/base/343451 Log: Add full support for PCI_ANY_ID when matching PCI IDs in the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Jan 25 20:10:57 2019 (r343450) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Jan 25 20:13:28 2019 (r343451) @@ -71,7 +71,7 @@ struct pci_device_id { #define PCI_BASE_CLASS_BRIDGE 0x06 #define PCI_CLASS_BRIDGE_ISA 0x0601 -#define PCI_ANY_ID (-1) +#define PCI_ANY_ID -1U #define PCI_VENDOR_ID_APPLE 0x106b #define PCI_VENDOR_ID_ASUSTEK 0x1043 #define PCI_VENDOR_ID_ATI 0x1002 Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Jan 25 20:10:57 2019 (r343450) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Jan 25 20:13:28 2019 (r343451) @@ -82,14 +82,21 @@ linux_pci_find(device_t dev, const struct pci_device_i struct pci_driver *pdrv; uint16_t vendor; uint16_t device; + uint16_t subvendor; + uint16_t subdevice; vendor = pci_get_vendor(dev); device = pci_get_device(dev); + subvendor = pci_get_subvendor(dev); + subdevice = pci_get_subdevice(dev); spin_lock(&pci_lock); list_for_each_entry(pdrv, &pci_drivers, links) { for (id = pdrv->id_table; id->vendor != 0; id++) { - if (vendor == id->vendor && device == id->device) { + if (vendor == id->vendor && + (PCI_ANY_ID == id->device || device == id->device) && + (PCI_ANY_ID == id->subvendor || subvendor == id->subvendor) && + (PCI_ANY_ID == id->subdevice || subdevice == id->subdevice)) { *idp = id; spin_unlock(&pci_lock); return (pdrv); @@ -145,8 +152,8 @@ linux_pci_attach(device_t dev) pdev->dev.bsddev = dev; INIT_LIST_HEAD(&pdev->dev.irqents); pdev->devfn = PCI_DEVFN(pci_get_slot(dev), pci_get_function(dev)); - pdev->device = id->device; - pdev->vendor = id->vendor; + pdev->device = dinfo->cfg.device; + pdev->vendor = dinfo->cfg.vendor; pdev->subsystem_vendor = dinfo->cfg.subvendor; pdev->subsystem_device = dinfo->cfg.subdevice; pdev->class = pci_get_class(dev); From owner-svn-src-head@freebsd.org Fri Jan 25 20:14:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC01314C1930; Fri, 25 Jan 2019 20:14:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 388677028F; Fri, 25 Jan 2019 20:14:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BF9AD480; Fri, 25 Jan 2019 20:14:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PKESrR097989; Fri, 25 Jan 2019 20:14:28 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PKESHP097988; Fri, 25 Jan 2019 20:14:28 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901252014.x0PKESHP097988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 25 Jan 2019 20:14:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343452 - head/sys/mips/nlm X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/mips/nlm X-SVN-Commit-Revision: 343452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 388677028F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:14:30 -0000 Author: gonzo Date: Fri Jan 25 20:14:28 2019 New Revision: 343452 URL: https://svnweb.freebsd.org/changeset/base/343452 Log: [mips] Fix error condition check that always evaluates to false Use proper logical operand when checking the value of srcid PR: 200988 Submitted by: David Binderman MFC after: 1 week Modified: head/sys/mips/nlm/cms.c Modified: head/sys/mips/nlm/cms.c ============================================================================== --- head/sys/mips/nlm/cms.c Fri Jan 25 20:13:28 2019 (r343451) +++ head/sys/mips/nlm/cms.c Fri Jan 25 20:14:28 2019 (r343452) @@ -204,7 +204,7 @@ xlp_handle_msg_vc(u_int vcmask, int max_msgs) nlm_restore_flags(mflags); if (status != 0) /* no msg or error */ continue; - if (srcid < 0 && srcid >= 1024) { + if (srcid < 0 || srcid >= 1024) { printf("[%s]: bad src id %d\n", __func__, srcid); continue; From owner-svn-src-head@freebsd.org Fri Jan 25 20:15:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0020014C1A79; Fri, 25 Jan 2019 20:15:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4BA70564; Fri, 25 Jan 2019 20:15:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0PKFjUq090039; Fri, 25 Jan 2019 12:15:45 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0PKFjeT090038; Fri, 25 Jan 2019 12:15:45 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901252015.x0PKFjeT090038@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343449 - in head/sbin: newfs tunefs In-Reply-To: <201901252007.x0PK7IVr092925@repo.freebsd.org> To: Kirk McKusick Date: Fri, 25 Jan 2019 12:15:45 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 5B4BA70564 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:15:48 -0000 > Author: mckusick > Date: Fri Jan 25 20:07:18 2019 > New Revision: 343449 > URL: https://svnweb.freebsd.org/changeset/base/343449 > > Log: > Allow tunefs to include '_' as a legal character in label names > to make it consistent with newfs. Document the legality of '_' > in label names in both tunefs(8) and newfs(8). > > PR: 235182 > Submitted by: darius@dons.net.au > Reviewed by: Conrad Meyer > MFC after: 3 days > Sponsored by: Netflix > > Modified: > head/sbin/newfs/newfs.8 > head/sbin/tunefs/tunefs.8 > head/sbin/tunefs/tunefs.c > > Modified: head/sbin/newfs/newfs.8 > ============================================================================== > --- head/sbin/newfs/newfs.8 Fri Jan 25 20:02:55 2019 (r343448) > +++ head/sbin/newfs/newfs.8 Fri Jan 25 20:07:18 2019 (r343449) > @@ -89,6 +89,7 @@ See > for details. > .It Fl L Ar volname > Add a volume label to the new file system. > +Legal characters are alphanumerics and underscores. > .It Fl N > Cause the file system parameters to be printed out > without really creating the file system. > > Modified: head/sbin/tunefs/tunefs.8 > ============================================================================== > --- head/sbin/tunefs/tunefs.8 Fri Jan 25 20:02:55 2019 (r343448) > +++ head/sbin/tunefs/tunefs.8 Fri Jan 25 20:07:18 2019 (r343449) > @@ -112,6 +112,7 @@ By default > sets it to half of the space reserved to minfree. > .It Fl L Ar volname > Add/modify an optional file system volume label. > +Legal characters are alphanumerics and underscores. > .It Fl l Cm enable | disable > Turn on/off MAC multilabel flag. > .It Fl m Ar minfree > > Modified: head/sbin/tunefs/tunefs.c > ============================================================================== > --- head/sbin/tunefs/tunefs.c Fri Jan 25 20:02:55 2019 (r343448) > +++ head/sbin/tunefs/tunefs.c Fri Jan 25 20:07:18 2019 (r343449) > @@ -189,7 +189,7 @@ main(int argc, char *argv[]) > name = "volume label"; > Lvalue = optarg; > i = -1; > - while (isalnum(Lvalue[++i])); > + while (isalnum(Lvalue[++i]) || Lvalue[i] == '_'); > if (Lvalue[i] != '\0') { > errx(10, > "bad %s. Valid characters are alphanumerics.", ^^^^^^^^^^^^ This message is now incorrect. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 25 20:20:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45A0114C1CF1; Fri, 25 Jan 2019 20:20:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E024B70A37; Fri, 25 Jan 2019 20:20:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3413D48E; Fri, 25 Jan 2019 20:20:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PKKR79098493; Fri, 25 Jan 2019 20:20:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PKKRno098492; Fri, 25 Jan 2019 20:20:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901252020.x0PKKRno098492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 25 Jan 2019 20:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343453 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 343453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E024B70A37 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:20:28 -0000 Author: hselasky Date: Fri Jan 25 20:20:27 2019 New Revision: 343453 URL: https://svnweb.freebsd.org/changeset/base/343453 Log: Add new USB quirk. PR: 235202 Differential Revision: https://reviews.freebsd.org/D18917 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Fri Jan 25 20:14:28 2019 (r343452) +++ head/sys/dev/usb/quirk/usb_quirk.c Fri Jan 25 20:20:27 2019 (r343453) @@ -171,6 +171,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(CORSAIR, K70_RGB, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* Quirk for Corsair STRAFE Gaming keyboard */ USB_QUIRK(CORSAIR, STRAFE, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), + USB_QUIRK(CORSAIR, STRAFE2, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* umodem(4) device quirks */ USB_QUIRK(METRICOM, RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA), USB_QUIRK(SANYO, SCP4900, 0x000, 0x000, UQ_ASSUME_CM_OVER_DATA), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Jan 25 20:14:28 2019 (r343452) +++ head/sys/dev/usb/usbdevs Fri Jan 25 20:20:27 2019 (r343453) @@ -1583,7 +1583,8 @@ product COREGA FETHER_USB_TXC 0x9601 FEther USB-TXC product CORSAIR K60 0x0a60 Corsair Vengeance K60 keyboard product CORSAIR K70 0x1b09 Corsair Vengeance K70 keyboard product CORSAIR K70_RGB 0x1b13 Corsair K70 RGB Keyboard -product CORSAIR STRAFE 0x1b15 Cossair STRAFE Gaming keyboard +product CORSAIR STRAFE 0x1b15 Corsair STRAFE Gaming keyboard +product CORSAIR STRAFE2 0x1b44 Corsair STRAFE Gaming keyboard /* Creative products */ product CREATIVE NOMAD_II 0x1002 Nomad II MP3 player From owner-svn-src-head@freebsd.org Fri Jan 25 20:53:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6718414C2EE6; Fri, 25 Jan 2019 20:53:30 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 075C472497; Fri, 25 Jan 2019 20:53:30 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7618DB79; Fri, 25 Jan 2019 20:53:29 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PKrTW8019003; Fri, 25 Jan 2019 20:53:29 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PKrTwT019002; Fri, 25 Jan 2019 20:53:29 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201901252053.x0PKrTwT019002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 25 Jan 2019 20:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343455 - head/usr.sbin/acpi/acpidump X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/usr.sbin/acpi/acpidump X-SVN-Commit-Revision: 343455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 075C472497 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:53:30 -0000 Author: cy Date: Fri Jan 25 20:53:29 2019 New Revision: 343455 URL: https://svnweb.freebsd.org/changeset/base/343455 Log: Fix 32-bit buildworld broken by r343438. Modified: head/usr.sbin/acpi/acpidump/acpi.c Modified: head/usr.sbin/acpi/acpidump/acpi.c ============================================================================== --- head/usr.sbin/acpi/acpidump/acpi.c Fri Jan 25 20:24:53 2019 (r343454) +++ head/usr.sbin/acpi/acpidump/acpi.c Fri Jan 25 20:53:29 2019 (r343455) @@ -977,7 +977,7 @@ static void acpi_handle_tpm2(ACPI_TABLE_HEADER *sdp) printf (BEGIN_COMMENT); acpi_print_sdt(sdp); tpm2 = (ACPI_TABLE_TPM2 *) sdp; - printf ("\t\tControlArea=%lx\n", tpm2->ControlAddress); + printf ("\t\tControlArea=%jx\n", tpm2->ControlAddress); printf ("\t\tStartMethod=%x\n", tpm2->StartMethod); printf (END_COMMENT); } From owner-svn-src-head@freebsd.org Fri Jan 25 20:54:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEACF14C2F38; Fri, 25 Jan 2019 20:54:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 774F272604; Fri, 25 Jan 2019 20:54:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3320EDB85; Fri, 25 Jan 2019 20:54:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PKsIx8019081; Fri, 25 Jan 2019 20:54:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PKsIBP019080; Fri, 25 Jan 2019 20:54:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201901252054.x0PKsIBP019080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 25 Jan 2019 20:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343456 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 343456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 774F272604 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 20:54:20 -0000 Author: jhb Date: Fri Jan 25 20:54:18 2019 New Revision: 343456 URL: https://svnweb.freebsd.org/changeset/base/343456 Log: Fix a few more places to handle ofld tx queues for RATELIMIT. - Drain offload transmit queues when RATELIMIT is enabled but TCP_OFFLOAD is not. - Expose the per-VI nofldtxq and first_ofld_txq sysctls when RATELIMIT is enabled but TCP_OFFLOAD is not. - Clear offload transmit queue stats as part of a 'cxgbetool clearstats' request when RATELIMIT is enabled but TCP_OFFLOAD is not. Reviewed by: np MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D18966 Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Jan 25 20:53:29 2019 (r343455) +++ head/sys/dev/cxgbe/t4_main.c Fri Jan 25 20:54:18 2019 (r343456) @@ -5524,6 +5524,8 @@ vi_full_uninit(struct vi_info *vi) struct sge_txq *txq; #ifdef TCP_OFFLOAD struct sge_ofld_rxq *ofld_rxq; +#endif +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) struct sge_wrq *ofld_txq; #endif @@ -5539,7 +5541,7 @@ vi_full_uninit(struct vi_info *vi) quiesce_txq(sc, txq); } -#ifdef TCP_OFFLOAD +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) for_each_ofld_txq(vi, i, ofld_txq) { quiesce_wrq(sc, ofld_txq); } @@ -6327,15 +6329,9 @@ vi_sysctls(struct vi_info *vi) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nofldrxq", CTLFLAG_RD, &vi->nofldrxq, 0, "# of rx queues for offloaded TCP connections"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nofldtxq", CTLFLAG_RD, - &vi->nofldtxq, 0, - "# of tx queues for offloaded TCP connections"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_ofld_rxq", CTLFLAG_RD, &vi->first_ofld_rxq, 0, "index of first TOE rx queue"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_ofld_txq", - CTLFLAG_RD, &vi->first_ofld_txq, 0, - "index of first TOE tx queue"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_tmr_idx_ofld", CTLTYPE_INT | CTLFLAG_RW, vi, 0, sysctl_holdoff_tmr_idx_ofld, "I", @@ -6346,6 +6342,16 @@ vi_sysctls(struct vi_info *vi) "holdoff packet counter index for TOE queues"); } #endif +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + if (vi->nofldtxq != 0) { + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nofldtxq", CTLFLAG_RD, + &vi->nofldtxq, 0, + "# of tx queues for TOE/ETHOFLD"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_ofld_txq", + CTLFLAG_RD, &vi->first_ofld_txq, 0, + "index of first TOE/ETHOFLD tx queue"); + } +#endif #ifdef DEV_NETMAP if (vi->nnmrxq != 0) { SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nnmrxq", CTLFLAG_RD, @@ -10011,7 +10017,7 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t mp_ring_reset_stats(txq->r); } -#ifdef TCP_OFFLOAD +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) /* nothing to clear for each ofld_rxq */ for_each_ofld_txq(vi, i, wrq) { From owner-svn-src-head@freebsd.org Fri Jan 25 21:24:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F012B14C3852; Fri, 25 Jan 2019 21:24:10 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DF21736D2; Fri, 25 Jan 2019 21:24:10 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BD96E0C9; Fri, 25 Jan 2019 21:24:10 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PLOAWn034859; Fri, 25 Jan 2019 21:24:10 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PLOAOE034857; Fri, 25 Jan 2019 21:24:10 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201901252124.x0PLOAOE034857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 25 Jan 2019 21:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343457 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 343457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DF21736D2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 21:24:11 -0000 Author: mckusick Date: Fri Jan 25 21:24:09 2019 New Revision: 343457 URL: https://svnweb.freebsd.org/changeset/base/343457 Log: Add printing of b_ioflags to DDB `show buffer' command. Sponsored by: Netflix Modified: head/sys/kern/vfs_bio.c head/sys/sys/bio.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Jan 25 20:54:18 2019 (r343456) +++ head/sys/kern/vfs_bio.c Fri Jan 25 21:24:09 2019 (r343457) @@ -5329,9 +5329,12 @@ DB_SHOW_COMMAND(buffer, db_show_buffer) } db_printf("buf at %p\n", bp); - db_printf("b_flags = 0x%b, b_xflags=0x%b, b_vflags=0x%b\n", - (u_int)bp->b_flags, PRINT_BUF_FLAGS, (u_int)bp->b_xflags, - PRINT_BUF_XFLAGS, (u_int)bp->b_vflags, PRINT_BUF_VFLAGS); + db_printf("b_flags = 0x%b, b_xflags=0x%b\n", + (u_int)bp->b_flags, PRINT_BUF_FLAGS, + (u_int)bp->b_xflags, PRINT_BUF_XFLAGS); + db_printf("b_vflags=0x%b b_ioflags0x%b\n", + (u_int)bp->b_vflags, PRINT_BUF_VFLAGS, + (u_int)bp->b_ioflags, PRINT_BIO_FLAGS); db_printf( "b_error = %d, b_bufsize = %ld, b_bcount = %ld, b_resid = %ld\n" "b_bufobj = (%p), b_data = %p, b_blkno = %jd, b_lblkno = %jd, " Modified: head/sys/sys/bio.h ============================================================================== --- head/sys/sys/bio.h Fri Jan 25 20:54:18 2019 (r343456) +++ head/sys/sys/bio.h Fri Jan 25 21:24:09 2019 (r343457) @@ -67,6 +67,9 @@ #define BIO_TRANSIENT_MAPPING 0x20 #define BIO_VLIST 0x40 +#define PRINT_BIO_FLAGS "\20\7vlist\6transient_mapping\5unmapped" \ + "\4ordered\3onqueue\2done\1error" + #ifdef _KERNEL struct disk; struct bio; From owner-svn-src-head@freebsd.org Fri Jan 25 21:38:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EA6214C3E03; Fri, 25 Jan 2019 21:38:08 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0600974472; Fri, 25 Jan 2019 21:38:07 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-ot1-f47.google.com with SMTP id t5so9912146otk.1; Fri, 25 Jan 2019 13:38:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=4vVyULC4t3i26dKwAq9edILzA+WtsYH6/Yp3i1Ucq8o=; b=sJnbgWlu/WBsNg2jXgGxinmM6Bz9LUqhTz6jpmlkqRAiHR3uVjLRp+awDSYELldpIi aYqwWZPfUqwQoq5r+yRnFZaozWzlDZCr4MvcXJ9uW1MxaVaXwICxsprLopabCgi4tQPr g/y+lg1fswaIMfLVZQa4xgGXsnfj2xsh+4WrJmH8PBfkvj44z7yTtouBJ6D4efJvnfZ9 BJTRZ1J1f+5J9cca1dYJwd0mm0a5LzlXh9CIHDYi61id/SS1ra1e1kOV5FtMqGTEebxY XrRaL6bpdIGJNVp13+/R5EqvFUVfqII0VhXo+gLCe53OQCI1MNQ12ZSk1WDM/ZAY7ZI6 mWNA== X-Gm-Message-State: AJcUukdUsIHL0wWU3weeiPGt6+i7TiOo3Ksyc77uS/vovgHyBo7dVfvJ U9WBvUyqWCyEhb4JFMz6sbIm4CZqzubZ+j56KcAQEA== X-Google-Smtp-Source: ALg8bN4Rn0+mj8HC7CXPGeS5M4l3ZqqmsFAO0mnhnEzdg2ZOvGYk/kuv8cY9AH1m2Fp1kvk3tww3chCv8seyJYv55t0= X-Received: by 2002:a9d:7450:: with SMTP id p16mr8433257otk.247.1548452280892; Fri, 25 Jan 2019 13:38:00 -0800 (PST) MIME-Version: 1.0 References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> From: Edward Napierala Date: Fri, 25 Jan 2019 21:37:49 +0000 Message-ID: Subject: Re: svn commit: r343440 - head/bin/sh To: rgrimes@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 0600974472 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.48 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.48)[-0.483,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 21:38:08 -0000 pt., 25 sty 2019 o 19:57 Rodney W. Grimes napisa=C5=82(a): > > > Author: trasz > > Date: Fri Jan 25 17:09:26 2019 > > New Revision: 343440 > > URL: https://svnweb.freebsd.org/changeset/base/343440 > > > > Log: > > Comment out the default sh(1) aliases for root, introduced in r343416= . > > The rest of this stuff is still to be discussed, but I think at this > > point we have the agreement that the aliases should go. > > > > MFC after: 2 weeks > > Sponsored by: DARPA, AFRL > > Please just revert this and the prior commit out, and when > the path forward is clear commit it. I would not want any of this > merged to 12/ or 11/ until the time that it is all settled. Oops, my bad - neither this nor the previous commit is supposed to be MFC-ed; the "2 weeks" above comes from my default Subversion config. Regarding the backoff - just a few hours ago you said you don't have any problem with this, except for aliases and the default ENV. The aliases problem has been addressed, and you hadn't yet responded to my explanations regarding the ENV. Another committer asked for backoff, because "sh is not an interactive shell", while in fact sh(1) is FreeBSD's default interactive shell except for root. Finally, there's one person who asked for revert, but without giving any reasons whatsoever. So far nobody had proposed any scenario where this would break anything, or even affect existing users. It seems like a typical bikeshed situation. From owner-svn-src-head@freebsd.org Fri Jan 25 21:38:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54A3814C3E3A; Fri, 25 Jan 2019 21:38:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19694745AC; Fri, 25 Jan 2019 21:38:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 096D8E2B5; Fri, 25 Jan 2019 21:38:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PLcSIJ040224; Fri, 25 Jan 2019 21:38:28 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PLcSLl040223; Fri, 25 Jan 2019 21:38:28 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201901252138.x0PLcSLl040223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 25 Jan 2019 21:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343458 - head/sys/dev/bhnd/cores/pmu X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/dev/bhnd/cores/pmu X-SVN-Commit-Revision: 343458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 19694745AC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 21:38:29 -0000 Author: gonzo Date: Fri Jan 25 21:38:28 2019 New Revision: 343458 URL: https://svnweb.freebsd.org/changeset/base/343458 Log: Fix format/arg mismatch USe correct format for int arguments PR: 229549 Submitted by: David Binderman MFC after: 1 week Modified: head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c Modified: head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c ============================================================================== --- head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c Fri Jan 25 21:24:09 2019 (r343457) +++ head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c Fri Jan 25 21:38:28 2019 (r343458) @@ -1036,7 +1036,7 @@ bhnd_pmu_res_init(struct bhnd_pmu_softc *sc) return (error); } - PMU_DEBUG(sc, "Applying %s=%s to rsrc %d res_updn_timer\n", + PMU_DEBUG(sc, "Applying %s=%d to rsrc %d res_updn_timer\n", name, val, i); BHND_PMU_WRITE_4(sc, BHND_PMU_RES_TABLE_SEL, i); @@ -1111,7 +1111,7 @@ bhnd_pmu_res_init(struct bhnd_pmu_softc *sc) return (error); } - PMU_DEBUG(sc, "Applying %s=%s to rsrc %d res_dep_mask\n", name, + PMU_DEBUG(sc, "Applying %s=%d to rsrc %d res_dep_mask\n", name, val, i); BHND_PMU_WRITE_4(sc, BHND_PMU_RES_TABLE_SEL, i); From owner-svn-src-head@freebsd.org Fri Jan 25 22:22:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DABC114C5242; Fri, 25 Jan 2019 22:22:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8181075FDF; Fri, 25 Jan 2019 22:22:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75E0AEB3D; Fri, 25 Jan 2019 22:22:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0PMMTUO066089; Fri, 25 Jan 2019 22:22:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0PMMT7T066088; Fri, 25 Jan 2019 22:22:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201901252222.x0PMMT7T066088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 25 Jan 2019 22:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343459 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 343459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8181075FDF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 22:22:30 -0000 Author: pfg Date: Fri Jan 25 22:22:29 2019 New Revision: 343459 URL: https://svnweb.freebsd.org/changeset/base/343459 Log: ext2fs: Add some extra consistency checks for the superblock. Maliciously formed, or badly corrupted, filesystems can cause kernel panics. In general, such acts of foot-shooting can only be accomplished by root, but in a world with VM images that is moving towards automated mounts it is important to have some form of prevention. Reported by: Christopher Krah, Thomas Barabosch, and Jan-Niclas Hilgert of Fraunhofer FKIE. Incidentaly this should also fix a memory corruption issue reported by Dr Silvio Cesare of InfoSect. Huge thanks to all reseachers for making us aware of the issue. admbug: 872, 891 Reviewed by: fsu Obtained from: NetBSD (with minor changes) MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_vfsops.c Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Fri Jan 25 21:38:28 2019 (r343458) +++ head/sys/fs/ext2fs/ext2_vfsops.c Fri Jan 25 22:22:29 2019 (r343459) @@ -416,7 +416,16 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es es->e3fs_desc_size); return (EINVAL); } + /* Check for block size = 1K|2K|4K */ + if (es->e2fs_log_bsize > 2) { + printf("ext2fs: bad block size: %d\n", es->e2fs_log_bsize); + return (EINVAL); + } /* Check for group size */ + if (fs->e2fs_bpg == 0) { + printf("ext2fs: zero blocks per group\n"); + return (EINVAL); + } if (fs->e2fs_bpg != fs->e2fs_bsize * 8) { printf("ext2fs: non-standard group size unsupported %d\n", fs->e2fs_bpg); @@ -424,7 +433,21 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es } fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs); + if (fs->e2fs_ipg == 0) { + printf("ext2fs: zero inodes per group\n"); + return (EINVAL); + } fs->e2fs_itpg = fs->e2fs_ipg / fs->e2fs_ipb; + /* Check for block consistency */ + if (es->e2fs_first_dblock >= fs->e2fs_bcount) { + printf("ext2fs: invalid first data block\n"); + return (EINVAL); + } + if (fs->e2fs_rbcount > fs->e2fs_bcount || + fs->e2fs_fbcount > fs->e2fs_bcount) { + printf("ext2fs: invalid block count\n"); + return (EINVAL); + } /* s_resuid / s_resgid ? */ fs->e2fs_gcount = howmany(fs->e2fs_bcount - es->e2fs_first_dblock, EXT2_BLOCKS_PER_GROUP(fs)); From owner-svn-src-head@freebsd.org Fri Jan 25 22:29:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B09A14C54FA; Fri, 25 Jan 2019 22:29:21 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D60F763A4; Fri, 25 Jan 2019 22:29:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0PMTGhJ090515; Fri, 25 Jan 2019 14:29:16 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0PMTGum090514; Fri, 25 Jan 2019 14:29:16 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901252229.x0PMTGum090514@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343440 - head/bin/sh In-Reply-To: To: Edward Napierala Date: Fri, 25 Jan 2019 14:29:16 -0800 (PST) CC: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4D60F763A4 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 22:29:21 -0000 > pt., 25 sty 2019 o 19:57 Rodney W. Grimes > napisa?(a): > > > > > Author: trasz > > > Date: Fri Jan 25 17:09:26 2019 > > > New Revision: 343440 > > > URL: https://svnweb.freebsd.org/changeset/base/343440 > > > > > > Log: > > > Comment out the default sh(1) aliases for root, introduced in r343416. > > > The rest of this stuff is still to be discussed, but I think at this > > > point we have the agreement that the aliases should go. > > > > > > MFC after: 2 weeks > > > Sponsored by: DARPA, AFRL > > > > Please just revert this and the prior commit out, and when > > the path forward is clear commit it. I would not want any of this > > merged to 12/ or 11/ until the time that it is all settled. > > Oops, my bad - neither this nor the previous commit is supposed > to be MFC-ed; the "2 weeks" above comes from my default Subversion > config. > > Regarding the backoff - just a few hours ago you said you don't have > any problem with this, except for aliases and the default ENV. The > aliases problem has been addressed, and you hadn't yet responded > to my explanations regarding the ENV. Another committer asked for > backoff, because "sh is not an interactive shell", while in fact sh(1) > is FreeBSD's default interactive shell except for root. Finally, there's > one person who asked for revert, but without giving any reasons > whatsoever. > > So far nobody had proposed any scenario where this would break > anything, or even affect existing users. It seems like a typical bikeshed > situation. Within hours of your initial commit you had myself, ian and cy all in opposition to this change , devin asked for a revert, first privately to me which I encouraged a public posting of. Thats four people who want this removed. I have now asked publically for a revert. Thats 2 public request for revert. The hat was only about the MFC statement which you have retracted. Just back it out and we can come to a better solution. Especially dependent on the outcome of Bapts mksh proposal. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 25 22:41:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC93D14C590B; Fri, 25 Jan 2019 22:41:52 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37A7B76AE3; Fri, 25 Jan 2019 22:41:52 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=63444 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gnAAJ-000DzF-DV; Fri, 25 Jan 2019 14:41:35 -0800 From: Devin Teske Message-Id: Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343440 - head/bin/sh Date: Fri, 25 Jan 2019 14:41:47 -0800 In-Reply-To: Cc: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Edward Napierala References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: 37A7B76AE3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 22:41:53 -0000 > On Jan 25, 2019, at 1:37 PM, Edward Napierala = wrote: >=20 > pt., 25 sty 2019 o 19:57 Rodney W. Grimes > > napisa=C5=82(a): >>=20 >>> Author: trasz >>> Date: Fri Jan 25 17:09:26 2019 >>> New Revision: 343440 >>> URL: https://svnweb.freebsd.org/changeset/base/343440 >>>=20 >>> Log: >>> Comment out the default sh(1) aliases for root, introduced in = r343416. >>> The rest of this stuff is still to be discussed, but I think at = this >>> point we have the agreement that the aliases should go. >>>=20 >>> MFC after: 2 weeks >>> Sponsored by: DARPA, AFRL >>=20 >> Please just revert this and the prior commit out, and when >> the path forward is clear commit it. I would not want any of this >> merged to 12/ or 11/ until the time that it is all settled. >=20 > Oops, my bad - neither this nor the previous commit is supposed > to be MFC-ed; the "2 weeks" above comes from my default Subversion > config. >=20 > Regarding the backoff - just a few hours ago you said you don't have > any problem with this, except for aliases and the default ENV. The > aliases problem has been addressed, and you hadn't yet responded > to my explanations regarding the ENV. Another committer asked for > backoff, because "sh is not an interactive shell", while in fact sh(1) > is FreeBSD's default interactive shell except for root. Finally, = there's > one person who asked for revert, but without giving any reasons > whatsoever. >=20 > So far nobody had proposed any scenario where this would break > anything, or even affect existing users. It seems like a typical = bikeshed > situation. It is not clear to me after reading r343416 and D18872 what this change = is trying to solve. PS1 should have a reasonable default. If that default is not reasonable, = then we should change the C code. Maybe I see things differently, but I'd rather see PS1 default change so = no profile/shrc change is necessary. I prefer that sh, in its default configuration, not attempt to read = $HOME/.shrc, for security reasons. Further, it is documented that the contents of ENV may be ignored in = privileged mode, negating these changes. If you wanted your new shiny default PS1 to actually have an effect in = all modes (including privileged mode, where you probably want it), you = would have put it in /etc/profile and not in a file that is wholly = ignored by some modes (e.g., privileged mode). So the solution is not even the right one for the desired result. --=20 Devin From owner-svn-src-head@freebsd.org Fri Jan 25 22:47:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15C4414C59CE; Fri, 25 Jan 2019 22:47:07 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2EE976D05; Fri, 25 Jan 2019 22:47:06 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=63454 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gnAFN-000E39-Vy; Fri, 25 Jan 2019 14:46:50 -0800 From: Devin Teske Message-Id: Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343440 - head/bin/sh Date: Fri, 25 Jan 2019 14:47:02 -0800 In-Reply-To: Cc: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Edward Napierala References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: A2EE976D05 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 22:47:07 -0000 > On Jan 25, 2019, at 2:41 PM, Devin Teske wrote: >=20 >=20 >=20 >> On Jan 25, 2019, at 1:37 PM, Edward Napierala > wrote: >>=20 >> pt., 25 sty 2019 o 19:57 Rodney W. Grimes >> > napisa=C5=82(a): >>>=20 >>>> Author: trasz >>>> Date: Fri Jan 25 17:09:26 2019 >>>> New Revision: 343440 >>>> URL: https://svnweb.freebsd.org/changeset/base/343440 = >>>>=20 >>>> Log: >>>> Comment out the default sh(1) aliases for root, introduced in = r343416. >>>> The rest of this stuff is still to be discussed, but I think at = this >>>> point we have the agreement that the aliases should go. >>>>=20 >>>> MFC after: 2 weeks >>>> Sponsored by: DARPA, AFRL >>>=20 >>> Please just revert this and the prior commit out, and when >>> the path forward is clear commit it. I would not want any of this >>> merged to 12/ or 11/ until the time that it is all settled. >>=20 >> Oops, my bad - neither this nor the previous commit is supposed >> to be MFC-ed; the "2 weeks" above comes from my default Subversion >> config. >>=20 >> Regarding the backoff - just a few hours ago you said you don't have >> any problem with this, except for aliases and the default ENV. The >> aliases problem has been addressed, and you hadn't yet responded >> to my explanations regarding the ENV. Another committer asked for >> backoff, because "sh is not an interactive shell", while in fact = sh(1) >> is FreeBSD's default interactive shell except for root. Finally, = there's >> one person who asked for revert, but without giving any reasons >> whatsoever. >>=20 >> So far nobody had proposed any scenario where this would break >> anything, or even affect existing users. It seems like a typical = bikeshed >> situation. >=20 > It is not clear to me after reading r343416 and D18872 what this = change is trying to solve. >=20 > PS1 should have a reasonable default. If that default is not = reasonable, then we should change the C code. >=20 > Maybe I see things differently, but I'd rather see PS1 default change = so no profile/shrc change is necessary. >=20 > I prefer that sh, in its default configuration, not attempt to read = $HOME/.shrc, for security reasons. >=20 > Further, it is documented that the contents of ENV may be ignored in = privileged mode, negating these changes. >=20 > If you wanted your new shiny default PS1 to actually have an effect in = all modes (including privileged mode, where you probably want it), you = would have put it in /etc/profile and not in a file that is wholly = ignored by some modes (e.g., privileged mode). >=20 > So the solution is not even the right one for the desired result. I would also like to add, that the current default for PS1 is static for = a reason. Long ago, people used to write things in TCL/Expect. If PS1 is not = static, you either have to override it or account for the variance (# = for root, $ for others). This is an important distinction specifically because TCL/Expect is used = in the control of interactive shells. --=20 Devin= From owner-svn-src-head@freebsd.org Fri Jan 25 22:50:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA02214C5B23; Fri, 25 Jan 2019 22:50:40 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81BE276F2E; Fri, 25 Jan 2019 22:50:40 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=63469 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gnAJ4-000E5S-Lm; Fri, 25 Jan 2019 14:50:39 -0800 From: Devin Teske Message-Id: <7DDC8FBE-5381-47FC-AB49-8BE2849B37AD@FreeBSD.org> Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343440 - head/bin/sh Date: Fri, 25 Jan 2019 14:50:37 -0800 In-Reply-To: Cc: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Edward Napierala References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: 81BE276F2E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 22:50:41 -0000 > On Jan 25, 2019, at 2:47 PM, Devin Teske wrote: >=20 >=20 >=20 >> On Jan 25, 2019, at 2:41 PM, Devin Teske > wrote: >>=20 >>=20 >>=20 >>> On Jan 25, 2019, at 1:37 PM, Edward Napierala > wrote: >>>=20 >>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes >>> > napisa=C5=82(a): >>>>=20 >>>>> Author: trasz >>>>> Date: Fri Jan 25 17:09:26 2019 >>>>> New Revision: 343440 >>>>> URL: https://svnweb.freebsd.org/changeset/base/343440 = >>>>>=20 >>>>> Log: >>>>> Comment out the default sh(1) aliases for root, introduced in = r343416. >>>>> The rest of this stuff is still to be discussed, but I think at = this >>>>> point we have the agreement that the aliases should go. >>>>>=20 >>>>> MFC after: 2 weeks >>>>> Sponsored by: DARPA, AFRL >>>>=20 >>>> Please just revert this and the prior commit out, and when >>>> the path forward is clear commit it. I would not want any of this >>>> merged to 12/ or 11/ until the time that it is all settled. >>>=20 >>> Oops, my bad - neither this nor the previous commit is supposed >>> to be MFC-ed; the "2 weeks" above comes from my default Subversion >>> config. >>>=20 >>> Regarding the backoff - just a few hours ago you said you don't have >>> any problem with this, except for aliases and the default ENV. The >>> aliases problem has been addressed, and you hadn't yet responded >>> to my explanations regarding the ENV. Another committer asked for >>> backoff, because "sh is not an interactive shell", while in fact = sh(1) >>> is FreeBSD's default interactive shell except for root. Finally, = there's >>> one person who asked for revert, but without giving any reasons >>> whatsoever. >>>=20 >>> So far nobody had proposed any scenario where this would break >>> anything, or even affect existing users. It seems like a typical = bikeshed >>> situation. >>=20 >> It is not clear to me after reading r343416 and D18872 what this = change is trying to solve. >>=20 >> PS1 should have a reasonable default. If that default is not = reasonable, then we should change the C code. >>=20 >> Maybe I see things differently, but I'd rather see PS1 default change = so no profile/shrc change is necessary. >>=20 >> I prefer that sh, in its default configuration, not attempt to read = $HOME/.shrc, for security reasons. >>=20 >> Further, it is documented that the contents of ENV may be ignored in = privileged mode, negating these changes. >>=20 >> If you wanted your new shiny default PS1 to actually have an effect = in all modes (including privileged mode, where you probably want it), = you would have put it in /etc/profile and not in a file that is wholly = ignored by some modes (e.g., privileged mode). >>=20 >> So the solution is not even the right one for the desired result. >=20 > I would also like to add, that the current default for PS1 is static = for a reason. >=20 > Long ago, people used to write things in TCL/Expect. If PS1 is not = static, you either have to override it or account for the variance (# = for root, $ for others). >=20 > This is an important distinction specifically because TCL/Expect is = used in the control of interactive shells. And an aside: I still program in TCL/Expect. I have been known to customize PS2 and = PS4. I may have neglected to give reasons previously, but that's because I = was in a meeting and unable to expand on the particular technical = intricacies: 1. The relationship default PS1, PS2, and PS4 have with software like = TCL/Expect 2. The fact that ENV is wholly ignored in privileged mode 3. The fact that introducing ~/.shrc as a runnable file for interactive = sh globally and by-default is something that should be run by secteam --=20 Devin From owner-svn-src-head@freebsd.org Fri Jan 25 23:01:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62F7F14C60AD; Fri, 25 Jan 2019 23:01:37 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C24117781F; Fri, 25 Jan 2019 23:01:36 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x442.google.com with SMTP id t6so11919282wrr.12; Fri, 25 Jan 2019 15:01:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=YAEwvYTS55Ru0KTZ6hgc3Tv6ahIa3dNKgJ4SpBhHIQs=; b=FndxRxWgdTlaebwvQ69dDbjlsPznKfcgVBRICaw+hO9kh4wtQuG3cWyVZy0F7uNaJA co/IczCtOjVnRWdXiwd2hFW3mZREVSJGc40BL1tHFtVmM55A/BnuEoF07bkSN8Bfhg8U wbLvy+LR1WpM1/Fza2Jih7cjiww9U1Ep0TI0cD9bbzQKg+VA2TTsI+GOzX/dcXRPn+rK jT9ZDk3CSJEMiBoWaXGcUIosDxNg+ws/8ugNgPKHi0/5JKBiVfIB1y+OEfUWdYOFu8fv edStSW+CMZSqgEyD+BUrXGAElXLem1oS3h2IotGBionsmWvmOD+B0hOYpIdptZcbCuZi 1b/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=YAEwvYTS55Ru0KTZ6hgc3Tv6ahIa3dNKgJ4SpBhHIQs=; b=G8en1GoZkj+M5Tdb4hMIKPGaNuIne2gAubqbjwm/+a5YZ9IwGVqPQEdnxPMdm1aFNV 6D9o1HqQWhu2ShTYYNX96l22IGoDiA7g4gXfeTfxUHCg1sg1A5rqmtqSV2y94/97Q2Ed +M7c1rvwUyh5+gsAl7nyIqRa+idw22ClTN47j8lNJofWFaDPV7aBhVCNxNPWb3OKS/Bj thwi1QaJ9ceFBXN5JSV/Tb737vfb10Pao8JKNU1p4bx0wwMM81Hm61f8dKCxsA6ElOYf jnB55LHRajI7zo4Cpjwbo/SzasldB6outqWW+wXENZZai+7F81lbOhpLmpHM4oZ4sY08 Gcww== X-Gm-Message-State: AJcUukdBcABA7e61pxmHPaMK/UKjx8QTMk17vpKT+IhyLcIk+3DLKxYz Ih9PuO4sXFzpztB6QxzgbybSjCT1 X-Google-Smtp-Source: ALg8bN5GZ7DDgrY/VzFrAPXEc+oSGA+WuyD5P2uWogETmd2IrWQzZ7+dtJQwvpcQFbT1v2jJITekWA== X-Received: by 2002:adf:b307:: with SMTP id j7mr13821056wrd.46.1548457294761; Fri, 25 Jan 2019 15:01:34 -0800 (PST) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id t5sm45480370wmg.43.2019.01.25.15.01.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 15:01:33 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 25 Jan 2019 08:28:51 +0000 From: Edward Napierala To: Devin Teske Cc: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343440 - head/bin/sh Message-ID: <20190125082851.GA26199@v2> Mail-Followup-To: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: C24117781F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 23:01:37 -0000 On 0125T1441, Devin Teske wrote: > > > > On Jan 25, 2019, at 1:37 PM, Edward Napierala wrote: > > > > pt., 25 sty 2019 o 19:57 Rodney W. Grimes > > > napisał(a): > >> > >>> Author: trasz > >>> Date: Fri Jan 25 17:09:26 2019 > >>> New Revision: 343440 > >>> URL: https://svnweb.freebsd.org/changeset/base/343440 > >>> > >>> Log: > >>> Comment out the default sh(1) aliases for root, introduced in r343416. > >>> The rest of this stuff is still to be discussed, but I think at this > >>> point we have the agreement that the aliases should go. > >>> > >>> MFC after: 2 weeks > >>> Sponsored by: DARPA, AFRL > >> > >> Please just revert this and the prior commit out, and when > >> the path forward is clear commit it. I would not want any of this > >> merged to 12/ or 11/ until the time that it is all settled. > > > > Oops, my bad - neither this nor the previous commit is supposed > > to be MFC-ed; the "2 weeks" above comes from my default Subversion > > config. > > > > Regarding the backoff - just a few hours ago you said you don't have > > any problem with this, except for aliases and the default ENV. The > > aliases problem has been addressed, and you hadn't yet responded > > to my explanations regarding the ENV. Another committer asked for > > backoff, because "sh is not an interactive shell", while in fact sh(1) > > is FreeBSD's default interactive shell except for root. Finally, there's > > one person who asked for revert, but without giving any reasons > > whatsoever. > > > > So far nobody had proposed any scenario where this would break > > anything, or even affect existing users. It seems like a typical bikeshed > > situation. > > It is not clear to me after reading r343416 and D18872 what this change is trying to solve. The idea is to make it easy to replace the default root shell - which many people consider broken, due to not supporting basic shell syntax - with something that actually works. > PS1 should have a reasonable default. If that default is not reasonable, then we should change the C code. > > Maybe I see things differently, but I'd rather see PS1 default change so no profile/shrc change is necessary. Thank you, that's actually a valid argument. I believe that's also what bash does. It would be more intrusive, though, and I kind of don't like the idea of hardcoding things that can easily be dealt with with in a more "high-level" way. > I prefer that sh, in its default configuration, not attempt to read $HOME/.shrc, for security reasons. Can you elaborate? It already reads $HOME/.profile; how is $HOME/.shrc different? > Further, it is documented that the contents of ENV may be ignored in privileged mode, negating these changes. True - so if someone finds the idea of having a suid shell useful - from what I undestand that's what the privileged mode boils down to - this change will be a no-op. I seriously hope nobody does, though. > If you wanted your new shiny default PS1 to actually have an effect in all modes (including privileged mode, where you probably want it), you would have put it in /etc/profile and not in a file that is wholly ignored by some modes (e.g., privileged mode). > So the solution is not even the right one for the desired result. I would, if only it didn't break zsh, and perhaps others. The problem here is that zsh uses different syntax for PS1, _and_ it also parses /etc/profile. And no, I don't care at all about privileged mode, I can't imagine a situation when using it would be a good idea. From owner-svn-src-head@freebsd.org Fri Jan 25 23:30:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F02F114C70DE; Fri, 25 Jan 2019 23:30:19 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E6F5808A5; Fri, 25 Jan 2019 23:30:19 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=63858 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gnAvQ-000EX9-RP; Fri, 25 Jan 2019 15:30:16 -0800 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343440 - head/bin/sh From: Devin Teske In-Reply-To: <20190125082851.GA26199@v2> Date: Fri, 25 Jan 2019 15:30:15 -0800 Cc: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1F038D39-8869-4220-A274-F6307A4264E2@FreeBSD.org> References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> <20190125082851.GA26199@v2> To: Edward Napierala X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: 8E6F5808A5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 23:30:20 -0000 > On Jan 25, 2019, at 12:28 AM, Edward Napierala = wrote: >=20 > On 0125T1441, Devin Teske wrote: >>=20 >>=20 >>> On Jan 25, 2019, at 1:37 PM, Edward Napierala = wrote: >>>=20 >>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes >>> > napisa=C5=82(a): >>>>=20 >>>>> Author: trasz >>>>> Date: Fri Jan 25 17:09:26 2019 >>>>> New Revision: 343440 >>>>> URL: https://svnweb.freebsd.org/changeset/base/343440 >>>>>=20 >>>>> Log: >>>>> Comment out the default sh(1) aliases for root, introduced in = r343416. >>>>> The rest of this stuff is still to be discussed, but I think at = this >>>>> point we have the agreement that the aliases should go. >>>>>=20 >>>>> MFC after: 2 weeks >>>>> Sponsored by: DARPA, AFRL >>>>=20 >>>> Please just revert this and the prior commit out, and when >>>> the path forward is clear commit it. I would not want any of this >>>> merged to 12/ or 11/ until the time that it is all settled. >>>=20 >>> Oops, my bad - neither this nor the previous commit is supposed >>> to be MFC-ed; the "2 weeks" above comes from my default Subversion >>> config. >>>=20 >>> Regarding the backoff - just a few hours ago you said you don't have >>> any problem with this, except for aliases and the default ENV. The >>> aliases problem has been addressed, and you hadn't yet responded >>> to my explanations regarding the ENV. Another committer asked for >>> backoff, because "sh is not an interactive shell", while in fact = sh(1) >>> is FreeBSD's default interactive shell except for root. Finally, = there's >>> one person who asked for revert, but without giving any reasons >>> whatsoever. >>>=20 >>> So far nobody had proposed any scenario where this would break >>> anything, or even affect existing users. It seems like a typical = bikeshed >>> situation. >>=20 >> It is not clear to me after reading r343416 and D18872 what this = change is trying to solve. >=20 > The idea is to make it easy to replace the default root shell - which > many people consider broken, due to not supporting basic shell syntax = - with > something that actually works. How exactly does changing PS1 or adding 6 aliases fix the "basic shell = syntax" which you claim to be unsupported? If the number of aliases added to a shell are a measure of its = brokenness, then bash must be hella broken (I have 43 aliases in my = bash_profile). Also, the perhaps anecdotal consideration of brokenness is nearly = laughable -- these can largely be lumped into one of three categories: a. Considered broken because it doesn't support bashisms b. Considered broken because lack of syntactical knowledge c. Considered broken because (no reason given) Other languages might fit that description as well, and so we should = take this anecdote of "many people consider broken" with a grain of = salt. I personally have written more than 50,000 lines of shell for the = FreeBSD base OS -- all utilizing /bin/sh >=20 >> PS1 should have a reasonable default. If that default is not = reasonable, then we should change the C code. >>=20 >> Maybe I see things differently, but I'd rather see PS1 default change = so no profile/shrc change is necessary. >=20 > Thank you, that's actually a valid argument. I believe that's also = what > bash does. It would be more intrusive, though, and I kind of don't = like > the idea of hardcoding things that can easily be dealt with with in a = more > "high-level" way. >=20 >> I prefer that sh, in its default configuration, not attempt to read = $HOME/.shrc, for security reasons. >=20 > Can you elaborate? It already reads $HOME/.profile; how is = $HOME/.shrc > different? If you read "The Cuckoo's Egg" by Clifford Stoll, you'll understand the = importance of "one place to exploit versus two." (situation) Say you've been running FreeBSD for 20 years (it turned 25 years old = last year, so this is not only possible, but plausible). You know all the areas of interest where an attacker could inject code. You take care to lock down each one. But come to your surprise ... (hypothetical) 6 months after you upgraded from 11.2 to the latest 12.x, you find that = you didn't take into account that $HOME/.profile (which you perhaps = locked down with a "chflags" command) now branches out to a new file = which you've never taken steps to lock down, keep an eye on, or audit = (e.g., by using DTrace remote-logging, tripwire, or other means). You = only found out 6 months after the upgrade because someone exploited it. = At that point, the security event has already occurred. When I worked at "the banks" shit like this was always on our radar. = Changes like this were often cited for the reason why one bank moved to = BoKs for security. >=20 >> Further, it is documented that the contents of ENV may be ignored in = privileged mode, negating these changes. >=20 > True - so if someone finds the idea of having a suid shell useful - = from > what I undestand that's what the privileged mode boils down to - this > change will be a no-op. I seriously hope nobody does, though. >=20 =46rom the manual: -p privileged Turn on privileged mode. This mode is enabled on startup = if either the effective user or group ID is not equal to the = real user or group ID. Turning this mode off sets the effective = user and group IDs to the real user and group IDs. When this = mode is enabled for interactive shells, the file /etc/suid_profile = is sourced instead of ~/.profile after /etc/profile is = sourced, and the contents of the ENV variable are ignored. So as you can see, it's suid *or* sgid. I can think of plenty of places where sgid is common. >> If you wanted your new shiny default PS1 to actually have an effect = in all modes (including privileged mode, where you probably want it), = you would have put it in /etc/profile and not in a file that is wholly = ignored by some modes (e.g., privileged mode). >> So the solution is not even the right one for the desired result. >=20 > I would, if only it didn't break zsh, and perhaps others. The > problem here is that zsh uses different syntax for PS1, _and_ > it also parses /etc/profile. >=20 > And no, I don't care at all about privileged mode, I can't imagine > a situation when using it would be a good idea. >=20 Rampant hand-waving. OK, that still leaves the fact that a non-static PS1 fucks with = TCL/Expect programmers. --=20 Devin= From owner-svn-src-head@freebsd.org Fri Jan 25 23:56:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B55B114C78DD; Fri, 25 Jan 2019 23:56:37 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 357B081682; Fri, 25 Jan 2019 23:56:37 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x443.google.com with SMTP id s12so12049303wrt.4; Fri, 25 Jan 2019 15:56:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=atul9Yfi3yKf7eyTGj8Vd2mxlasM5Yrt4Um3vXBLTTA=; b=K2bNGNpeaKiZPnTPJiXn+bPbe9+t+y8jStZZdcQ3e/CW6Dn7ZvHbb0aqmkqdfvgJ9i UHDTfi+c6WlytYlm1cDzkLOi+d6330915ehFk0vCgX+bF1FyZC3rzI8CmPNw8zv8p51S hNGAvVovsTtRGkzWHS7ujuDO2gEfEKuVUvaZmFSkwsJxIi8OPuGxhlw30KDEGjwqo6tm zgcSbc0256lVWwMbbTHyBjaj2pObbSYxmUp29LqAce4BWoqTjTiM1zg934UJj7NVA8dH jEO1esGX6UzbHE38FS3gx6/H7h801yQBOAbYCI2v6HkYOv8m7BZnmbJKp/XBBs9VKV9A 7NrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=atul9Yfi3yKf7eyTGj8Vd2mxlasM5Yrt4Um3vXBLTTA=; b=auvja3N+hQLa7oec/betDF+0UcvNHtgffsOyPns9QhOD71JcTbhQba2ypsaSqYy3+T 036yJCDNDXwZOBye+msWoA+Huy/iKaZuKtI9ofZLDedLy9E/W7STnsFxA3lb/hXo9IJY aNdcxYhbTzdmPEA1g1Qsn+s6CggC4zSByZGUp+fw0YG0Dc9GO/iqCVq/z1e2ZPA7nZRq AzIm0sdBrWLa/BWRmxYZT2qhigVlbUDwL42bFsET4T1GmmA4bGJic2qBESh2oxxCM1cm OrQPzwxa6NOo2weBBqBqnSCFrYa+IzlIVI2aWxBWkMg7o5E8EazFcvFZvuRKWn0kQVro tvqA== X-Gm-Message-State: AJcUukcg7eUMELX2r/lOkTUtzG8TdZ+2tPt8qPGyw4pupjTGdFAN3gZe ZYAeUYLj2zPzY+RNfsAAHOCg6FQr X-Google-Smtp-Source: ALg8bN60Dx/tBGqad3TZZQ/TAyhtx014FBYRGhOCMFO01z5RSIpBKC8PlWOi3kkFuohrbkvRa5uvBw== X-Received: by 2002:adf:f091:: with SMTP id n17mr13210619wro.292.1548460594893; Fri, 25 Jan 2019 15:56:34 -0800 (PST) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id 10sm80041626wmy.40.2019.01.25.15.56.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 15:56:34 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 25 Jan 2019 09:13:34 +0000 From: Edward Napierala To: Devin Teske Cc: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343440 - head/bin/sh Message-ID: <20190125091334.GA26545@v2> Mail-Followup-To: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> <20190125082851.GA26199@v2> <1F038D39-8869-4220-A274-F6307A4264E2@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1F038D39-8869-4220-A274-F6307A4264E2@FreeBSD.org> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 357B081682 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 23:56:37 -0000 On 0125T1530, Devin Teske wrote: > > > > On Jan 25, 2019, at 12:28 AM, Edward Napierala wrote: > > > > On 0125T1441, Devin Teske wrote: > >> > >> > >>> On Jan 25, 2019, at 1:37 PM, Edward Napierala wrote: > >>> > >>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes > >>> > napisał(a): > >>>> > >>>>> Author: trasz > >>>>> Date: Fri Jan 25 17:09:26 2019 > >>>>> New Revision: 343440 > >>>>> URL: https://svnweb.freebsd.org/changeset/base/343440 > >>>>> > >>>>> Log: > >>>>> Comment out the default sh(1) aliases for root, introduced in r343416. > >>>>> The rest of this stuff is still to be discussed, but I think at this > >>>>> point we have the agreement that the aliases should go. > >>>>> > >>>>> MFC after: 2 weeks > >>>>> Sponsored by: DARPA, AFRL > >>>> > >>>> Please just revert this and the prior commit out, and when > >>>> the path forward is clear commit it. I would not want any of this > >>>> merged to 12/ or 11/ until the time that it is all settled. > >>> > >>> Oops, my bad - neither this nor the previous commit is supposed > >>> to be MFC-ed; the "2 weeks" above comes from my default Subversion > >>> config. > >>> > >>> Regarding the backoff - just a few hours ago you said you don't have > >>> any problem with this, except for aliases and the default ENV. The > >>> aliases problem has been addressed, and you hadn't yet responded > >>> to my explanations regarding the ENV. Another committer asked for > >>> backoff, because "sh is not an interactive shell", while in fact sh(1) > >>> is FreeBSD's default interactive shell except for root. Finally, there's > >>> one person who asked for revert, but without giving any reasons > >>> whatsoever. > >>> > >>> So far nobody had proposed any scenario where this would break > >>> anything, or even affect existing users. It seems like a typical bikeshed > >>> situation. > >> > >> It is not clear to me after reading r343416 and D18872 what this change is trying to solve. > > > > The idea is to make it easy to replace the default root shell - which > > many people consider broken, due to not supporting basic shell syntax - with > > something that actually works. > > How exactly does changing PS1 or adding 6 aliases fix the "basic shell syntax" which you claim to be unsupported? > > If the number of aliases added to a shell are a measure of its brokenness, then bash must be hella broken (I have 43 aliases in my bash_profile). The aliases are gone. Human-friendly PS1 is considered a standard feature nowadays. But the way it fixes things is that it makes it easy to replace csh with a shell which actually groks shell syntax and is reasonably useful out of the box, with ~/.shrc you can customize etc. Think of it as a POLA, but horizontally, for folks coming from other systems, instead of the usual one. > Also, the perhaps anecdotal consideration of brokenness is nearly laughable -- these can largely be lumped into one of three categories: > > a. Considered broken because it doesn't support bashisms > b. Considered broken because lack of syntactical knowledge > c. Considered broken because (no reason given) It's broken because it doesn't accept what people call the shell syntax. Sure, some folks do realize there used to be something called 'csh', and people kept using it even into the nineties. But most users aren't actually that much into computing history; they expect the system to just work like they expect. > Other languages might fit that description as well, and so we should take this anecdote of "many people consider broken" with a grain of salt. > > I personally have written more than 50,000 lines of shell for the FreeBSD base OS -- all utilizing /bin/sh And that's one of the reasons why I really apprieciate your response. > >> PS1 should have a reasonable default. If that default is not reasonable, then we should change the C code. > >> > >> Maybe I see things differently, but I'd rather see PS1 default change so no profile/shrc change is necessary. > > > > Thank you, that's actually a valid argument. I believe that's also what > > bash does. It would be more intrusive, though, and I kind of don't like > > the idea of hardcoding things that can easily be dealt with with in a more > > "high-level" way. > > > >> I prefer that sh, in its default configuration, not attempt to read $HOME/.shrc, for security reasons. > > > > Can you elaborate? It already reads $HOME/.profile; how is $HOME/.shrc > > different? > > If you read "The Cuckoo's Egg" by Clifford Stoll, you'll understand the importance of "one place to exploit versus two." > > (situation) > > Say you've been running FreeBSD for 20 years (it turned 25 years old last year, so this is not only possible, but plausible). > You know all the areas of interest where an attacker could inject code. > You take care to lock down each one. > But come to your surprise ... > > (hypothetical) > > 6 months after you upgraded from 11.2 to the latest 12.x, you find that you didn't take into account that $HOME/.profile (which you perhaps locked down with a "chflags" command) now branches out to a new file which you've never taken steps to lock down, keep an eye on, or audit (e.g., by using DTrace remote-logging, tripwire, or other means). You only found out 6 months after the upgrade because someone exploited it. At that point, the security event has already occurred. > > When I worked at "the banks" shit like this was always on our radar. Changes like this were often cited for the reason why one bank moved to BoKs for security. The change we're discussing doesn't affect upgrades at all - it's only for new installs. And it only affects root, for whom the answer to 'where an attacker could inject code' question is 'literally everywhere, including the firmware'. And it doesn't affect root by default, you need to change their shell from csh(1) to sh(1). > >> Further, it is documented that the contents of ENV may be ignored in privileged mode, negating these changes. > > > > True - so if someone finds the idea of having a suid shell useful - from > > what I undestand that's what the privileged mode boils down to - this > > change will be a no-op. I seriously hope nobody does, though. > > > > From the manual: > > -p privileged > Turn on privileged mode. This mode is enabled on startup if > either the effective user or group ID is not equal to the real > user or group ID. Turning this mode off sets the effective user > and group IDs to the real user and group IDs. When this mode is > enabled for interactive shells, the file /etc/suid_profile is > sourced instead of ~/.profile after /etc/profile is sourced, and > the contents of the ENV variable are ignored. > > So as you can see, it's suid *or* sgid. > > I can think of plenty of places where sgid is common. Okay. I've never seen an sgid shell myself, but I believe you. Still, for that case the change we're discussing is a no-op. > >> If you wanted your new shiny default PS1 to actually have an effect in all modes (including privileged mode, where you probably want it), you would have put it in /etc/profile and not in a file that is wholly ignored by some modes (e.g., privileged mode). > >> So the solution is not even the right one for the desired result. > > > > I would, if only it didn't break zsh, and perhaps others. The > > problem here is that zsh uses different syntax for PS1, _and_ > > it also parses /etc/profile. > > > > And no, I don't care at all about privileged mode, I can't imagine > > a situation when using it would be a good idea. > > > > Rampant hand-waving. > > OK, that still leaves the fact that a non-static PS1 fucks with TCL/Expect programmers. True, that's a valid argument. Question is, is the number of FreeBSD systems (others already use more complicated PS1 by default) to be deployed (the change doesn't affect existing installations) with root shell changed to sh(1) (the change doesn't affect situations when sh(1) is not your login shell) that have to interface with Expect scripts that can't handle more complicated prompts, large enough to actually care? From owner-svn-src-head@freebsd.org Sat Jan 26 00:47:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A626F14A79D8; Sat, 26 Jan 2019 00:47:32 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2874D84144; Sat, 26 Jan 2019 00:47:32 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=64153 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gnC80-000FQ3-GJ; Fri, 25 Jan 2019 16:47:20 -0800 From: Devin Teske Message-Id: <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343440 - head/bin/sh Date: Fri, 25 Jan 2019 16:47:27 -0800 In-Reply-To: <20190125091334.GA26545@v2> Cc: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Edward Napierala References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> <20190125082851.GA26199@v2> <1F038D39-8869-4220-A274-F6307A4264E2@FreeBSD.org> <20190125091334.GA26545@v2> X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: 2874D84144 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 00:47:33 -0000 > On Jan 25, 2019, at 1:13 AM, Edward Napierala = wrote: >=20 > On 0125T1530, Devin Teske wrote: >>=20 >>=20 >>> On Jan 25, 2019, at 12:28 AM, Edward Napierala = wrote: >>>=20 >>> On 0125T1441, Devin Teske wrote: >>>>=20 >>>>=20 >>>>> On Jan 25, 2019, at 1:37 PM, Edward Napierala = wrote: >>>>>=20 >>>>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes >>>>> > napisa=C5=82(a): >>>>>>=20 >>>>>>> Author: trasz >>>>>>> Date: Fri Jan 25 17:09:26 2019 >>>>>>> New Revision: 343440 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/343440 >>>>>>>=20 >>>>>>> Log: >>>>>>> Comment out the default sh(1) aliases for root, introduced in = r343416. >>>>>>> The rest of this stuff is still to be discussed, but I think at = this >>>>>>> point we have the agreement that the aliases should go. >>>>>>>=20 >>>>>>> MFC after: 2 weeks >>>>>>> Sponsored by: DARPA, AFRL >>>>>>=20 >>>>>> Please just revert this and the prior commit out, and when >>>>>> the path forward is clear commit it. I would not want any of = this >>>>>> merged to 12/ or 11/ until the time that it is all settled. >>>>>=20 >>>>> Oops, my bad - neither this nor the previous commit is supposed >>>>> to be MFC-ed; the "2 weeks" above comes from my default Subversion >>>>> config. >>>>>=20 >>>>> Regarding the backoff - just a few hours ago you said you don't = have >>>>> any problem with this, except for aliases and the default ENV. = The >>>>> aliases problem has been addressed, and you hadn't yet responded >>>>> to my explanations regarding the ENV. Another committer asked for >>>>> backoff, because "sh is not an interactive shell", while in fact = sh(1) >>>>> is FreeBSD's default interactive shell except for root. Finally, = there's >>>>> one person who asked for revert, but without giving any reasons >>>>> whatsoever. >>>>>=20 >>>>> So far nobody had proposed any scenario where this would break >>>>> anything, or even affect existing users. It seems like a typical = bikeshed >>>>> situation. >>>>=20 >>>> It is not clear to me after reading r343416 and D18872 what this = change is trying to solve. >>>=20 >>> The idea is to make it easy to replace the default root shell - = which >>> many people consider broken, due to not supporting basic shell = syntax - with >>> something that actually works. >>=20 >> How exactly does changing PS1 or adding 6 aliases fix the "basic = shell syntax" which you claim to be unsupported? >>=20 >> If the number of aliases added to a shell are a measure of its = brokenness, then bash must be hella broken (I have 43 aliases in my = bash_profile). >=20 > The aliases are gone. Fair enough, albeit the topic was r343416 and D18872. > Human-friendly PS1 is considered a standard feature > nowadays. I fail to see how ''$ " is unfriendly. In fact, I am a bit amiss how you don't see "\u@\h:\w \\$ " as being = unfriendly to TCL/Expect. While it's certainly possible to use "expect -re" and formulate around = it, the change itself would break existing scripts. > But the way it fixes things is that it makes it easy to replace > csh with a shell which actually groks shell syntax and is reasonably = useful > out of the box, This sounds like you are claiming csh is broken. I see where you may be coming from: + /bin/sh supports a syntax + bash supports nearly all of /bin/sh + zsh supports nearly all of /bin/sh So [t]csh must seem broken to you because it doesn't fall inline. Being different doesn't mean you are broken. As I have stated = previously, I know lots of people that would and do set their login = shell to tcsh. I personally have both a .tcshrc and a .bash_profile because I use both. = I would never consider csh broken because it doesn't "grok shell syntax" = -- it in-fact groks its own shell syntax just fine and dandy. > with ~/.shrc you can customize etc. As can ~/.profile > Think of it as a POLA, > but horizontally, for folks coming from other systems, instead of the = usual > one. POLA can affect multiple people at the same time. Someone may be astonished that something is different when coming from = anther community, but what if addressing this difference causes a POLA = violation for long-standing users. >=20 >> Also, the perhaps anecdotal consideration of brokenness is nearly = laughable -- these can largely be lumped into one of three categories: >>=20 >> a. Considered broken because it doesn't support bashisms >> b. Considered broken because lack of syntactical knowledge >> c. Considered broken because (no reason given) >=20 > It's broken because it doesn't accept what people call the shell = syntax. people from Linux? people you know? people in articles? people on twitter? I don't have this experience. > Sure, some folks do realize there used to be something called 'csh', > and people kept using it even into the nineties. That's one perspective. I started using tcsh in 2007. I keep using it today. I even use it on my Mac. I also use it on Linux. I continue to grow my ~/.tcsh file (currently at 410 lines) When I use tcsh, I appreciate it for the features that do not exist in = any other shell ("repeat N cmd", "|&", etc.) > But most users aren't > actually that much into computing history; they expect the system to = just > work like they expect. >=20 You can ignore history, but it doesn't change the fact that we still = maintain it. https://svnweb.freebsd.org/base/head/contrib/tcsh/?view=3Dlog = I'm not into neologisms, but that doesn't mean new things don't stop = being created. Is the end-goal to make sure that FreeBSD only has shells that are = compatible with Linux ones? What about the very important matter of offering choice? I will digress because this is no longer about .shrc anymore and we = should strive to stay on topic. >> Other languages might fit that description as well, and so we should = take this anecdote of "many people consider broken" with a grain of = salt. >>=20 >> I personally have written more than 50,000 lines of shell for the = FreeBSD base OS -- all utilizing /bin/sh >=20 > And that's one of the reasons why I really apprieciate your response. Why thank you. I'll give an honest data point that I feel may be illuminating: While I consider myself to be proficient in bourne shell (actively = rejecting bash, zsh, or other similar shell syntax), I have long been = envious of [t]csh's syntax which allows for far fewer lines of code to = achieve the same thing. Now, I will be the first to admit that csh has its warts (for example, = try to throw away stdout but keep stderr through a series of redirects = -- this is perhaps the only thing that /bin/sh makes easier than = [t]csh), but it is ultimately a shining star for anyone that wants to = script their system in a more friendly manner. CSH scripts that I have maintained, developed, and had shared with me = over the past 15 years have always evoked a sense of respect, = consternation, amazement, and humility from me. The difference, however, between /bin/sh and [t]csh is more like the = differences between perl 5 and perl 6. They are wholly incompatible with = each other and (csh being like perl 6) has features that really kick ass = (think "grammars" if you're familiar with some of the things that make = Perl 6 unique compared to Perl 5). >=20 >>>> PS1 should have a reasonable default. If that default is not = reasonable, then we should change the C code. >>>>=20 >>>> Maybe I see things differently, but I'd rather see PS1 default = change so no profile/shrc change is necessary. >>>=20 >>> Thank you, that's actually a valid argument. I believe that's also = what >>> bash does. It would be more intrusive, though, and I kind of don't = like >>> the idea of hardcoding things that can easily be dealt with with in = a more >>> "high-level" way. >>>=20 >>>> I prefer that sh, in its default configuration, not attempt to read = $HOME/.shrc, for security reasons. >>>=20 >>> Can you elaborate? It already reads $HOME/.profile; how is = $HOME/.shrc >>> different? >>=20 >> If you read "The Cuckoo's Egg" by Clifford Stoll, you'll understand = the importance of "one place to exploit versus two." >>=20 >> (situation) >>=20 >> Say you've been running FreeBSD for 20 years (it turned 25 years old = last year, so this is not only possible, but plausible). >> You know all the areas of interest where an attacker could inject = code. >> You take care to lock down each one. >> But come to your surprise ... >>=20 >> (hypothetical) >>=20 >> 6 months after you upgraded from 11.2 to the latest 12.x, you find = that you didn't take into account that $HOME/.profile (which you perhaps = locked down with a "chflags" command) now branches out to a new file = which you've never taken steps to lock down, keep an eye on, or audit = (e.g., by using DTrace remote-logging, tripwire, or other means). You = only found out 6 months after the upgrade because someone exploited it. = At that point, the security event has already occurred. >>=20 >> When I worked at "the banks" shit like this was always on our radar. = Changes like this were often cited for the reason why one bank moved to = BoKs for security. >=20 > The change we're discussing doesn't affect upgrades at all - it's only > for new installs. mergemaster, iirc, will merge in changes to etc files after an upgrade. So this would effect anybody that goes through an upgrade and performs = mergemaster. > And it only affects root, for whom the answer to > 'where an attacker could inject code' question is 'literally = everywhere, > including the firmware'. This is not true in many situations. One being in a capsicum env or one = where the MAC (TrustedBSD Mandatory Access Control) framework sets = limitations. > And it doesn't affect root by default, you > need to change their shell from csh(1) to sh(1). By your own commit messages admission, this is for the toor account, so = it does affect a user (and as you were keen to point out, users with the = default shell). >=20 >>>> Further, it is documented that the contents of ENV may be ignored = in privileged mode, negating these changes. >>>=20 >>> True - so if someone finds the idea of having a suid shell useful - = from >>> what I undestand that's what the privileged mode boils down to - = this >>> change will be a no-op. I seriously hope nobody does, though. >>>=20 >>=20 >> =46rom the manual: >>=20 >> -p privileged >> Turn on privileged mode. This mode is enabled on startup = if >> either the effective user or group ID is not equal to the = real >> user or group ID. Turning this mode off sets the = effective user >> and group IDs to the real user and group IDs. When this = mode is >> enabled for interactive shells, the file = /etc/suid_profile is >> sourced instead of ~/.profile after /etc/profile is = sourced, and >> the contents of the ENV variable are ignored. >>=20 >> So as you can see, it's suid *or* sgid. >>=20 >> I can think of plenty of places where sgid is common. >=20 > Okay. I've never seen an sgid shell myself, but I believe you. = Still, > for that case the change we're discussing is a no-op. >=20 >>>> If you wanted your new shiny default PS1 to actually have an effect = in all modes (including privileged mode, where you probably want it), = you would have put it in /etc/profile and not in a file that is wholly = ignored by some modes (e.g., privileged mode). >>>> So the solution is not even the right one for the desired result. >>>=20 >>> I would, if only it didn't break zsh, and perhaps others. The >>> problem here is that zsh uses different syntax for PS1, _and_ >>> it also parses /etc/profile. >>>=20 >>> And no, I don't care at all about privileged mode, I can't imagine >>> a situation when using it would be a good idea. >>>=20 >>=20 >> Rampant hand-waving. >>=20 >> OK, that still leaves the fact that a non-static PS1 fucks with = TCL/Expect programmers. >=20 > True, that's a valid argument. Question is, is the number of FreeBSD > systems (others already use more complicated PS1 by default) to be = deployed > (the change doesn't affect existing installations) with root shell = changed > to sh(1) (the change doesn't affect situations when sh(1) is not your = login > shell) that have to interface with Expect scripts that can't handle = more > complicated prompts, large enough to actually care? We started talking about toor because it has no shell specified in = /etc/passwd and therefore uses the default shell (/bin/sh). Also, upgrade/mergemaster to me seems like it would affect existing = installations. Now that I think about it, people using TCL/Expect against the root = account would be talking to csh and probably not be effected. Is it too late to change my vote? Let me sit on this for a few hours. The TCL/Expect argument may be = neutralized because -- as you correctly state -- is probably a minority = of situations. However, I am still concerned about upgrade/mergemaster. Maybe a simple UPDATING entry can be used to address the former concern = about corporate secteams needing to be kept informed of this nominal = [potential] change. --=20 Devin From owner-svn-src-head@freebsd.org Sat Jan 26 01:05:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B17A14A8072; Sat, 26 Jan 2019 01:05:37 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73BC884A74; Sat, 26 Jan 2019 01:05:36 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0Q15YQZ091096; Fri, 25 Jan 2019 17:05:34 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0Q15YwH091095; Fri, 25 Jan 2019 17:05:34 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901260105.x0Q15YwH091095@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343440 - head/bin/sh In-Reply-To: <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> To: Devin Teske Date: Fri, 25 Jan 2019 17:05:34 -0800 (PST) CC: Edward Napierala , rgrimes@FreeBSD.org, src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 73BC884A74 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.955,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 01:05:37 -0000 > > On Jan 25, 2019, at 1:13 AM, Edward Napierala wrote: Chop with the big axe most of this as I need to clarify a miss statement. ... > > The change we're discussing doesn't affect upgrades at all - it's only > > for new installs. > > mergemaster, iirc, will merge in changes to etc files after an upgrade. > So this would effect anybody that goes through an upgrade and performs mergemaster. Correct, and to my knowledge there is no way to stop that effect. ... > > > And it doesn't affect root by default, you > > need to change their shell from csh(1) to sh(1). > > By your own commit messages admission, this is for the toor account, so it does affect a user (and as you were keen to point out, users with the default shell). Further it effects root any time root types "sh" or "/bin/sh" and intentially invokes sh interactive for some reason, something I do more often than I care to admit simply cause I know what I want to do is much easier in that shell. It does not require root change there login shell for these changes to effect the root account usage. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Jan 26 01:23:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AE4014A9572; Sat, 26 Jan 2019 01:23:42 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 056F185A55; Sat, 26 Jan 2019 01:23:42 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm1-x336.google.com with SMTP id d15so8455072wmb.3; Fri, 25 Jan 2019 17:23:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ft81Ft8sHbNIQ6uE4ckkrgDUcRbfBlly6hRTq7xttq4=; b=Z75mnV3riL7LmUKyOrpFAFv2IpAJfy/JgQzda0sim/B1WlDxEchcwJPRCQrSEEXVhz hRR8Imo/lNZgZE31XBYxdgheXo00e1/dExUR/6wdhacSjXu0ch7ygWUvc+eYhpd8C/dc klwPeiVPMlqRNJOI2duQZT8qX6juBEKXbo5Up26JN/dnXp5O3kJ6DlIPZdSakJHXnwKi vXFCyq7RgHxio6J1uyjUL7KtBD8AmwvB6K4CVIfNGuRLex5OFBsL+vkOqOf0ZAggMZy/ uQ6WmLhSipogVtHy9Dausmuy9Ob6QiTEdi4bJD9ss2T29yHeqW0UFSHrISHCDRqHfsJI yIIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=ft81Ft8sHbNIQ6uE4ckkrgDUcRbfBlly6hRTq7xttq4=; b=tazgozO97lcEgO/sh06PJyNXKYsurdO7vgdprZeMxK+BhtpJb85XX19Ndc2yLjwYdX Ct4dSA9VEOeHim48ncu3wOARQ5LeLCMW0cZ7ut+peIrPhj9ghvBZekQkh97w6S3lgdf9 UJ+YWUVuzA1MFyOJdiGlcb/tlzzgJblEH+dVgVJOEJaSGpYEN7cL8yNjTKM1tdH1gE5q iIYnjUHkZKulXvSOdQVPZPM/JKuYLJZjN6h3vlND7VbQLZI/8r/aXOuxgnC02UlKN9Ro ZZv606zH1QPB1rkBJtgS7fwUJ8E0m4m6TqZB53AluWkow2XVjZ0oQ6vK5AumiP9B9hgN y03g== X-Gm-Message-State: AJcUukel04qi7Z2CpsMCJHAg0LWV+psWwzAkASciTkwmQK/WywC1H5ti zTu1aU7P+0NDjf6EPAnUkU7c7cn+ X-Google-Smtp-Source: ALg8bN4v+ffyyWSMiN5wU08VXIZw2k1fZeITF4ayiv4EaOMGTXc9sUOzbMiz63rTMlYE09qaO54DYw== X-Received: by 2002:a1c:494:: with SMTP id 142mr8636259wme.111.1548465819296; Fri, 25 Jan 2019 17:23:39 -0800 (PST) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id w125sm70138530wmb.45.2019.01.25.17.23.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 17:23:38 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 25 Jan 2019 09:50:51 +0000 From: Edward Napierala To: Devin Teske Cc: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343440 - head/bin/sh Message-ID: <20190125095051.GA26744@v2> Mail-Followup-To: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> <20190125082851.GA26199@v2> <1F038D39-8869-4220-A274-F6307A4264E2@FreeBSD.org> <20190125091334.GA26545@v2> <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 056F185A55 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.995,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 01:23:42 -0000 Excuse my brevity; I'll address the rest after getting some sleep, but I'd like to clarify one crucial thing. I think that's actually _the_ point where I screwed up: I didn't expect people to actually care for what I considered a cosmetic change, and I didn't realize the need to explain what this commit does _not_ affect. (And I've been reminded by rgrimes@ more than once that I should pay more attention to my commit messages. Oh well. Perhaps I'll learn this time.) On 0125T1647, Devin Teske wrote: > > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala wrote: [..] > >>>> PS1 should have a reasonable default. If that default is not reasonable, then we should change the C code. > >>>> > >>>> Maybe I see things differently, but I'd rather see PS1 default change so no profile/shrc change is necessary. > >>> > >>> Thank you, that's actually a valid argument. I believe that's also what > >>> bash does. It would be more intrusive, though, and I kind of don't like > >>> the idea of hardcoding things that can easily be dealt with with in a more > >>> "high-level" way. > >>> > >>>> I prefer that sh, in its default configuration, not attempt to read $HOME/.shrc, for security reasons. > >>> > >>> Can you elaborate? It already reads $HOME/.profile; how is $HOME/.shrc > >>> different? > >> > >> If you read "The Cuckoo's Egg" by Clifford Stoll, you'll understand the importance of "one place to exploit versus two." > >> > >> (situation) > >> > >> Say you've been running FreeBSD for 20 years (it turned 25 years old last year, so this is not only possible, but plausible). > >> You know all the areas of interest where an attacker could inject code. > >> You take care to lock down each one. > >> But come to your surprise ... > >> > >> (hypothetical) > >> > >> 6 months after you upgraded from 11.2 to the latest 12.x, you find that you didn't take into account that $HOME/.profile (which you perhaps locked down with a "chflags" command) now branches out to a new file which you've never taken steps to lock down, keep an eye on, or audit (e.g., by using DTrace remote-logging, tripwire, or other means). You only found out 6 months after the upgrade because someone exploited it. At that point, the security event has already occurred. > >> > >> When I worked at "the banks" shit like this was always on our radar. Changes like this were often cited for the reason why one bank moved to BoKs for security. > > > > The change we're discussing doesn't affect upgrades at all - it's only > > for new installs. > > mergemaster, iirc, will merge in changes to etc files after an upgrade. > So this would effect anybody that goes through an upgrade and performs mergemaster. No, it won't - it doesn't affect files in /etc at all. It doesn't affect stuff that's being installed by mergemaster(8), nor stuff installed by 'make install'. It only affects the default /root/.profile and /root/.shrc, as installed by bsdinstall(8) or shipped as VM or SD card images. [..] > > And it doesn't affect root by default, you > > need to change their shell from csh(1) to sh(1). > > By your own commit messages admission, this is for the toor account, so it does affect a user (and as you were keen to point out, users with the default shell). Yes, but it only affects the toor account for new installs, and the account is locked by default. From owner-svn-src-head@freebsd.org Sat Jan 26 01:28:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7974614A9C89; Sat, 26 Jan 2019 01:28:02 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3714860BE; Sat, 26 Jan 2019 01:28:01 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x443.google.com with SMTP id x10so12155414wrs.8; Fri, 25 Jan 2019 17:28:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=YskLptLkcDrX9KuckrGjVrmrWubScydxSZN7+jyrojc=; b=YsL+uRPgbSUKFsYwwyPAvuE408DBMooyPKBt3RlMz4U0N7BL1lYrnMyeYL6QyybGWn /hBjXFmxGNKR9kNAtmfA4qc/+0G5eZETxu42/kJY2e/ugbpg6qzmzIsXIpR0jm3sVjy5 UcWjP8DXRThiwbjAEkrdBrAZ3fKtFfIFNeU0MmRpSadoOg2vASJ8QDLe4kwFH4Wzthix lzcpSL1tgSGt1e2Te2WA+NgJ8oiBd5kLtde7G33bRFGeMBGfOxOTSV/Gxcds3wujvtTH znaNXhsmxPw6RTLY90s7+w7AttgRopVhtiFrTANCyK6Pn6DiY2VaQRlRS9jJRaXxpNTo 1LoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=YskLptLkcDrX9KuckrGjVrmrWubScydxSZN7+jyrojc=; b=eV9avnNWq2D0Jy0PZQw5sEp69ELVpAzKuXiA1TzPiQym+atUm10Zw9EtTj1xMbKWTd dw/wTqj/IvudOZFVe8uo0CSBJCt9JaIHSWYppYdc7TRCEeZlwW9xRbPIr/uTEiknwR+a ENYxzVhv9hq5+YEKKsje2yvcR5nZWGQR0PiMb1RL8WWMhGhCgQxdUPzKAgTwmGh0+zrq 2bU6noJCQjo3YSi9MBamtqfS1WtFfnE9+T6QOJtw25hlPeLgr0TK1tBnd+KHqXiIYKZh e2kMzVSqhzPzS4c2oV6A2KZaOapBq7CcNfkgUgt9z5ISOvJy0BVNg+RGxgjuJ8YThKBc oROw== X-Gm-Message-State: AJcUukfk40ULTJbXP18H10+ikM2DaeLYW7mdGgaGSjGgFqZ+p8OtxpRX OIyxVHK1VNz68RNj9M8s1ow1A/sL X-Google-Smtp-Source: ALg8bN75GKodutCZZ3rmUT9Fcn2JMQ1/zl0PPmm8FYwPmJ5K2fEppEo6lVw5+hOUz4XPEZPs+/8V8w== X-Received: by 2002:adf:f211:: with SMTP id p17mr13342219wro.293.1548466080506; Fri, 25 Jan 2019 17:28:00 -0800 (PST) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id z7sm91786883wrw.22.2019.01.25.17.27.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Jan 2019 17:27:59 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 25 Jan 2019 09:55:12 +0000 From: Edward Napierala To: rgrimes@freebsd.org Cc: Devin Teske , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343440 - head/bin/sh Message-ID: <20190125095512.GB26744@v2> Mail-Followup-To: rgrimes@freebsd.org, Devin Teske , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> <201901260105.x0Q15YwH091095@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201901260105.x0Q15YwH091095@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: E3714860BE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.995,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 01:28:02 -0000 On 0125T1705, Rodney W. Grimes wrote: > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala wrote: > > Chop with the big axe most of this as I need to clarify a miss statement. > ... > > > The change we're discussing doesn't affect upgrades at all - it's only > > > for new installs. > > > > mergemaster, iirc, will merge in changes to etc files after an upgrade. > > So this would effect anybody that goes through an upgrade and performs mergemaster. > > Correct, and to my knowledge there is no way to stop that effect. Won't happen in this case, this doesn't apply to files in /etc at all; it only applies to the default /root/.shrc and /root/.profile that get installed on fresh systems. > > > And it doesn't affect root by default, you > > > need to change their shell from csh(1) to sh(1). > > > > By your own commit messages admission, this is for the toor account, so it does affect a user (and as you were keen to point out, users with the default shell). > > Further it effects root any time root types "sh" or "/bin/sh" > and intentially invokes sh interactive for some reason, > something I do more often than I care to admit simply > cause I know what I want to do is much easier in that > shell. It doesn't. For sh(1) to read ~/.shrc (/root/.shrc in this case) you need to have ENV set; the default /root/.profile only sets it when sh(1) is your login shell. Which means, this doesn't change the behaviour when you casually run "sh" or "/bin/sh" as root; sh needs to be set up as login shell for this to take effect. From owner-svn-src-head@freebsd.org Sat Jan 26 01:38:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF61E14AA5D8; Sat, 26 Jan 2019 01:38:04 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48AF6868CB; Sat, 26 Jan 2019 01:38:03 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0Q1bxTs091300; Fri, 25 Jan 2019 17:37:59 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0Q1bwDK091299; Fri, 25 Jan 2019 17:37:58 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901260137.x0Q1bwDK091299@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343440 - head/bin/sh In-Reply-To: <20190125095512.GB26744@v2> To: Edward Napierala Date: Fri, 25 Jan 2019 17:37:58 -0800 (PST) CC: rgrimes@freebsd.org, Devin Teske , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 48AF6868CB X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [2.24 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.76)[0.761,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.15)[0.149,0]; NEURAL_SPAM_MEDIUM(0.45)[0.455,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.01)[ip: (0.02), ipnet: 69.59.192.0/19(0.01), asn: 13868(-0.02), country: US(-0.08)] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 01:38:05 -0000 > On 0125T1705, Rodney W. Grimes wrote: > > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala wrote: > > > > Chop with the big axe most of this as I need to clarify a miss statement. > > ... > > > > The change we're discussing doesn't affect upgrades at all - it's only > > > > for new installs. > > > > > > mergemaster, iirc, will merge in changes to etc files after an upgrade. > > > So this would effect anybody that goes through an upgrade and performs mergemaster. > > > > Correct, and to my knowledge there is no way to stop that effect. > > Won't happen in this case, this doesn't apply to files in /etc > at all; it only applies to the default /root/.shrc and /root/.profile > that get installed on fresh systems. mergemaster is the wrong term here, freebsd-update is going to want to merge this change. > > > > And it doesn't affect root by default, you > > > > need to change their shell from csh(1) to sh(1). > > > > > > By your own commit messages admission, this is for the toor account, so it does affect a user (and as you were keen to point out, users with the default shell). > > > > Further it effects root any time root types "sh" or "/bin/sh" > > and intentially invokes sh interactive for some reason, > > something I do more often than I care to admit simply > > cause I know what I want to do is much easier in that > > shell. > > It doesn't. For sh(1) to read ~/.shrc (/root/.shrc in this case) > you need to have ENV set; the default /root/.profile only sets > it when sh(1) is your login shell. I do not see any conditional logic in /root/.profile, what your mis stating is that /root/.profile is not run for a login shell, so ENV would not be set unless something else caused /root/.profile to be read, aka source ~/.profile > Which means, this doesn't > change the behaviour when you casually run "sh" or "/bin/sh" > as root; sh needs to be set up as login shell for this to take > effect. Again I do not see any conditional logic in /root/.profile that would make that true. A su - toor would be effected. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Jan 26 03:43:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5115C14AE642; Sat, 26 Jan 2019 03:43:13 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9AAD8A9A9; Sat, 26 Jan 2019 03:43:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCC8C1A54A; Sat, 26 Jan 2019 03:43:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0Q3hCqN034890; Sat, 26 Jan 2019 03:43:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0Q3hCje034889; Sat, 26 Jan 2019 03:43:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201901260343.x0Q3hCje034889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Sat, 26 Jan 2019 03:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343461 - head/lib/libc/tests/sys X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libc/tests/sys X-SVN-Commit-Revision: 343461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E9AAD8A9A9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 03:43:13 -0000 Author: ngie Date: Sat Jan 26 03:43:12 2019 New Revision: 343461 URL: https://svnweb.freebsd.org/changeset/base/343461 Log: Fix reporting errors with `gai_strerror(..)` The return value (`err`) should be checked; not the `errno` value. PR: 235200 Approved by: emaste (mentor) Reviewed by: asomers, lwhsu MFC after: 28 days MFC with: r343362, r343365, r343367-r343368 Differential Revision: https://reviews.freebsd.org/D18969 Modified: head/lib/libc/tests/sys/sendfile_test.c Modified: head/lib/libc/tests/sys/sendfile_test.c ============================================================================== --- head/lib/libc/tests/sys/sendfile_test.c Fri Jan 25 22:52:49 2019 (r343460) +++ head/lib/libc/tests/sys/sendfile_test.c Sat Jan 26 03:43:12 2019 (r343461) @@ -114,7 +114,7 @@ resolve_localhost(struct addrinfo **res, int domain, i error = getaddrinfo("localhost", serv, &hints, res); ATF_REQUIRE_EQ_MSG(error, 0, - "getaddrinfo failed: %s", gai_strerror(errno)); + "getaddrinfo failed: %s", gai_strerror(error)); free(serv); } From owner-svn-src-head@freebsd.org Sat Jan 26 05:35:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C58BB14B26B3; Sat, 26 Jan 2019 05:35:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 696148F447; Sat, 26 Jan 2019 05:35:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B7951B8F5; Sat, 26 Jan 2019 05:35:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0Q5ZPuR094670; Sat, 26 Jan 2019 05:35:25 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0Q5ZPoS094669; Sat, 26 Jan 2019 05:35:25 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201901260535.x0Q5ZPoS094669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 26 Jan 2019 05:35:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343462 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 343462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 696148F447 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 05:35:26 -0000 Author: mckusick Date: Sat Jan 26 05:35:24 2019 New Revision: 343462 URL: https://svnweb.freebsd.org/changeset/base/343462 Log: Expand DDB's set of printable soft dependency data structures. The set of known soft dependency data structures now includes: sd_worklist, sd_inodedep, sd_allocdirect, sd_allocindir, and sd_mkdir. DDB can also print lists of sd_allinodedeps, sd_mkdir_list, and sd_workhead. The sd_workhead script is useful for listing all the dependencies associated with a buffer, e.g. bp->b_dep. Prefix the soft dependency show names with sd_ so that they sort together when listed by DDB's "show help" and to distinguish them from other data structures printable by DDB. Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sat Jan 26 03:43:12 2019 (r343461) +++ head/sys/ufs/ffs/ffs_softdep.c Sat Jan 26 05:35:24 2019 (r343462) @@ -14406,47 +14406,129 @@ softdep_error(func, error) #ifdef DDB +/* exported to ffs_vfsops.c */ +extern void db_print_ffs(struct ufsmount *ump); +void +db_print_ffs(struct ufsmount *ump) +{ + db_printf("mp %p (%s) devvp %p\n", ump->um_mountp, + ump->um_mountp->mnt_stat.f_mntonname, ump->um_devvp); + db_printf(" fs %p su_wl %d su_deps %d su_req %d\n", + ump->um_fs, ump->softdep_on_worklist, + ump->softdep_deps, ump->softdep_req); +} + static void +worklist_print(struct worklist *wk, int verbose) +{ + + if (!verbose) { + db_printf("%s: %p state 0x%b\n", TYPENAME(wk->wk_type), wk, + (u_int)wk->wk_state, PRINT_SOFTDEP_FLAGS); + return; + } + db_printf("worklist: %p type %s state 0x%b next %p\n ", wk, + TYPENAME(wk->wk_type), (u_int)wk->wk_state, PRINT_SOFTDEP_FLAGS, + LIST_NEXT(wk, wk_list)); + db_print_ffs(VFSTOUFS(wk->wk_mp)); +} + +static void inodedep_print(struct inodedep *inodedep, int verbose) { - db_printf("%p fs %p st %x ino %jd inoblk %jd delta %jd nlink %jd" - " saveino %p\n", - inodedep, inodedep->id_fs, inodedep->id_state, + + worklist_print(&inodedep->id_list, 0); + db_printf(" fs %p ino %jd inoblk %jd delta %jd nlink %jd\n", + inodedep->id_fs, (intmax_t)inodedep->id_ino, (intmax_t)fsbtodb(inodedep->id_fs, - ino_to_fsba(inodedep->id_fs, inodedep->id_ino)), + ino_to_fsba(inodedep->id_fs, inodedep->id_ino)), (intmax_t)inodedep->id_nlinkdelta, - (intmax_t)inodedep->id_savednlink, - inodedep->id_savedino1); + (intmax_t)inodedep->id_savednlink); if (verbose == 0) return; - db_printf("\tpendinghd %p, bufwait %p, inowait %p, inoreflst %p, " - "mkdiradd %p\n", + db_printf(" bmsafemap %p, mkdiradd %p, inoreflst %p\n", + inodedep->id_bmsafemap, + inodedep->id_mkdiradd, + TAILQ_FIRST(&inodedep->id_inoreflst)); + db_printf(" dirremhd %p, pendinghd %p, bufwait %p\n", + LIST_FIRST(&inodedep->id_dirremhd), LIST_FIRST(&inodedep->id_pendinghd), - LIST_FIRST(&inodedep->id_bufwait), + LIST_FIRST(&inodedep->id_bufwait)); + db_printf(" inowait %p, inoupdt %p, newinoupdt %p\n", LIST_FIRST(&inodedep->id_inowait), - TAILQ_FIRST(&inodedep->id_inoreflst), - inodedep->id_mkdiradd); - db_printf("\tinoupdt %p, newinoupdt %p, extupdt %p, newextupdt %p\n", TAILQ_FIRST(&inodedep->id_inoupdt), - TAILQ_FIRST(&inodedep->id_newinoupdt), + TAILQ_FIRST(&inodedep->id_newinoupdt)); + db_printf(" extupdt %p, newextupdt %p, freeblklst %p\n", TAILQ_FIRST(&inodedep->id_extupdt), - TAILQ_FIRST(&inodedep->id_newextupdt)); + TAILQ_FIRST(&inodedep->id_newextupdt), + TAILQ_FIRST(&inodedep->id_freeblklst)); + db_printf(" saveino %p, savedsize %jd, savedextsize %jd\n", + inodedep->id_savedino1, + (intmax_t)inodedep->id_savedsize, + (intmax_t)inodedep->id_savedextsize); } -DB_SHOW_COMMAND(inodedep, db_show_inodedep) +static void +newblk_print(struct newblk *nbp) { + worklist_print(&nbp->nb_list, 0); + db_printf(" newblkno %jd\n", (intmax_t)nbp->nb_newblkno); + db_printf(" jnewblk %p, bmsafemap %p, freefrag %p\n", + &nbp->nb_jnewblk, + &nbp->nb_bmsafemap, + &nbp->nb_freefrag); + db_printf(" indirdeps %p, newdirblk %p, jwork %p\n", + LIST_FIRST(&nbp->nb_indirdeps), + LIST_FIRST(&nbp->nb_newdirblk), + LIST_FIRST(&nbp->nb_jwork)); +} + +static void +allocdirect_print(struct allocdirect *adp) +{ + + newblk_print(&adp->ad_block); + db_printf(" oldblkno %jd, oldsize %ld, newsize %ld\n", + adp->ad_oldblkno, adp->ad_oldsize, adp->ad_newsize); + db_printf(" offset %d, inodedep %p\n", + adp->ad_offset, adp->ad_inodedep); +} + +static void +allocindir_print(struct allocindir *aip) +{ + + newblk_print(&aip->ai_block); + db_printf(" oldblkno %jd, lbn %jd\n", + (intmax_t)aip->ai_oldblkno, (intmax_t)aip->ai_lbn); + db_printf(" offset %d, indirdep %p\n", + aip->ai_offset, aip->ai_indirdep); +} + +static void +mkdir_print(struct mkdir *mkdir) +{ + + worklist_print(&mkdir->md_list, 0); + db_printf(" diradd %p, jaddref %p, buf %p\n", + mkdir->md_diradd, mkdir->md_jaddref, mkdir->md_buf); +} + +DB_SHOW_COMMAND(sd_inodedep, db_show_sd_inodedep) +{ + if (have_addr == 0) { - db_printf("Address required\n"); + db_printf("inodedep address required\n"); return; } inodedep_print((struct inodedep*)addr, 1); } -DB_SHOW_COMMAND(inodedeps, db_show_inodedeps) +DB_SHOW_COMMAND(sd_allinodedeps, db_show_sd_allinodedeps) { struct inodedep_hashhead *inodedephd; struct inodedep *inodedep; @@ -14454,7 +14536,7 @@ DB_SHOW_COMMAND(inodedeps, db_show_inodedeps) int cnt; if (have_addr == 0) { - db_printf("Address required\n"); + db_printf("ufsmount address required\n"); return; } ump = (struct ufsmount *)addr; @@ -14466,72 +14548,108 @@ DB_SHOW_COMMAND(inodedeps, db_show_inodedeps) } } -DB_SHOW_COMMAND(worklist, db_show_worklist) +DB_SHOW_COMMAND(sd_worklist, db_show_sd_worklist) { - struct worklist *wk; if (have_addr == 0) { - db_printf("Address required\n"); + db_printf("worklist address required\n"); return; } - wk = (struct worklist *)addr; - printf("worklist: %p type %s state 0x%X\n", - wk, TYPENAME(wk->wk_type), wk->wk_state); + worklist_print((struct worklist *)addr, 1); } -DB_SHOW_COMMAND(workhead, db_show_workhead) +DB_SHOW_COMMAND(sd_workhead, db_show_sd_workhead) { - struct workhead *wkhd; struct worklist *wk; - int i; + struct workhead *wkhd; if (have_addr == 0) { - db_printf("Address required\n"); + db_printf("worklist address required " + "(for example value in bp->b_dep)\n"); return; } - wkhd = (struct workhead *)addr; - wk = LIST_FIRST(wkhd); - for (i = 0; i < 100 && wk != NULL; i++, wk = LIST_NEXT(wk, wk_list)) - db_printf("worklist: %p type %s state 0x%X", - wk, TYPENAME(wk->wk_type), wk->wk_state); - if (i == 100) - db_printf("workhead overflow"); - printf("\n"); + /* + * We often do not have the address of the worklist head but + * instead a pointer to its first entry (e.g., we have the + * contents of bp->b_dep rather than &bp->b_dep). But the back + * pointer of bp->b_dep will point at the head of the list, so + * we cheat and use that instead. If we are in the middle of + * a list we will still get the same result, so nothing + * unexpected will result. + */ + wk = (struct worklist *)addr; + if (wk == NULL) + return; + wkhd = (struct workhead *)wk->wk_list.le_prev; + LIST_FOREACH(wk, wkhd, wk_list) { + switch(wk->wk_type) { + case D_INODEDEP: + inodedep_print(WK_INODEDEP(wk), 0); + continue; + case D_ALLOCDIRECT: + allocdirect_print(WK_ALLOCDIRECT(wk)); + continue; + case D_ALLOCINDIR: + allocindir_print(WK_ALLOCINDIR(wk)); + continue; + case D_MKDIR: + mkdir_print(WK_MKDIR(wk)); + continue; + default: + worklist_print(wk, 0); + continue; + } + } } +DB_SHOW_COMMAND(sd_mkdir, db_show_sd_mkdir) +{ + if (have_addr == 0) { + db_printf("mkdir address required\n"); + return; + } + mkdir_print((struct mkdir *)addr); +} -DB_SHOW_COMMAND(mkdirs, db_show_mkdirs) +DB_SHOW_COMMAND(sd_mkdir_list, db_show_sd_mkdir_list) { struct mkdirlist *mkdirlisthd; - struct jaddref *jaddref; - struct diradd *diradd; struct mkdir *mkdir; if (have_addr == 0) { - db_printf("Address required\n"); + db_printf("mkdir listhead address required\n"); return; } mkdirlisthd = (struct mkdirlist *)addr; LIST_FOREACH(mkdir, mkdirlisthd, md_mkdirs) { - diradd = mkdir->md_diradd; - db_printf("mkdir: %p state 0x%X dap %p state 0x%X", - mkdir, mkdir->md_state, diradd, diradd->da_state); - if ((jaddref = mkdir->md_jaddref) != NULL) - db_printf(" jaddref %p jaddref state 0x%X", - jaddref, jaddref->ja_state); - db_printf("\n"); + mkdir_print(mkdir); + if (mkdir->md_diradd != NULL) { + db_printf(" "); + worklist_print(&mkdir->md_diradd->da_list, 0); + } + if (mkdir->md_jaddref != NULL) { + db_printf(" "); + worklist_print(&mkdir->md_jaddref->ja_list, 0); + } } } -/* exported to ffs_vfsops.c */ -extern void db_print_ffs(struct ufsmount *ump); -void -db_print_ffs(struct ufsmount *ump) +DB_SHOW_COMMAND(sd_allocdirect, db_show_sd_allocdirect) { - db_printf("mp %p %s devvp %p fs %p su_wl %d su_deps %d su_req %d\n", - ump->um_mountp, ump->um_mountp->mnt_stat.f_mntonname, - ump->um_devvp, ump->um_fs, ump->softdep_on_worklist, - ump->softdep_deps, ump->softdep_req); + if (have_addr == 0) { + db_printf("allocdirect address required\n"); + return; + } + allocdirect_print((struct allocdirect *)addr); +} + +DB_SHOW_COMMAND(sd_allocindir, db_show_sd_allocindir) +{ + if (have_addr == 0) { + db_printf("allocindir address required\n"); + return; + } + allocindir_print((struct allocindir *)addr); } #endif /* DDB */ From owner-svn-src-head@freebsd.org Sat Jan 26 13:18:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7033814C31B1; Sat, 26 Jan 2019 13:18:09 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5F1282EAE; Sat, 26 Jan 2019 13:18:08 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr1-x443.google.com with SMTP id f7so13085810wrp.1; Sat, 26 Jan 2019 05:18:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=VUiHcPLR3MCTc3GY6F9jVQIO5m/4GKSOLaYmhiJGOLo=; b=u303yaeIVlp7pTBbYeGX6rxiQuVI+D9sFLS7EuNvndz1pPhy/y5BW9GmtuaUNE7Lu/ 5EHWtMqzX16s6YXUxgyCXdBeeC5BtrgY6nNANj0e4UV0jCkaXIZeQBPkPPfJqffjIu4V BkhZlPMCYLMgTmsjEBybqGi3MzBEmlLBSQWya0IpX2nItyFmOCAcVf6jHQH6I7QHUGLQ Osk3Xlb6sqM+DZKDED9K0pytYVnrqT9NwpxZogpQxwmHFK5mUjWCc4F9PLngPtZoIUza 7+ciw/N0J6beB9ltq8CZafdLKCSXTfwVsrD7JkQkWINWf+rnSGbD5tZyIoucbUh8yyRo A+IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=VUiHcPLR3MCTc3GY6F9jVQIO5m/4GKSOLaYmhiJGOLo=; b=ung4g11jSazI/3qWcx7wiCeGjuns58mhK23hR174Tf50a1QUKkTRxS6FL/AyiN3o5S qqSvzKA2o3J6VbB/jhK2iQ9Xlp5C8wrdTugRuE8K9xtlJpZCdeDtvJMHSsgogpOQUPQY 2wx4JwllscyINGbfLwbnmR3IkAoyY11BVPx7XN9CFV4Z34VzQ/T0HndO+ejzFbf5lzkI eh7WQhBBtkUnqT6p3GvHhrgQYs+PQnQYQS93iegOK0h9rWm+MH65JLGanwFiUrGPfYSm J35HhK/6f0jhMbQTThyJkEnXI/eefRLyvvdk6yLTLZq6XNRgxJqOPwMIY3sAHhGvDpfS ksLQ== X-Gm-Message-State: AJcUukfOB35vzq4kOUjwrA2E9f99couxash9CCQI32tjE6Yo3uPbBmQb OUqQfYzTUoo3QzaCOMpu72lgLCYI X-Google-Smtp-Source: ALg8bN5hNH/fycUfznvs37Qqe/xK3O7BTxYKHuKwBW71Bp8T8XxO6RKQb0A91oN+2o2S1ysLkjhAKQ== X-Received: by 2002:a5d:524b:: with SMTP id p11mr14492203wrv.147.1548508687050; Sat, 26 Jan 2019 05:18:07 -0800 (PST) Received: from v2 (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id 133sm73046719wme.9.2019.01.26.05.18.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Jan 2019 05:18:06 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Sat, 26 Jan 2019 13:18:03 +0000 From: Edward Napierala To: Devin Teske Cc: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343440 - head/bin/sh Message-ID: <20190126131803.GA28061@v2> Mail-Followup-To: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> <20190125082851.GA26199@v2> <1F038D39-8869-4220-A274-F6307A4264E2@FreeBSD.org> <20190125091334.GA26545@v2> <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: D5F1282EAE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 13:18:09 -0000 On 0125T1647, Devin Teske wrote: > > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala wrote: > > > > On 0125T1530, Devin Teske wrote: > >> > >> > >>> On Jan 25, 2019, at 12:28 AM, Edward Napierala wrote: > >>> > >>> On 0125T1441, Devin Teske wrote: > >>>> > >>>> > >>>>> On Jan 25, 2019, at 1:37 PM, Edward Napierala wrote: > >>>>> > >>>>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes > >>>>> > napisał(a): > >>>>>> > >>>>>>> Author: trasz > >>>>>>> Date: Fri Jan 25 17:09:26 2019 > >>>>>>> New Revision: 343440 > >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/343440 > >>>>>>> > >>>>>>> Log: > >>>>>>> Comment out the default sh(1) aliases for root, introduced in r343416. > >>>>>>> The rest of this stuff is still to be discussed, but I think at this > >>>>>>> point we have the agreement that the aliases should go. > >>>>>>> > >>>>>>> MFC after: 2 weeks > >>>>>>> Sponsored by: DARPA, AFRL > >>>>>> > >>>>>> Please just revert this and the prior commit out, and when > >>>>>> the path forward is clear commit it. I would not want any of this > >>>>>> merged to 12/ or 11/ until the time that it is all settled. > >>>>> > >>>>> Oops, my bad - neither this nor the previous commit is supposed > >>>>> to be MFC-ed; the "2 weeks" above comes from my default Subversion > >>>>> config. > >>>>> > >>>>> Regarding the backoff - just a few hours ago you said you don't have > >>>>> any problem with this, except for aliases and the default ENV. The > >>>>> aliases problem has been addressed, and you hadn't yet responded > >>>>> to my explanations regarding the ENV. Another committer asked for > >>>>> backoff, because "sh is not an interactive shell", while in fact sh(1) > >>>>> is FreeBSD's default interactive shell except for root. Finally, there's > >>>>> one person who asked for revert, but without giving any reasons > >>>>> whatsoever. > >>>>> > >>>>> So far nobody had proposed any scenario where this would break > >>>>> anything, or even affect existing users. It seems like a typical bikeshed > >>>>> situation. > >>>> > >>>> It is not clear to me after reading r343416 and D18872 what this change is trying to solve. > >>> > >>> The idea is to make it easy to replace the default root shell - which > >>> many people consider broken, due to not supporting basic shell syntax - with > >>> something that actually works. > >> > >> How exactly does changing PS1 or adding 6 aliases fix the "basic shell syntax" which you claim to be unsupported? > >> > >> If the number of aliases added to a shell are a measure of its brokenness, then bash must be hella broken (I have 43 aliases in my bash_profile). > > > > The aliases are gone. > > Fair enough, albeit the topic was r343416 and D18872. > > > > Human-friendly PS1 is considered a standard feature > > nowadays. > > I fail to see how ''$ " is unfriendly. How many people you know use a plain '$' as a shell prompt, because they like it that way? > In fact, I am a bit amiss how you don't see "\u@\h:\w \\$ " as being unfriendly to TCL/Expect. > > While it's certainly possible to use "expect -re" and formulate around it, the change itself would break existing scripts. > > > > > But the way it fixes things is that it makes it easy to replace > > csh with a shell which actually groks shell syntax and is reasonably useful > > out of the box, > > This sounds like you are claiming csh is broken. > > I see where you may be coming from: > > + /bin/sh supports a syntax > + bash supports nearly all of /bin/sh > + zsh supports nearly all of /bin/sh > > So [t]csh must seem broken to you because it doesn't fall inline. > > Being different doesn't mean you are broken. As I have stated previously, I know lots of people that would and do set their login shell to tcsh. > > I personally have both a .tcshrc and a .bash_profile because I use both. I would never consider csh broken because it doesn't "grok shell syntax" -- it in-fact groks its own shell syntax just fine and dandy. I know people who use tcsh, too, but they are a minority of all users. However, this change doesn't do anything for them. > > with ~/.shrc you can customize etc. > > As can ~/.profile But ~/.profile won't work for aliases or the prompt; it's only run for login shells. And our sh(1) doesn't source ~/.shrc by itself, which is confusing to people coming from other systems. > > Think of it as a POLA, > > but horizontally, for folks coming from other systems, instead of the usual > > one. > > POLA can affect multiple people at the same time. > > Someone may be astonished that something is different when coming from anther community, but what if addressing this difference causes a POLA violation for long-standing users. That's true, but I don't think this change would violate POLA for the them. If they don't use sh, they are not affected. If they do, they already have their own config files, and so they are not affected either. > >> Also, the perhaps anecdotal consideration of brokenness is nearly laughable -- these can largely be lumped into one of three categories: > >> > >> a. Considered broken because it doesn't support bashisms > >> b. Considered broken because lack of syntactical knowledge > >> c. Considered broken because (no reason given) > > > > It's broken because it doesn't accept what people call the shell syntax. > > people from Linux? > people you know? > people in articles? > people on twitter? > > I don't have this experience. Users coming from Linux and/or OSX, which I believe are the majority of new users. > > Sure, some folks do realize there used to be something called 'csh', > > and people kept using it even into the nineties. > > That's one perspective. > > I started using tcsh in 2007. > I keep using it today. > I even use it on my Mac. > I also use it on Linux. > I continue to grow my ~/.tcsh file (currently at 410 lines) > > When I use tcsh, I appreciate it for the features that do not exist in any other shell ("repeat N cmd", "|&", etc.) Which is fine. I'm not advocating removing tcsh(1) from base. I'm not even trying to change the default root shell. The change we're discussing does not affect tcsh(1) at all - it only makes it easier for novices to switch to sh(1). > > But most users aren't > > actually that much into computing history; they expect the system to just > > work like they expect. > > > > You can ignore history, but it doesn't change the fact that we still maintain it. > > https://svnweb.freebsd.org/base/head/contrib/tcsh/?view=log > > I'm not into neologisms, but that doesn't mean new things don't stop being created. > > Is the end-goal to make sure that FreeBSD only has shells that are compatible with Linux ones? > > What about the very important matter of offering choice? > > I will digress because this is no longer about .shrc anymore and we should strive to stay on topic. Agreed. > >> Other languages might fit that description as well, and so we should take this anecdote of "many people consider broken" with a grain of salt. > >> > >> I personally have written more than 50,000 lines of shell for the FreeBSD base OS -- all utilizing /bin/sh > > > > And that's one of the reasons why I really apprieciate your response. > > Why thank you. > > I'll give an honest data point that I feel may be illuminating: > > While I consider myself to be proficient in bourne shell (actively rejecting bash, zsh, or other similar shell syntax), I have long been envious of [t]csh's syntax which allows for far fewer lines of code to achieve the same thing. > > Now, I will be the first to admit that csh has its warts (for example, try to throw away stdout but keep stderr through a series of redirects -- this is perhaps the only thing that /bin/sh makes easier than [t]csh), but it is ultimately a shining star for anyone that wants to script their system in a more friendly manner. > > CSH scripts that I have maintained, developed, and had shared with me over the past 15 years have always evoked a sense of respect, consternation, amazement, and humility from me. > > The difference, however, between /bin/sh and [t]csh is more like the differences between perl 5 and perl 6. They are wholly incompatible with each other and (csh being like perl 6) has features that really kick ass (think "grammars" if you're familiar with some of the things that make Perl 6 unique compared to Perl 5). That makes sense - csh(1) was created quite a bit later than sh(1), and since its authors went with a different syntax, they must had a good reason to do so. But my point is - even if csh(1)'s syntax is superior, it didn't catch on. Nowadays the word 'shell' is mostly synonymous with 'Bourne-compatible shell'. > >>>> PS1 should have a reasonable default. If that default is not reasonable, then we should change the C code. > >>>> > >>>> Maybe I see things differently, but I'd rather see PS1 default change so no profile/shrc change is necessary. > >>> > >>> Thank you, that's actually a valid argument. I believe that's also what > >>> bash does. It would be more intrusive, though, and I kind of don't like > >>> the idea of hardcoding things that can easily be dealt with with in a more > >>> "high-level" way. > >>> > >>>> I prefer that sh, in its default configuration, not attempt to read $HOME/.shrc, for security reasons. > >>> > >>> Can you elaborate? It already reads $HOME/.profile; how is $HOME/.shrc > >>> different? > >> > >> If you read "The Cuckoo's Egg" by Clifford Stoll, you'll understand the importance of "one place to exploit versus two." > >> > >> (situation) > >> > >> Say you've been running FreeBSD for 20 years (it turned 25 years old last year, so this is not only possible, but plausible). > >> You know all the areas of interest where an attacker could inject code. > >> You take care to lock down each one. > >> But come to your surprise ... > >> > >> (hypothetical) > >> > >> 6 months after you upgraded from 11.2 to the latest 12.x, you find that you didn't take into account that $HOME/.profile (which you perhaps locked down with a "chflags" command) now branches out to a new file which you've never taken steps to lock down, keep an eye on, or audit (e.g., by using DTrace remote-logging, tripwire, or other means). You only found out 6 months after the upgrade because someone exploited it. At that point, the security event has already occurred. > >> > >> When I worked at "the banks" shit like this was always on our radar. Changes like this were often cited for the reason why one bank moved to BoKs for security. > > > > The change we're discussing doesn't affect upgrades at all - it's only > > for new installs. > > mergemaster, iirc, will merge in changes to etc files after an upgrade. > So this would effect anybody that goes through an upgrade and performs mergemaster. See the sibling mail. > > And it only affects root, for whom the answer to > > 'where an attacker could inject code' question is 'literally everywhere, > > including the firmware'. > > This is not true in many situations. One being in a capsicum env or one where the MAC (TrustedBSD Mandatory Access Control) framework sets limitations. With Capsicum you're not able to execute a shell at all. With MAC... it depends on the policy, but then we don't ship with MAC configured. > > And it doesn't affect root by default, you > > need to change their shell from csh(1) to sh(1). > > By your own commit messages admission, this is for the toor account, so it does affect a user (and as you were keen to point out, users with the default shell). True, but the toor account is locked out by default. [..] > >>>> If you wanted your new shiny default PS1 to actually have an effect in all modes (including privileged mode, where you probably want it), you would have put it in /etc/profile and not in a file that is wholly ignored by some modes (e.g., privileged mode). > >>>> So the solution is not even the right one for the desired result. > >>> > >>> I would, if only it didn't break zsh, and perhaps others. The > >>> problem here is that zsh uses different syntax for PS1, _and_ > >>> it also parses /etc/profile. > >>> > >>> And no, I don't care at all about privileged mode, I can't imagine > >>> a situation when using it would be a good idea. > >>> > >> > >> Rampant hand-waving. > >> > >> OK, that still leaves the fact that a non-static PS1 fucks with TCL/Expect programmers. > > > > True, that's a valid argument. Question is, is the number of FreeBSD > > systems (others already use more complicated PS1 by default) to be deployed > > (the change doesn't affect existing installations) with root shell changed > > to sh(1) (the change doesn't affect situations when sh(1) is not your login > > shell) that have to interface with Expect scripts that can't handle more > > complicated prompts, large enough to actually care? > > We started talking about toor because it has no shell specified in /etc/passwd and therefore uses the default shell (/bin/sh). > > Also, upgrade/mergemaster to me seems like it would affect existing installations. > > Now that I think about it, people using TCL/Expect against the root account would be talking to csh and probably not be effected. > > Is it too late to change my vote? Not at all - from my understanding _the_ contentious part were the aliases, which are now gone. Although I don't really consider it 'voting' - if the commit can actually break some reasonable use-case, it'll get reverted even if there's just a single person reporting it. > Let me sit on this for a few hours. The TCL/Expect argument may be neutralized because -- as you correctly state -- is probably a minority of situations. However, I am still concerned about upgrade/mergemaster. > > Maybe a simple UPDATING entry can be used to address the former concern about corporate secteams needing to be kept informed of this nominal [potential] change. It could work, although UPDATING is for... well, updates, and this is for new installs. From owner-svn-src-head@freebsd.org Sat Jan 26 13:53:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0928514C4091; Sat, 26 Jan 2019 13:53:02 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B4DC841CD; Sat, 26 Jan 2019 13:53:01 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74F3020F4A; Sat, 26 Jan 2019 13:53:01 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QDr1jV066360; Sat, 26 Jan 2019 13:53:01 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QDr1gK066359; Sat, 26 Jan 2019 13:53:01 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201901261353.x0QDr1gK066359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 26 Jan 2019 13:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343470 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 343470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8B4DC841CD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 13:53:02 -0000 Author: oshogbo Date: Sat Jan 26 13:53:00 2019 New Revision: 343470 URL: https://svnweb.freebsd.org/changeset/base/343470 Log: zfs: allow to change cache flush sysctl There is no reason for this variable to be tunable. This variable is used as a barrier in few places. Discussed with: pjd MFC after: 2 weeks Sponsored by: Fudo Security Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sat Jan 26 13:36:06 2019 (r343469) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sat Jan 26 13:53:00 2019 (r343470) @@ -103,7 +103,7 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, zil_replay_disable, CTL * out-of-order write cache is enabled. */ boolean_t zfs_nocacheflush = B_FALSE; -SYSCTL_INT(_vfs_zfs, OID_AUTO, cache_flush_disable, CTLFLAG_RDTUN, +SYSCTL_INT(_vfs_zfs, OID_AUTO, cache_flush_disable, CTLFLAG_RWTUN, &zfs_nocacheflush, 0, "Disable cache flush"); boolean_t zfs_trim_enabled = B_TRUE; SYSCTL_DECL(_vfs_zfs_trim); From owner-svn-src-head@freebsd.org Sat Jan 26 14:10:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8176D14C46FF; Sat, 26 Jan 2019 14:10:50 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 295D384ABC; Sat, 26 Jan 2019 14:10:50 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E0D421128; Sat, 26 Jan 2019 14:10:50 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QEAow4072729; Sat, 26 Jan 2019 14:10:50 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QEAnuG072726; Sat, 26 Jan 2019 14:10:49 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201901261410.x0QEAnuG072726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 26 Jan 2019 14:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343471 - head/lib/libcasper/libcasper X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libcasper/libcasper X-SVN-Commit-Revision: 343471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 295D384ABC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 14:10:50 -0000 Author: oshogbo Date: Sat Jan 26 14:10:49 2019 New Revision: 343471 URL: https://svnweb.freebsd.org/changeset/base/343471 Log: libcasper: do not run registered exit functions Casper library should not use exit(3) function because before setting it up applications may register it. Casper doesn't depend on any registered exit function, so it safe to change this. Reported by: jceel MFC after: 2 weeks Modified: head/lib/libcasper/libcasper/libcasper_service.c head/lib/libcasper/libcasper/service.c head/lib/libcasper/libcasper/zygote.c Modified: head/lib/libcasper/libcasper/libcasper_service.c ============================================================================== --- head/lib/libcasper/libcasper/libcasper_service.c Sat Jan 26 13:53:00 2019 (r343470) +++ head/lib/libcasper/libcasper/libcasper_service.c Sat Jan 26 14:10:49 2019 (r343471) @@ -148,20 +148,20 @@ service_execute(int chanfd) nvl = nvlist_recv(chanfd, 0); if (nvl == NULL) - exit(1); + _exit(1); if (!nvlist_exists_string(nvl, "service")) - exit(1); + _exit(1); servname = nvlist_get_string(nvl, "service"); casserv = service_find(servname); if (casserv == NULL) - exit(1); + _exit(1); service = casserv->cs_service; procfd = nvlist_take_descriptor(nvl, "procfd"); nvlist_destroy(nvl); service_start(service, chanfd, procfd); /* Not reached. */ - exit(1); + _exit(1); } static int @@ -231,7 +231,7 @@ casper_main_loop(int fd) int sock, maxfd, ret; if (zygote_init() < 0) - exit(1); + _exit(1); /* * Register core services. @@ -256,7 +256,7 @@ casper_main_loop(int fd) } if (maxfd == -1) { /* Nothing to do. */ - exit(0); + _exit(0); } maxfd++; @@ -267,7 +267,7 @@ casper_main_loop(int fd) if (ret == -1) { if (errno == EINTR) continue; - exit(1); + _exit(1); } TAILQ_FOREACH(casserv, &casper_services, cs_next) { Modified: head/lib/libcasper/libcasper/service.c ============================================================================== --- head/lib/libcasper/libcasper/service.c Sat Jan 26 13:53:00 2019 (r343470) +++ head/lib/libcasper/libcasper/service.c Sat Jan 26 14:10:49 2019 (r343471) @@ -427,7 +427,7 @@ service_start(struct service *service, int sock, int p service_clean(sock, procfd, service->s_flags); if (service_connection_add(service, sock, NULL) == NULL) - exit(1); + _exit(1); for (;;) { FD_ZERO(&fds); @@ -443,7 +443,7 @@ service_start(struct service *service, int sock, int p nfds = select(maxfd + 1, &fds, NULL, NULL, NULL); if (nfds < 0) { if (errno != EINTR) - exit(1); + _exit(1); continue; } else if (nfds == 0) { /* Timeout. */ @@ -468,5 +468,5 @@ service_start(struct service *service, int sock, int p } } - exit(0); + _exit(0); } Modified: head/lib/libcasper/libcasper/zygote.c ============================================================================== --- head/lib/libcasper/libcasper/zygote.c Sat Jan 26 13:53:00 2019 (r343470) +++ head/lib/libcasper/libcasper/zygote.c Sat Jan 26 14:10:49 2019 (r343471) @@ -122,7 +122,7 @@ zygote_main(int sock) if (nvlin == NULL) { if (errno == ENOTCONN) { /* Casper exited. */ - exit(0); + _exit(0); } continue; } @@ -134,7 +134,7 @@ zygote_main(int sock) func = service_execute; break; default: - exit(0); + _exit(0); } /* @@ -161,7 +161,7 @@ zygote_main(int sock) close(chanfd[0]); func(chanfd[1]); /* NOTREACHED */ - exit(1); + _exit(1); default: /* Parent. */ close(chanfd[1]); From owner-svn-src-head@freebsd.org Sat Jan 26 14:14:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 828AB14C494B; Sat, 26 Jan 2019 14:14:26 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 235B884EA2; Sat, 26 Jan 2019 14:14:26 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1267D212B5; Sat, 26 Jan 2019 14:14:26 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QEEPgb076940; Sat, 26 Jan 2019 14:14:25 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QEEPY3076939; Sat, 26 Jan 2019 14:14:25 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261414.x0QEEPY3076939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 14:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343472 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 343472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 235B884EA2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 14:14:26 -0000 Author: avos Date: Sat Jan 26 14:14:25 2019 New Revision: 343472 URL: https://svnweb.freebsd.org/changeset/base/343472 Log: otus(4): fix a typo in man page (802.11 -> 802.11n) MFC after: 3 days Modified: head/share/man/man4/otus.4 Modified: head/share/man/man4/otus.4 ============================================================================== --- head/share/man/man4/otus.4 Sat Jan 26 14:10:49 2019 (r343471) +++ head/share/man/man4/otus.4 Sat Jan 26 14:14:25 2019 (r343472) @@ -166,4 +166,4 @@ and ported by The .Nm driver only supports 802.11a/b/g operations. -802.11 operation is not supported at this time. +802.11n operation is not supported at this time. From owner-svn-src-head@freebsd.org Sat Jan 26 14:32:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 794BD14C4F22; Sat, 26 Jan 2019 14:32:19 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18B5585920; Sat, 26 Jan 2019 14:32:18 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-oi1-f182.google.com with SMTP id i6so9809773oia.6; Sat, 26 Jan 2019 06:32:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Wi0meghD/NkgnVpQ9y6h17LE9fKS8/3ChmkIF6NGxeM=; b=Z10iVlfe7ujz8UI+TWZnLevrkfqSIGSJPGXtnT/XrfuKxRc+CsUxJ7BiIqKPH4t9Mt O84fb3SDPdMYh3c+ml+ecXpzrIly4vY/EXakoKJmeK0masSoUibY1DVlLiRB2cwJ12S5 i2heT19GgKKvCbo+xW/zuJb9Frt3qCir4z/gM/mSTQWzznkA37M0lZ56tI7OTN34xLwp VN6P3IVpDuQcEp9Zcr7MbwVa89TeIlOJqkZciuQsbsum4Iai2R201ikUwxyTO4GyyDuz 6NKE4UATtAW5OFwahGM7EMWFG4V7REOK+H/kNKTFT1Mumz/PvzCQdyw+fNNxq/c6+51O QUAA== X-Gm-Message-State: AJcUukfT0dRe6Vr+DPu4+9PwNJZX/h7zkfT6dGYjYJUwWJcrx7wG5WI6 CsYU56PtEz93jmFoyyszJRwp7YRsd3HBpuAq9izr/Q== X-Google-Smtp-Source: AHgI3IbaOZzq6yUMrZJyRugdcgX3IxZbSuBESiBeVxEPfUHAsB9v8oWEolOFLclzBD+jAs96IISMxcAAJWGnPKq89po= X-Received: by 2002:aca:1a0b:: with SMTP id a11mr980506oia.154.1548506560960; Sat, 26 Jan 2019 04:42:40 -0800 (PST) MIME-Version: 1.0 References: <20190125095512.GB26744@v2> <201901260137.x0Q1bwDK091299@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201901260137.x0Q1bwDK091299@pdx.rh.CN85.dnsmgr.net> From: Edward Napierala Date: Sat, 26 Jan 2019 12:42:27 +0000 Message-ID: Subject: Re: svn commit: r343440 - head/bin/sh To: rgrimes@freebsd.org Cc: Devin Teske , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 18B5585920 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 14:32:19 -0000 sob., 26 sty 2019 o 01:38 Rodney W. Grimes napisa=C5=82(a): > > > On 0125T1705, Rodney W. Grimes wrote: > > > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala = wrote: > > > > > > Chop with the big axe most of this as I need to clarify a miss statem= ent. > > > ... > > > > > The change we're discussing doesn't affect upgrades at all - it's= only > > > > > for new installs. > > > > > > > > mergemaster, iirc, will merge in changes to etc files after an upgr= ade. > > > > So this would effect anybody that goes through an upgrade and perfo= rms mergemaster. > > > > > > Correct, and to my knowledge there is no way to stop that effect. > > > > Won't happen in this case, this doesn't apply to files in /etc > > at all; it only applies to the default /root/.shrc and /root/.profile > > that get installed on fresh systems. > > mergemaster is the wrong term here, freebsd-update is > going to want to merge this change. Are you sure freebsd-update also updates root's private configuration files? I've never used it, but this seems somewhat surprising. > > > > > And it doesn't affect root by default, you > > > > > need to change their shell from csh(1) to sh(1). > > > > > > > > By your own commit messages admission, this is for the toor account= , so it does affect a user (and as you were keen to point out, users with t= he default shell). > > > > > > Further it effects root any time root types "sh" or "/bin/sh" > > > and intentially invokes sh interactive for some reason, > > > something I do more often than I care to admit simply > > > cause I know what I want to do is much easier in that > > > shell. > > > > It doesn't. For sh(1) to read ~/.shrc (/root/.shrc in this case) > > you need to have ENV set; the default /root/.profile only sets > > it when sh(1) is your login shell. > I do not see any conditional logic in /root/.profile, > what your mis stating is that /root/.profile is not > run for a login shell, so ENV would not be set unless > something else caused /root/.profile to be read, aka > source ~/.profile Correction: /root/.profile is not-run for non-login shell, so ENV wouldn't be set. Yeah, that's what I've meant. > > Which means, this doesn't > > change the behaviour when you casually run "sh" or "/bin/sh" > > as root; sh needs to be set up as login shell for this to take > > effect. > > Again I do not see any conditional logic in /root/.profile > that would make that true. A su - toor would be effected. As opposed to 'su - root' or plain '/bin/sh', right. From owner-svn-src-head@freebsd.org Sat Jan 26 14:54:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A530514C573D; Sat, 26 Jan 2019 14:54:07 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48DF286390; Sat, 26 Jan 2019 14:54:07 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 372E52195A; Sat, 26 Jan 2019 14:54:07 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QEs7NW097957; Sat, 26 Jan 2019 14:54:07 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QEs79G097956; Sat, 26 Jan 2019 14:54:07 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261454.x0QEs79G097956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 14:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343473 - head/sys/geom/uzip X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/geom/uzip X-SVN-Commit-Revision: 343473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48DF286390 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 14:54:07 -0000 Author: avos Date: Sat Jan 26 14:54:06 2019 New Revision: 343473 URL: https://svnweb.freebsd.org/changeset/base/343473 Log: geom_uzip(4): move NULL pointer KASSERT check before it is dereferenced PR: 203499 Submitted by: MFC after: 5 days Modified: head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Sat Jan 26 14:14:25 2019 (r343472) +++ head/sys/geom/uzip/g_uzip.c Sat Jan 26 14:54:06 2019 (r343473) @@ -889,13 +889,13 @@ g_uzip_destroy_geom(struct gctl_req *req, struct g_cla g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, gp->name); g_topology_assert(); + KASSERT(gp != NULL, ("NULL geom")); if (gp->softc == NULL) { DPRINTF(GUZ_DBG_ERR, ("%s(%s): gp->softc == NULL\n", __func__, gp->name)); return (ENXIO); } - KASSERT(gp != NULL, ("NULL geom")); pp = LIST_FIRST(&gp->provider); KASSERT(pp != NULL, ("NULL provider")); if (pp->acr > 0 || pp->acw > 0 || pp->ace > 0) From owner-svn-src-head@freebsd.org Sat Jan 26 16:44:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5599714C897F for ; Sat, 26 Jan 2019 16:44:19 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6905E8A5D7 for ; Sat, 26 Jan 2019 16:44:18 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1548520019; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=fXAZ2kWTaP/nMV5Z6hKk5y26wYPBLPmHQ5++78kWU9RKSLvGglblcsew9qx9kLJceV2tv0U+iMIsh J06w67rDaLZQ99TEbKU+seLkVEoJLamAoFNVZPR9Hkp+z+xHGuLlltrTjcDTrJ8UYHAnEl/bGV5q1Q Mzk3Ev9LDcMlY4Kfs0t9hgNjp86kIWhA1iiARi8uGEutJRwQsBptUkZh0GRMXbzSYIlhV7ixyubhi2 BYT72nx2dxC74rxcnYPt95W9q4vZsiQBtmxIwFC0I4N5Rth0rWsTGKUUyh2SFI0VefypgKupLZExpo Tb0RGFUGAyaA4ILXD0PF66cf/cJj6Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=yvgzqpBK9Xc1LqK/U+w4alis+vsS5Hof4Pa6/9SfoL0=; b=eYgIh0ruF0buTpj+/0YKv9d+MtyqVD2tM+hVXJHgH0QqbKhjcrwzaZgX4exphY2hfUTWg9iajh6CR lLN1in6Afd0aqvFEDSCaPTrFXukxUbZ0X2cYXeE/5mjvnR1leGbssA42an4SPkCCW3lTMfHTlEbrpj C6ScT1b7nsQIyy4EwB/pCPYM5s6SGheesI4xRCTWP57PUGmo+n4+qOorSm6AZH8ldbwgPTuJ6i6sbY NDkEEUUeCiT1iO3mLrZEUnn69MX9ZCTaGmf9TXWWHwwTKyGt8RB3Cn23t3L06YgUFZGUqb9wjhLb9F 7uWZuj5v5HGYsoc9wNyUOnrMFeB/Wwg== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=yvgzqpBK9Xc1LqK/U+w4alis+vsS5Hof4Pa6/9SfoL0=; b=YcCZKNXuDadVuu3spsRuG9hWM/A0Yc4aZgMiSfT5tg7LIn0LVghg8MOW1WUDzdqmR4zAZIhe9Ochz EOLRcAPjRUvTWgQ1861ZduN0FPOJxFYfr6N2oztT+vpD+e77L9cEKALIDkAGVpvOkxhHijX7VNJsq7 +wVScgOvpXwWP4PJ50S7lrsJmWsced8f+VjEv/pctS26qKPuzOCI97eeQXKbyw2BoJfXy78w40Oa6p WaEQx8KmR+8cM3fV8cZU9VxWTh/gMPpQYYkKh9wRRFZvq87OwylO01Qx52/StgAaRAeaK9D1LysQZF aNKlmAxeqwMExX44ke54TkG8NCls8Qg== X-MHO-RoutePath: aGlwcGll X-MHO-User: 32c496ac-2187-11e9-a59a-7b143e15dabc X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 32c496ac-2187-11e9-a59a-7b143e15dabc; Sat, 26 Jan 2019 16:26:57 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x0QGS4pb008606; Sat, 26 Jan 2019 09:28:04 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <311b99b491846d635076d2feb58cf568c15f4154.camel@freebsd.org> Subject: Re: svn commit: r343440 - head/bin/sh From: Ian Lepore To: Edward Napierala , Devin Teske Cc: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 26 Jan 2019 09:28:04 -0700 In-Reply-To: <20190126131803.GA28061@v2> References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> <201901251957.x0PJvdTL089917@pdx.rh.CN85.dnsmgr.net> <20190125082851.GA26199@v2> <1F038D39-8869-4220-A274-F6307A4264E2@FreeBSD.org> <20190125091334.GA26545@v2> <6DD219EC-C898-499E-BF58-AB653A7114DB@FreeBSD.org> <20190126131803.GA28061@v2> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6905E8A5D7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 16:44:19 -0000 On Sat, 2019-01-26 at 13:18 +0000, Edward Napierala wrote: > On 0125T1647, Devin Teske wrote: > > > > > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala > > > wrote: > > > > > > On 0125T1530, Devin Teske wrote: > > > > > > > > > > > > > On Jan 25, 2019, at 12:28 AM, Edward Napierala < > > > > > trasz@freebsd.org> wrote: > > > > > > > > > > On 0125T1441, Devin Teske wrote: > > > > > > > > > > > > > > > > > > > On Jan 25, 2019, at 1:37 PM, Edward Napierala < > > > > > > > trasz@freebsd.org> wrote: > > > > > > > > > > > > > > pt., 25 sty 2019 o 19:57 Rodney W. Grimes > > > > > > > > > > > > > freebsd@pdx.rh.cn85.dnsmgr.net>> napisał(a): > > > > > > > > > > > > > > > > > Author: trasz > > > > > > > > > Date: Fri Jan 25 17:09:26 2019 > > > > > > > > > New Revision: 343440 > > > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/343440 > > > > > > > > > > > > > > > > > > Log: > > > > > > > > > Comment out the default sh(1) aliases for root, > > > > > > > > > introduced in r343416. > > > > > > > > > The rest of this stuff is still to be discussed, but > > > > > > > > > I think at this > > > > > > > > > point we have the agreement that the aliases should > > > > > > > > > go. > > > > > > > > > > > > > > > > > > MFC after: 2 weeks > > > > > > > > > Sponsored by: DARPA, AFRL > > > > > > > > > > > > > > > > Please just revert this and the prior commit out, and > > > > > > > > when > > > > > > > > the path forward is clear commit it. I would not want > > > > > > > > any of this > > > > > > > > merged to 12/ or 11/ until the time that it is all > > > > > > > > settled. > > > > > > > > > > > > > > Oops, my bad - neither this nor the previous commit is > > > > > > > supposed > > > > > > > to be MFC-ed; the "2 weeks" above comes from my default > > > > > > > Subversion > > > > > > > config. > > > > > > > > > > > > > > Regarding the backoff - just a few hours ago you said you > > > > > > > don't have > > > > > > > any problem with this, except for aliases and the default > > > > > > > ENV. The > > > > > > > aliases problem has been addressed, and you hadn't yet > > > > > > > responded > > > > > > > to my explanations regarding the ENV. Another committer > > > > > > > asked for > > > > > > > backoff, because "sh is not an interactive shell", while > > > > > > > in fact sh(1) > > > > > > > is FreeBSD's default interactive shell except for > > > > > > > root. Finally, there's > > > > > > > one person who asked for revert, but without giving any > > > > > > > reasons > > > > > > > whatsoever. > > > > > > > > > > > > > > So far nobody had proposed any scenario where this would > > > > > > > break > > > > > > > anything, or even affect existing users. It seems like a > > > > > > > typical bikeshed > > > > > > > situation. > > > > > > > > > > > > It is not clear to me after reading r343416 and D18872 what > > > > > > this change is trying to solve. > > > > > > > > > > The idea is to make it easy to replace the default root shell > > > > > - which > > > > > many people consider broken, due to not supporting basic > > > > > shell syntax - with > > > > > something that actually works. > > > > > > > > How exactly does changing PS1 or adding 6 aliases fix the > > > > "basic shell syntax" which you claim to be unsupported? > > > > > > > > If the number of aliases added to a shell are a measure of its > > > > brokenness, then bash must be hella broken (I have 43 aliases > > > > in my bash_profile). > > > > > > The aliases are gone. > > > > Fair enough, albeit the topic was r343416 and D18872. > > > > > > > Human-friendly PS1 is considered a standard feature > > > nowadays. > > > > I fail to see how ''$ " is unfriendly. > > How many people you know use a plain '$' as a shell prompt, > because they like it that way? > > > In fact, I am a bit amiss how you don't see "\u@\h:\w \\$ " as > > being unfriendly to TCL/Expect. > > > > While it's certainly possible to use "expect -re" and formulate > > around it, the change itself would break existing scripts. > > > > > > > > > But the way it fixes things is that it makes it easy to replace > > > csh with a shell which actually groks shell syntax and is > > > reasonably useful > > > out of the box, > > > > This sounds like you are claiming csh is broken. > > > > I see where you may be coming from: > > > > + /bin/sh supports a syntax > > + bash supports nearly all of /bin/sh > > + zsh supports nearly all of /bin/sh > > > > So [t]csh must seem broken to you because it doesn't fall inline. > > > > Being different doesn't mean you are broken. As I have stated > > previously, I know lots of people that would and do set their login > > shell to tcsh. > > > > I personally have both a .tcshrc and a .bash_profile because I use > > both. I would never consider csh broken because it doesn't "grok > > shell syntax" -- it in-fact groks its own shell syntax just fine > > and dandy. > > I know people who use tcsh, too, but they are a minority of all > users. > However, this change doesn't do anything for them. > > > > with ~/.shrc you can customize etc. > > > > As can ~/.profile > > But ~/.profile won't work for aliases or the prompt; it's only run > for login shells. And our sh(1) doesn't source ~/.shrc by itself, > which is confusing to people coming from other systems. > > > > Think of it as a POLA, > > > but horizontally, for folks coming from other systems, instead of > > > the usual > > > one. > > > > POLA can affect multiple people at the same time. > > > > Someone may be astonished that something is different when coming > > from anther community, but what if addressing this difference > > causes a POLA violation for long-standing users. > > That's true, but I don't think this change would violate POLA for the > them. > If they don't use sh, they are not affected. If they do, they > already have > their own config files, and so they are not affected either. > > > > > Also, the perhaps anecdotal consideration of brokenness is > > > > nearly laughable -- these can largely be lumped into one of > > > > three categories: > > > > > > > > a. Considered broken because it doesn't support bashisms > > > > b. Considered broken because lack of syntactical knowledge > > > > c. Considered broken because (no reason given) > > > > > > It's broken because it doesn't accept what people call the shell > > > syntax. > > > > people from Linux? > > people you know? > > people in articles? > > people on twitter? > > > > I don't have this experience. > > Users coming from Linux and/or OSX, which I believe are the majority > of new users. > > > > Sure, some folks do realize there used to be something called > > > 'csh', > > > and people kept using it even into the nineties. > > > > That's one perspective. > > > > I started using tcsh in 2007. > > I keep using it today. > > I even use it on my Mac. > > I also use it on Linux. > > I continue to grow my ~/.tcsh file (currently at 410 lines) > > > > When I use tcsh, I appreciate it for the features that do not exist > > in any other shell ("repeat N cmd", "|&", etc.) > > Which is fine. I'm not advocating removing tcsh(1) from base. I'm > not > even trying to change the default root shell. The change we're > discussing > does not affect tcsh(1) at all - it only makes it easier for novices > to > switch to sh(1). > > > > But most users aren't > > > actually that much into computing history; they expect the system > > > to just > > > work like they expect. > > > > > > > You can ignore history, but it doesn't change the fact that we > > still maintain it. > > > > https://svnweb.freebsd.org/base/head/contrib/tcsh/?view=log < > > https://svnweb.freebsd.org/base/head/contrib/tcsh/?view=log> > > > > I'm not into neologisms, but that doesn't mean new things don't > > stop being created. > > > > Is the end-goal to make sure that FreeBSD only has shells that are > > compatible with Linux ones? > > > > What about the very important matter of offering choice? > > > > I will digress because this is no longer about .shrc anymore and we > > should strive to stay on topic. > > Agreed. > > > > > Other languages might fit that description as well, and so we > > > > should take this anecdote of "many people consider broken" with > > > > a grain of salt. > > > > > > > > I personally have written more than 50,000 lines of shell for > > > > the FreeBSD base OS -- all utilizing /bin/sh > > > > > > And that's one of the reasons why I really apprieciate your > > > response. > > > > Why thank you. > > > > I'll give an honest data point that I feel may be illuminating: > > > > While I consider myself to be proficient in bourne shell (actively > > rejecting bash, zsh, or other similar shell syntax), I have long > > been envious of [t]csh's syntax which allows for far fewer lines of > > code to achieve the same thing. > > > > Now, I will be the first to admit that csh has its warts (for > > example, try to throw away stdout but keep stderr through a series > > of redirects -- this is perhaps the only thing that /bin/sh makes > > easier than [t]csh), but it is ultimately a shining star for anyone > > that wants to script their system in a more friendly manner. > > > > CSH scripts that I have maintained, developed, and had shared with > > me over the past 15 years have always evoked a sense of respect, > > consternation, amazement, and humility from me. > > > > The difference, however, between /bin/sh and [t]csh is more like > > the differences between perl 5 and perl 6. They are wholly > > incompatible with each other and (csh being like perl 6) has > > features that really kick ass (think "grammars" if you're familiar > > with some of the things that make Perl 6 unique compared to Perl > > 5). > > That makes sense - csh(1) was created quite a bit later than sh(1), > and since > its authors went with a different syntax, they must had a good reason > to do so. > > But my point is - even if csh(1)'s syntax is superior, it didn't > catch on. > Nowadays the word 'shell' is mostly synonymous with 'Bourne- > compatible shell'. > > > > > > > PS1 should have a reasonable default. If that default is > > > > > > not reasonable, then we should change the C code. > > > > > > > > > > > > Maybe I see things differently, but I'd rather see PS1 > > > > > > default change so no profile/shrc change is necessary. > > > > > > > > > > Thank you, that's actually a valid argument. I believe > > > > > that's also what > > > > > bash does. It would be more intrusive, though, and I kind of > > > > > don't like > > > > > the idea of hardcoding things that can easily be dealt with > > > > > with in a more > > > > > "high-level" way. > > > > > > > > > > > I prefer that sh, in its default configuration, not attempt > > > > > > to read $HOME/.shrc, for security reasons. > > > > > > > > > > Can you elaborate? It already reads $HOME/.profile; how is > > > > > $HOME/.shrc > > > > > different? > > > > > > > > If you read "The Cuckoo's Egg" by Clifford Stoll, you'll > > > > understand the importance of "one place to exploit versus two." > > > > > > > > (situation) > > > > > > > > Say you've been running FreeBSD for 20 years (it turned 25 > > > > years old last year, so this is not only possible, but > > > > plausible). > > > > You know all the areas of interest where an attacker could > > > > inject code. > > > > You take care to lock down each one. > > > > But come to your surprise ... > > > > > > > > (hypothetical) > > > > > > > > 6 months after you upgraded from 11.2 to the latest 12.x, you > > > > find that you didn't take into account that $HOME/.profile > > > > (which you perhaps locked down with a "chflags" command) now > > > > branches out to a new file which you've never taken steps to > > > > lock down, keep an eye on, or audit (e.g., by using DTrace > > > > remote-logging, tripwire, or other means). You only found out 6 > > > > months after the upgrade because someone exploited it. At that > > > > point, the security event has already occurred. > > > > > > > > When I worked at "the banks" shit like this was always on our > > > > radar. Changes like this were often cited for the reason why > > > > one bank moved to BoKs for security. > > > > > > The change we're discussing doesn't affect upgrades at all - it's > > > only > > > for new installs. > > > > mergemaster, iirc, will merge in changes to etc files after an > > upgrade. > > So this would effect anybody that goes through an upgrade and > > performs mergemaster. > > See the sibling mail. > > > > And it only affects root, for whom the answer to > > > 'where an attacker could inject code' question is 'literally > > > everywhere, > > > including the firmware'. > > > > This is not true in many situations. One being in a capsicum env or > > one where the MAC (TrustedBSD Mandatory Access Control) framework > > sets limitations. > > With Capsicum you're not able to execute a shell at all. With MAC... > it depends on the policy, but then we don't ship with MAC configured. > > > > And it doesn't affect root by default, you > > > need to change their shell from csh(1) to sh(1). > > > > By your own commit messages admission, this is for the toor > > account, so it does affect a user (and as you were keen to point > > out, users with the default shell). > > True, but the toor account is locked out by default. > > [..] > > > > > > > If you wanted your new shiny default PS1 to actually have > > > > > > an effect in all modes (including privileged mode, where > > > > > > you probably want it), you would have put it in > > > > > > /etc/profile and not in a file that is wholly ignored by > > > > > > some modes (e.g., privileged mode). > > > > > > So the solution is not even the right one for the desired > > > > > > result. > > > > > > > > > > I would, if only it didn't break zsh, and perhaps > > > > > others. The > > > > > problem here is that zsh uses different syntax for PS1, _and_ > > > > > it also parses /etc/profile. > > > > > > > > > > And no, I don't care at all about privileged mode, I can't > > > > > imagine > > > > > a situation when using it would be a good idea. > > > > > > > > > > > > > Rampant hand-waving. > > > > > > > > OK, that still leaves the fact that a non-static PS1 fucks with > > > > TCL/Expect programmers. > > > > > > True, that's a valid argument. Question is, is the number of > > > FreeBSD > > > systems (others already use more complicated PS1 by default) to > > > be deployed > > > (the change doesn't affect existing installations) with root > > > shell changed > > > to sh(1) (the change doesn't affect situations when sh(1) is not > > > your login > > > shell) that have to interface with Expect scripts that can't > > > handle more > > > complicated prompts, large enough to actually care? > > > > We started talking about toor because it has no shell specified in > > /etc/passwd and therefore uses the default shell (/bin/sh). > > > > Also, upgrade/mergemaster to me seems like it would affect existing > > installations. > > > > Now that I think about it, people using TCL/Expect against the root > > account would be talking to csh and probably not be effected. > > > > Is it too late to change my vote? > > Not at all - from my understanding _the_ contentious part were the > aliases, > which are now gone. Although I don't really consider it 'voting' - > if the > commit can actually break some reasonable use-case, it'll get > reverted even > if there's just a single person reporting it. > No, it's not just the aliases. The part that angers me the most is the changing of PS1. I still haven't seen anything that justifies any of these changes other than your opinion that you like your changes better than what was there before. -- Ian > > Let me sit on this for a few hours. The TCL/Expect argument may be > > neutralized because -- as you correctly state -- is probably a > > minority of situations. However, I am still concerned about > > upgrade/mergemaster. > > > > Maybe a simple UPDATING entry can be used to address the former > > concern about corporate secteams needing to be kept informed of > > this nominal [potential] change. > > It could work, although UPDATING is for... well, updates, and this is > for > new installs. > > From owner-svn-src-head@freebsd.org Sat Jan 26 17:00:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C2E714A634B; Sat, 26 Jan 2019 17:00:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31F858AFD6; Sat, 26 Jan 2019 17:00:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DB3622E2B; Sat, 26 Jan 2019 17:00:59 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QH0weE063478; Sat, 26 Jan 2019 17:00:58 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QH0tJH063461; Sat, 26 Jan 2019 17:00:55 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261700.x0QH0tJH063461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 17:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343474 - in head/sys: dev/bwi dev/iwi dev/ral dev/rtwn dev/usb/wlan net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys: dev/bwi dev/iwi dev/ral dev/rtwn dev/usb/wlan net80211 X-SVN-Commit-Revision: 343474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31F858AFD6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 17:00:59 -0000 Author: avos Date: Sat Jan 26 17:00:55 2019 New Revision: 343474 URL: https://svnweb.freebsd.org/changeset/base/343474 Log: Remove 2GHz channel list copies from wireless drivers. Wrap ieee80211_add_channel_list_2ghz into another function which supplies default (1-14) channel list to it and drop its copies from drivers. Checked with RTL8188EE, country US / JP / KR / UA. MFC after: 2 weeks Modified: head/sys/dev/bwi/if_bwi.c head/sys/dev/iwi/if_iwi.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/ral/rt2860.c head/sys/dev/rtwn/if_rtwn.c head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_runreg.h head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_zyd.c head/sys/dev/usb/wlan/if_zydreg.h head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_var.h Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/bwi/if_bwi.c Sat Jan 26 17:00:55 2019 (r343474) @@ -307,9 +307,6 @@ static const struct { [108] = { 7, 3 } }; -static const uint8_t bwi_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - #ifdef BWI_DEBUG #ifdef BWI_DEBUG_VERBOSE static uint32_t bwi_debug = BWI_DBG_ATTACH | BWI_DBG_INIT | BWI_DBG_TXPOWER; @@ -1715,8 +1712,7 @@ bwi_getradiocaps(struct ieee80211com *ic, panic("unknown phymode %d\n", phy->phy_mode); } - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - bwi_chan_2ghz, nitems(bwi_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); } static void Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/iwi/if_iwi.c Sat Jan 26 17:00:55 2019 (r343474) @@ -132,8 +132,6 @@ static const struct iwi_ident iwi_ident_table[] = { { 0, 0, NULL } }; -static const uint8_t def_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; static const uint8_t def_chan_5ghz_band1[] = { 36, 40, 44, 48, 52, 56, 60, 64 }; static const uint8_t def_chan_5ghz_band2[] = @@ -3604,8 +3602,8 @@ iwi_getradiocaps(struct ieee80211com *ic, iwi_collect_bands(ic, bands, sizeof(bands)); *nchans = 0; if (isset(bands, IEEE80211_MODE_11B) || isset(bands, IEEE80211_MODE_11G)) - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - def_chan_2ghz, nitems(def_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, + bands, 0); if (isset(bands, IEEE80211_MODE_11A)) { ieee80211_add_channel_list_5ghz(chans, maxchans, nchans, def_chan_5ghz_band1, nitems(def_chan_5ghz_band1), Modified: head/sys/dev/ral/rt2560.c ============================================================================== --- head/sys/dev/ral/rt2560.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/ral/rt2560.c Sat Jan 26 17:00:55 2019 (r343474) @@ -189,9 +189,6 @@ static const uint32_t rt2560_rf2525e_r2[] = RT2560_R static const uint32_t rt2560_rf2526_r2[] = RT2560_RF2526_R2; static const uint32_t rt2560_rf2526_hi_r2[] = RT2560_RF2526_HI_R2; -static const uint8_t rt2560_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - static const uint8_t rt2560_chan_5ghz[] = { 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, @@ -2137,8 +2134,7 @@ rt2560_getradiocaps(struct ieee80211com *ic, memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - rt2560_chan_2ghz, nitems(rt2560_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); if (sc->rf_rev == RT2560_RF_5222) { setbit(bands, IEEE80211_MODE_11A); Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/ral/rt2661.c Sat Jan 26 17:00:55 2019 (r343474) @@ -195,8 +195,6 @@ static const struct rfprog { RT2661_RF5225_2 }; -static const uint8_t rt2661_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; static const uint8_t rt2661_chan_5ghz[] = { 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, @@ -2757,8 +2755,7 @@ rt2661_getradiocaps(struct ieee80211com *ic, memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - rt2661_chan_2ghz, nitems(rt2661_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); if (sc->rf_rev == RT2661_RF_5225 || sc->rf_rev == RT2661_RF_5325) { setbit(bands, IEEE80211_MODE_11A); Modified: head/sys/dev/ral/rt2860.c ============================================================================== --- head/sys/dev/ral/rt2860.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/ral/rt2860.c Sat Jan 26 17:00:55 2019 (r343474) @@ -228,8 +228,6 @@ static const struct { RT5392_DEF_RF }; -static const uint8_t rt2860_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; static const uint8_t rt2860_chan_5ghz[] = { 36, 38, 40, 44, 46, 48, 52, 54, 56, 60, 62, 64, 100, 102, 104, 108, 110, 112, 116, 118, 120, 124, 126, 128, 132, 134, 136, 140, @@ -2310,8 +2308,7 @@ rt2860_getradiocaps(struct ieee80211com *ic, int maxch memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - rt2860_chan_2ghz, nitems(rt2860_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); if (sc->rf_rev == RT2860_RF_2750 || sc->rf_rev == RT2860_RF_2850) { setbit(bands, IEEE80211_MODE_11A); Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/rtwn/if_rtwn.c Sat Jan 26 17:00:55 2019 (r343474) @@ -153,9 +153,6 @@ static void rtwn_stop(struct rtwn_softc *); MALLOC_DEFINE(M_RTWN_PRIV, "rtwn_priv", "rtwn driver private state"); -static const uint8_t rtwn_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - static const uint16_t wme2reg[] = { R92C_EDCA_BE_PARAM, R92C_EDCA_BK_PARAM, R92C_EDCA_VI_PARAM, R92C_EDCA_VO_PARAM }; @@ -1534,9 +1531,8 @@ rtwn_getradiocaps(struct ieee80211com *ic, setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); setbit(bands, IEEE80211_MODE_11NG); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - rtwn_chan_2ghz, nitems(rtwn_chan_2ghz), bands, - !!(ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40)); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, + bands, !!(ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40)); /* XXX workaround add_channel_list() limitations */ setbit(bands, IEEE80211_MODE_11A); Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/usb/wlan/if_rsu.c Sat Jan 26 17:00:55 2019 (r343474) @@ -286,9 +286,6 @@ MODULE_DEPEND(rsu, firmware, 1, 1, 1); MODULE_VERSION(rsu, 1); USB_PNP_HOST_INFO(rsu_devs); -static const uint8_t rsu_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - static uint8_t rsu_wme_ac_xfer_map[4] = { [WME_AC_BE] = RSU_BULK_TX_BE_BK, [WME_AC_BK] = RSU_BULK_TX_BE_BK, @@ -784,9 +781,8 @@ rsu_getradiocaps(struct ieee80211com *ic, setbit(bands, IEEE80211_MODE_11G); if (sc->sc_ht) setbit(bands, IEEE80211_MODE_11NG); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - rsu_chan_2ghz, nitems(rsu_chan_2ghz), bands, - (ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) != 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, + bands, (ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) != 0); } static void Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/usb/wlan/if_rum.c Sat Jan 26 17:00:55 2019 (r343474) @@ -342,9 +342,6 @@ static const struct { { 107, 0x04 } }; -static const uint8_t rum_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - static const uint8_t rum_chan_5ghz[] = { 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, @@ -3220,8 +3217,7 @@ rum_getradiocaps(struct ieee80211com *ic, memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - rum_chan_2ghz, nitems(rum_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); if (sc->rf_rev == RT2573_RF_5225 || sc->rf_rev == RT2573_RF_5226) { setbit(bands, IEEE80211_MODE_11A); Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/usb/wlan/if_run.c Sat Jan 26 17:00:55 2019 (r343474) @@ -4859,8 +4859,7 @@ run_getradiocaps(struct ieee80211com *ic, memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - run_chan_2ghz, nitems(run_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); if (sc->rf_rev == RT2860_RF_2750 || sc->rf_rev == RT2860_RF_2850 || sc->rf_rev == RT3070_RF_3052 || sc->rf_rev == RT3593_RF_3053 || Modified: head/sys/dev/usb/wlan/if_runreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_runreg.h Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/usb/wlan/if_runreg.h Sat Jan 26 17:00:55 2019 (r343474) @@ -1086,9 +1086,6 @@ struct rt2860_rxwi { /* * Channel map for run(4) driver; taken from the table below. */ -static const uint8_t run_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - static const uint8_t run_chan_5ghz[] = { 36, 38, 40, 44, 46, 48, 52, 54, 56, 60, 62, 64, 100, 102, 104, 108, 110, 112, 116, 118, 120, 124, 126, 128, 132, 134, 136, 140, Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/usb/wlan/if_ural.c Sat Jan 26 17:00:55 2019 (r343474) @@ -361,9 +361,6 @@ static const struct { { 161, 0x08808, 0x0242f, 0x00281 } }; -static const uint8_t ural_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - static const uint8_t ural_chan_5ghz[] = { 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, @@ -1591,8 +1588,7 @@ ural_getradiocaps(struct ieee80211com *ic, memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - ural_chan_2ghz, nitems(ural_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); if (sc->rf_rev == RAL_RF_5222) { setbit(bands, IEEE80211_MODE_11A); Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/usb/wlan/if_urtw.c Sat Jan 26 17:00:55 2019 (r343474) @@ -215,9 +215,6 @@ static uint8_t urtw_8225z2_agc[] = { 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31 }; -static const uint8_t urtw_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - static uint32_t urtw_8225_channel[] = { 0x0000, /* dummy channel 0 */ 0x085c, /* 1 */ @@ -1585,8 +1582,7 @@ urtw_getradiocaps(struct ieee80211com *ic, memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - urtw_chan_2ghz, nitems(urtw_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); } static void Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/usb/wlan/if_zyd.c Sat Jan 26 17:00:55 2019 (r343474) @@ -2889,8 +2889,7 @@ zyd_getradiocaps(struct ieee80211com *ic, memset(bands, 0, sizeof(bands)); setbit(bands, IEEE80211_MODE_11B); setbit(bands, IEEE80211_MODE_11G); - ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, - zyd_chan_2ghz, nitems(zyd_chan_2ghz), bands, 0); + ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0); } static void Modified: head/sys/dev/usb/wlan/if_zydreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_zydreg.h Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/dev/usb/wlan/if_zydreg.h Sat Jan 26 17:00:55 2019 (r343474) @@ -421,10 +421,6 @@ #define ZYD_CR254 0x93f8 #define ZYD_CR255 0x93fc -/* nitems(ZYD_*_CHANTABLE) */ -static const uint8_t zyd_chan_2ghz[] = - { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; - /* copied nearly verbatim from the Linux driver rewrite */ #define ZYD_DEF_PHY \ { \ Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/net80211/ieee80211.c Sat Jan 26 17:00:55 2019 (r343474) @@ -1632,6 +1632,17 @@ ieee80211_add_channel_list_2ghz(struct ieee80211_chann } int +ieee80211_add_channels_default_2ghz(struct ieee80211_channel chans[], + int maxchans, int *nchans, const uint8_t bands[], int ht40) +{ + const uint8_t default_chan_list[] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; + + return (ieee80211_add_channel_list_2ghz(chans, maxchans, nchans, + default_chan_list, nitems(default_chan_list), bands, ht40)); +} + +int ieee80211_add_channel_list_5ghz(struct ieee80211_channel chans[], int maxchans, int *nchans, const uint8_t ieee[], int nieee, const uint8_t bands[], int ht40) Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sat Jan 26 14:54:06 2019 (r343473) +++ head/sys/net80211/ieee80211_var.h Sat Jan 26 17:00:55 2019 (r343474) @@ -734,6 +734,8 @@ uint32_t ieee80211_get_channel_center_freq1(const stru uint32_t ieee80211_get_channel_center_freq2(const struct ieee80211_channel *); int ieee80211_add_channel_list_2ghz(struct ieee80211_channel[], int, int *, const uint8_t[], int, const uint8_t[], int); +int ieee80211_add_channels_default_2ghz(struct ieee80211_channel[], int, + int *, const uint8_t[], int); int ieee80211_add_channel_list_5ghz(struct ieee80211_channel[], int, int *, const uint8_t[], int, const uint8_t[], int); struct ieee80211_channel *ieee80211_find_channel(struct ieee80211com *, From owner-svn-src-head@freebsd.org Sat Jan 26 17:17:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F22E14A70AD; Sat, 26 Jan 2019 17:17:26 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA4C98BB3F; Sat, 26 Jan 2019 17:17:25 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEFE923173; Sat, 26 Jan 2019 17:17:25 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QHHP6u072280; Sat, 26 Jan 2019 17:17:25 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QHHPFd072279; Sat, 26 Jan 2019 17:17:25 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261717.x0QHHPFd072279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 17:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343475 - head/sys/geom/uzip X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/geom/uzip X-SVN-Commit-Revision: 343475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA4C98BB3F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 17:17:26 -0000 Author: avos Date: Sat Jan 26 17:17:25 2019 New Revision: 343475 URL: https://svnweb.freebsd.org/changeset/base/343475 Log: geom_uzip(4): set 'gp != NULL' assertion on top of the function There was yet another access to this variable in g_trace() few lines upper. PR: 203499 Reported by: cem MFC after: 5 days MFC with: 343473 Modified: head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Sat Jan 26 17:00:55 2019 (r343474) +++ head/sys/geom/uzip/g_uzip.c Sat Jan 26 17:17:25 2019 (r343475) @@ -886,10 +886,10 @@ g_uzip_destroy_geom(struct gctl_req *req, struct g_cla { struct g_provider *pp; + KASSERT(gp != NULL, ("NULL geom")); g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, gp->name); g_topology_assert(); - KASSERT(gp != NULL, ("NULL geom")); if (gp->softc == NULL) { DPRINTF(GUZ_DBG_ERR, ("%s(%s): gp->softc == NULL\n", __func__, gp->name)); From owner-svn-src-head@freebsd.org Sat Jan 26 17:17:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17BC114A70DE; Sat, 26 Jan 2019 17:17:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08CB38BC2A; Sat, 26 Jan 2019 17:17:36 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0QHHXme094484; Sat, 26 Jan 2019 09:17:33 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0QHHXCC094483; Sat, 26 Jan 2019 09:17:33 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901261717.x0QHHXCC094483@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343440 - head/bin/sh In-Reply-To: <311b99b491846d635076d2feb58cf568c15f4154.camel@freebsd.org> To: Ian Lepore Date: Sat, 26 Jan 2019 09:17:33 -0800 (PST) CC: Edward Napierala , Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 08CB38BC2A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 17:17:38 -0000 > On Sat, 2019-01-26 at 13:18 +0000, Edward Napierala wrote: > > On 0125T1647, Devin Teske wrote: > > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala > > > > wrote: > > > > On 0125T1530, Devin Teske wrote: > > > > > > On Jan 25, 2019, at 12:28 AM, Edward Napierala < > > > > > > trasz@freebsd.org> wrote: > > > > > > On 0125T1441, Devin Teske wrote: > > > > > > > > On Jan 25, 2019, at 1:37 PM, Edward Napierala < > > > > > > > > trasz@freebsd.org> wrote: > > > > > > > > pt., 25 sty 2019 o 19:57 Rodney W. Grimes > > > > > > > > > > > > > > > freebsd@pdx.rh.cn85.dnsmgr.net>> napisa?(a): ... > > > > No, it's not just the aliases. The part that angers me the most is the > changing of PS1. I still haven't seen anything that justifies any of > these changes other than your opinion that you like your changes better > than what was there before. I have asked once in public, and once in private in not such a polite tone (Uncalled for, sorry Traz) that this be reverted. This discussion has gone on far too long on -committers and this change is clearly controversial. Ian, Please assert a request to revert as well, as it seems Traz is stuck in the "this is just a bikeshed" and is not going to move on my request alone, though it was also asserted by Devin. Thanks, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Jan 26 17:23:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36CA014A74CA; Sat, 26 Jan 2019 17:23:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C2B98C163; Sat, 26 Jan 2019 17:23:37 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0QHNZmu094527; Sat, 26 Jan 2019 09:23:35 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0QHNZur094526; Sat, 26 Jan 2019 09:23:35 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901261723.x0QHNZur094526@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343440 - head/bin/sh In-Reply-To: <20190126131803.GA28061@v2> To: Edward Napierala Date: Sat, 26 Jan 2019 09:23:35 -0800 (PST) CC: Devin Teske , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 8C2B98C163 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 17:23:38 -0000 > On 0125T1647, Devin Teske wrote: > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala wrote: > > > On 0125T1530, Devin Teske wrote: > > >>> On Jan 25, 2019, at 12:28 AM, Edward Napierala wrote: > > >>> On 0125T1441, Devin Teske wrote: > > >>>>> On Jan 25, 2019, at 1:37 PM, Edward Napierala wrote: > > >>>>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes > > >>>>> > napisa?(a): > > >>>>>>> Author: trasz > > >>>>>>> Date: Fri Jan 25 17:09:26 2019 > > >>>>>>> New Revision: 343440 > > >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/343440 > > >>>>>>> > > >>>>>>> Log: > > >>>>>>> Comment out the default sh(1) aliases for root, introduced in r343416. > > >>>>>>> The rest of this stuff is still to be discussed, but I think at this > > >>>>>>> point we have the agreement that the aliases should go. > > >>>>>>> > > >>>>>>> MFC after: 2 weeks > > >>>>>>> Sponsored by: DARPA, AFRL > > >>>>>> > > >>>>>> Please just revert this and the prior commit out, and when > > >>>>>> the path forward is clear commit it. I would not want any of this > > >>>>>> merged to 12/ or 11/ until the time that it is all settled. > > >>>>> > > >>>>> Oops, my bad - neither this nor the previous commit is supposed > > >>>>> to be MFC-ed; the "2 weeks" above comes from my default Subversion > > >>>>> config. > > >>>>> > > >>>>> Regarding the backoff - just a few hours ago you said you don't have > > >>>>> any problem with this, except for aliases and the default ENV. The > > >>>>> aliases problem has been addressed, and you hadn't yet responded > > >>>>> to my explanations regarding the ENV. Another committer asked for > > >>>>> backoff, because "sh is not an interactive shell", while in fact sh(1) > > >>>>> is FreeBSD's default interactive shell except for root. Finally, there's > > >>>>> one person who asked for revert, but without giving any reasons > > >>>>> whatsoever. > > >>>>> > > >>>>> So far nobody had proposed any scenario where this would break > > >>>>> anything, or even affect existing users. It seems like a typical bikeshed > > >>>>> situation. > > >>>> > > >>>> It is not clear to me after reading r343416 and D18872 what this change is trying to solve. > > >>> > > >>> The idea is to make it easy to replace the default root shell - which > > >>> many people consider broken, due to not supporting basic shell syntax - with > > >>> something that actually works. > > >> > > >> How exactly does changing PS1 or adding 6 aliases fix the "basic shell syntax" which you claim to be unsupported? > > >> > > >> If the number of aliases added to a shell are a measure of its brokenness, then bash must be hella broken (I have 43 aliases in my bash_profile). > > > > > > The aliases are gone. > > > > Fair enough, albeit the topic was r343416 and D18872. > > > > > > > Human-friendly PS1 is considered a standard feature > > > nowadays. > > > > I fail to see how ''$ " is unfriendly. > > How many people you know use a plain '$' as a shell prompt, > because they like it that way? I am prefectly happy with any single character prompt on any OS I might happen to be working on, knowing that I can change it at my leasure. However I am NOT happy with a stringy long ass prompt that eats up half my command line when I am deep down a file hierarchy trying to fix some problem at a single user prompt on a hardwired conssole I had to jack into the box cause it wont come up. Yes I can change either at will, and so can anyone else who wants to, lets stop spoon feeding a new default and spoon feed up some docs on "you may want to tweak this" after you have installed. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Jan 26 17:27:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2A9C14A7647; Sat, 26 Jan 2019 17:27:13 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B91E8C38B; Sat, 26 Jan 2019 17:27:13 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60D0523349; Sat, 26 Jan 2019 17:27:13 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QHRDBW077657; Sat, 26 Jan 2019 17:27:13 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QHRDbR077656; Sat, 26 Jan 2019 17:27:13 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901261727.x0QHRDbR077656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 26 Jan 2019 17:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343476 - head X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 343476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B91E8C38B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 17:27:13 -0000 Author: avos Date: Sat Jan 26 17:27:12 2019 New Revision: 343476 URL: https://svnweb.freebsd.org/changeset/base/343476 Log: ObsoleteFiles.inc: remove adv(4) / adw(4) man pages after r339567 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Jan 26 17:17:25 2019 (r343475) +++ head/ObsoleteFiles.inc Sat Jan 26 17:27:12 2019 (r343476) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20190126: adv(4) / adw(4) removal +OLD_FILES+=usr/share/man/man4/adv.4.gz +OLD_FILES+=usr/share/man/man4/adw.4.gz # 20190114: old pbuf allocator removed OLD_FILES+=usr/share/man/man9/pbuf.9.gz # 20181219: ibcs removal From owner-svn-src-head@freebsd.org Sat Jan 26 17:52:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5F2314A820C; Sat, 26 Jan 2019 17:52:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A5AD8D16A; Sat, 26 Jan 2019 17:52:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 479AB2384B; Sat, 26 Jan 2019 17:52:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QHqDD1093074; Sat, 26 Jan 2019 17:52:13 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QHqDDZ093073; Sat, 26 Jan 2019 17:52:13 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201901261752.x0QHqDDZ093073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 26 Jan 2019 17:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343477 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 343477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5A5AD8D16A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 17:52:14 -0000 Author: bz Date: Sat Jan 26 17:52:12 2019 New Revision: 343477 URL: https://svnweb.freebsd.org/changeset/base/343477 Log: Fix logic errors in iwm_pcie_load_firmware_chunk introduced in r314065. * There's no reason to have a while() loop here, because: - if msleep returns 0, that means we were woken up by the interrupt handler, and we are going to exit immediately as sc_fw_chunk_done will now be 1 (there is nothing else that sleeps on sc_fw.) - if msleep doesn't return 0 (i.e. it returned ETIMEDOUT) then we will exit immediately because of the if-test. So, just use a single msleep() and then check sc_fw_chunk_done as before. * The comment said we were sleeping for 5 seconds, but the msleep was only for 1. Before r314065, this was 1 second and so was the comment, and in that commit the comment was changed and the function call wasn't. Possibly fixes failures to initialize uCode on certain devices. Submitted by: Augustin Cavalier (waddlesplash gmail.com) Obtained from: Haiku 132990ecdcb072f2ce597b5d497ff3e5b1f09c20 MFC after: 10 days Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Sat Jan 26 17:27:12 2019 (r343476) +++ head/sys/dev/iwm/if_iwm.c Sat Jan 26 17:52:12 2019 (r343477) @@ -2397,8 +2397,6 @@ static int iwm_pcie_load_firmware_chunk(struct iwm_softc *sc, uint32_t dst_addr, bus_addr_t phy_addr, uint32_t byte_cnt) { - int ret; - sc->sc_fw_chunk_done = 0; if (!iwm_nic_lock(sc)) @@ -2430,14 +2428,9 @@ iwm_pcie_load_firmware_chunk(struct iwm_softc *sc, uin iwm_nic_unlock(sc); /* wait up to 5s for this segment to load */ - ret = 0; - while (!sc->sc_fw_chunk_done) { - ret = msleep(&sc->sc_fw, &sc->sc_mtx, 0, "iwmfw", hz); - if (ret) - break; - } + msleep(&sc->sc_fw, &sc->sc_mtx, 0, "iwmfw", hz * 5); - if (ret != 0) { + if (!sc->sc_fw_chunk_done) { device_printf(sc->sc_dev, "fw chunk addr 0x%x len %d failed to load\n", dst_addr, byte_cnt); From owner-svn-src-head@freebsd.org Sat Jan 26 17:55:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC8C614A8470 for ; Sat, 26 Jan 2019 17:55:45 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 519208D46C for ; Sat, 26 Jan 2019 17:55:45 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1548525334; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=Ky74HM+sxfByWWWhbjopkuDS5ptW6NnPvPIEFwnnlCk8Z2SGqXlwKYoN1G2pc5JwRHca1wz3rVn6c ITegECXu99Bqdrc3KBFnv4g4FUzURP1P0oqdXq0aCDTbgk82I6Pky8rnr1dx9laUgiM3X3mqf64O8L KX3n/HAp1xYhfordLPBynyHgd482E/k81be0DA4ODSDmL3K8UAebWDGg8yYX5AKZbzERuespRata7S Ltox6aF8kt/hYtytpSnF/Xwh2wHdOEZq+bJfALzHvdAUoLzxWdeRVi/a9bFqbQiqqCbh3X08lXI8QE oqXKU0FzsbarNimTug32u0asSjsxQpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=yAGXFY9LgB7FOk/BsY7/L3KZg1AVL+h3nSZB/OEcaBk=; b=DkgSfbXlhRoBrOdqVCWUf0Myg/WeKBwXJzLG1T+qekpc7MDUJPTIQG4FWyz6dVBp/e06tUYhvOKsX xKAJIglcEhHiYT0aGEs0wDVvO58MQ6OG4iTur0FeTT+1ebtdwKIAm37od4R3hFwMWCdQgplNnjYKea hqGFJKO63mtDIHNOnBQBWuEWVPdgqEhWJJPPk4WMP7S5smtMpMaAkjsZsQCAP+s3xu694/MsHolh0r il8Iwv9LzBva0+f82iwXw/ZL7mG7TSboUPFgt/x2feXAdv5Tlhj79EPl2hxMreRdCLsqqk4CzuG+Ur 2UjNXV5LZRBN0qmLuOQg3mXW5Xmesnw== ARC-Authentication-Results: i=1; outbound3.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=yAGXFY9LgB7FOk/BsY7/L3KZg1AVL+h3nSZB/OEcaBk=; b=qbr8x5wO/Fk0eACNEMd3PVWeiWQ1nVFgiFqH5EX5in3JdqxMLA1WLNkKVbXuosb9ECOYvSnc/X2Mh X9gkXySjEA7rix083pjhtWVasJUNXZHGKO3DjS8v+GpEd4EMdLSrYHM3RnZKTgTinzJW/gEO41Pdk4 BI1DIGx2WNfG8+5vi6o/0V+oRpMpQHp3hv7Iy4bXoX7MON4Zp9XueYA0YCr5dM/rV9zpsmWkuFyZ/t r81QXWR70REWka/6gXvwBs2C74ToBQH6E+wuKJB3FUfKjvnTWVGFJziw4llSf5qqzX9qwJcajAK0q5 ngVDpLZ7ThsqYODMK0WF6orfrXWywyA== X-MHO-RoutePath: aGlwcGll X-MHO-User: 91257288-2193-11e9-8a28-a1efd8da9a94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.eu.mailhop.org (Halon) with ESMTPSA id 91257288-2193-11e9-8a28-a1efd8da9a94; Sat, 26 Jan 2019 17:55:32 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x0QHtSf0008805; Sat, 26 Jan 2019 10:55:28 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r343440 - head/bin/sh From: Ian Lepore To: rgrimes@freebsd.org Cc: Edward Napierala , Devin Teske , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 26 Jan 2019 10:55:28 -0700 In-Reply-To: <201901261717.x0QHHXCC094483@pdx.rh.CN85.dnsmgr.net> References: <201901261717.x0QHHXCC094483@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 519208D46C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 17:55:46 -0000 On Sat, 2019-01-26 at 09:17 -0800, Rodney W. Grimes wrote: > > On Sat, 2019-01-26 at 13:18 +0000, Edward Napierala wrote: > > > On 0125T1647, Devin Teske wrote: > > > > > On Jan 25, 2019, at 1:13 AM, Edward Napierala < > > > > > trasz@freebsd.org> > > > > > wrote: > > > > > On 0125T1530, Devin Teske wrote: > > > > > > > On Jan 25, 2019, at 12:28 AM, Edward Napierala < > > > > > > > trasz@freebsd.org> wrote: > > > > > > > On 0125T1441, Devin Teske wrote: > > > > > > > > > On Jan 25, 2019, at 1:37 PM, Edward Napierala < > > > > > > > > > trasz@freebsd.org> wrote: > > > > > > > > > pt., 25 sty 2019 o 19:57 Rodney W. Grimes > > > > > > > > > > > > > > > > > freebsd@pdx.rh.cn85.dnsmgr.net>> napisa?(a): > > ... > > > > > > > No, it's not just the aliases. The part that angers me the most is > > the > > changing of PS1. I still haven't seen anything that justifies any > > of > > these changes other than your opinion that you like your changes > > better > > than what was there before. > > I have asked once in public, and once in private in not such a > polite tone (Uncalled for, sorry Traz) that this be reverted. > This discussion has gone on far too long on -committers and > this change is clearly controversial. > > Ian, Please assert a request to revert as well, as it seems > Traz is stuck in the "this is just a bikeshed" and is not > going to move on my request alone, though it was also asserted > by Devin. > > Thanks, Since informal discussion doesn't seem to be getting through, I will indeed add my name to the list of those calling for a revert. -- Ian From owner-svn-src-head@freebsd.org Sat Jan 26 18:15:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BC4F14A9454; Sat, 26 Jan 2019 18:15:39 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F2BE8E298; Sat, 26 Jan 2019 18:15:39 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=51239 helo=eskarina.lan) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gnSUI-000Do0-Ca; Sat, 26 Jan 2019 10:15:26 -0800 From: Devin Teske Message-Id: <3C559A37-0802-471E-85D2-EC27ABB65658@FreeBSD.org> Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r343440 - head/bin/sh Date: Sat, 26 Jan 2019 10:15:27 -0800 In-Reply-To: Cc: Devin Teske , rgrimes@freebsd.org, Edward Napierala , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Ian Lepore References: <201901261717.x0QHHXCC094483@pdx.rh.CN85.dnsmgr.net> X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: 1F2BE8E298 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.998,0] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 18:15:39 -0000 > On Jan 26, 2019, at 9:55 AM, Ian Lepore wrote: > > On Sat, 2019-01-26 at 09:17 -0800, Rodney W. Grimes wrote: >>> On Sat, 2019-01-26 at 13:18 +0000, Edward Napierala wrote: >>>> On 0125T1647, Devin Teske wrote: >>>>>> On Jan 25, 2019, at 1:13 AM, Edward Napierala < >>>>>> trasz@freebsd.org> >>>>>> wrote: >>>>>> On 0125T1530, Devin Teske wrote: >>>>>>>> On Jan 25, 2019, at 12:28 AM, Edward Napierala < >>>>>>>> trasz@freebsd.org> wrote: >>>>>>>> On 0125T1441, Devin Teske wrote: >>>>>>>>>> On Jan 25, 2019, at 1:37 PM, Edward Napierala < >>>>>>>>>> trasz@freebsd.org> wrote: >>>>>>>>>> pt., 25 sty 2019 o 19:57 Rodney W. Grimes >>>>>>>>>> >>>>>>>>> freebsd@pdx.rh.cn85.dnsmgr.net>> napisa?(a): >> >> ... >>>> >>> >>> No, it's not just the aliases. The part that angers me the most is >>> the >>> changing of PS1. I still haven't seen anything that justifies any >>> of >>> these changes other than your opinion that you like your changes >>> better >>> than what was there before. >> >> I have asked once in public, and once in private in not such a >> polite tone (Uncalled for, sorry Traz) that this be reverted. >> This discussion has gone on far too long on -committers and >> this change is clearly controversial. >> >> Ian, Please assert a request to revert as well, as it seems >> Traz is stuck in the "this is just a bikeshed" and is not >> going to move on my request alone, though it was also asserted >> by Devin. >> >> Thanks, > > Since informal discussion doesn't seem to be getting through, I will > indeed add my name to the list of those calling for a revert. > I'm actually backing away slowly. -- Devin From owner-svn-src-head@freebsd.org Sat Jan 26 18:23:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24CB714A9860; Sat, 26 Jan 2019 18:23:29 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD49C8E870; Sat, 26 Jan 2019 18:23:28 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C154623D95; Sat, 26 Jan 2019 18:23:28 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QINSCm008867; Sat, 26 Jan 2019 18:23:28 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QINK2Z008821; Sat, 26 Jan 2019 18:23:20 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <201901261823.x0QINK2Z008821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Sat, 26 Jan 2019 18:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343478 - head/tools/kerneldoc/subsys X-SVN-Group: head X-SVN-Commit-Author: netchild X-SVN-Commit-Paths: head/tools/kerneldoc/subsys X-SVN-Commit-Revision: 343478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CD49C8E870 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 18:23:29 -0000 Author: netchild Date: Sat Jan 26 18:23:19 2019 New Revision: 343478 URL: https://svnweb.freebsd.org/changeset/base/343478 Log: Catch up with some years of driver development. Most impressive in terms of doxygen stuff are the isci and ocs_fc drivers. Added: head/tools/kerneldoc/subsys/Doxyfile-dev_aacraid (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_al_eth (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_alpm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_altera (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_amd_ecc_inject (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_amdgpio (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_amdpm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_amdsmb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_amdsmn (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_axgbe (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_beri (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_bhnd (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_bnxt (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_bvm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cadence (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_chromebook_platform (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cyapa (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_dme (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_dpaa (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_drm2 (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_dwc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_efidev (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ena (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_etherswitch (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_evdev (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_extres (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ffec (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_filemon (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_gxemul (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_hdmi (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_hptnr (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_hyperv (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ichiic (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_imcsmb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_intel (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_intpm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ioat (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_isci (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_iscsi_initiator (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_iser (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_isl (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ismt (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_iwm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ixl (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_jedec_dimm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_liquidio (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mbox (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mdio (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mlx4 (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mlx5 (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mmcnull (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mpr (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mrsas (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mthca (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nand (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nctgpio (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_neta (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_netfpga10g (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nfsmb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ntb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nvd (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nvdimm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nvme (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_oce (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ocs_fc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_otus (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ow (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_pms (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_proto (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_psci (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_pwm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_qlnx (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_qlxgbe (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_qlxge (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_rccgpio (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_rl (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_rtwn (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_smartpqi (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_tcp_log (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_terasic (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_veriexec (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_viapm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_videomode (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_vmware (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_vnic (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_vt (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_wbwd (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_xdma (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_xilinx (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-xen (contents, props changed) Deleted: head/tools/kerneldoc/subsys/Doxyfile-dev_advansys head/tools/kerneldoc/subsys/Doxyfile-dev_aha head/tools/kerneldoc/subsys/Doxyfile-dev_ahb head/tools/kerneldoc/subsys/Doxyfile-dev_aic head/tools/kerneldoc/subsys/Doxyfile-dev_asr head/tools/kerneldoc/subsys/Doxyfile-dev_buslogic head/tools/kerneldoc/subsys/Doxyfile-dev_cm head/tools/kerneldoc/subsys/Doxyfile-dev_ct head/tools/kerneldoc/subsys/Doxyfile-dev_digi head/tools/kerneldoc/subsys/Doxyfile-dev_dpt head/tools/kerneldoc/subsys/Doxyfile-dev_en head/tools/kerneldoc/subsys/Doxyfile-dev_fatm head/tools/kerneldoc/subsys/Doxyfile-dev_hatm head/tools/kerneldoc/subsys/Doxyfile-dev_ie head/tools/kerneldoc/subsys/Doxyfile-dev_ieee488 head/tools/kerneldoc/subsys/Doxyfile-dev_ncv head/tools/kerneldoc/subsys/Doxyfile-dev_nsp head/tools/kerneldoc/subsys/Doxyfile-dev_nve head/tools/kerneldoc/subsys/Doxyfile-dev_patm head/tools/kerneldoc/subsys/Doxyfile-dev_pdq head/tools/kerneldoc/subsys/Doxyfile-dev_siba head/tools/kerneldoc/subsys/Doxyfile-dev_snc head/tools/kerneldoc/subsys/Doxyfile-dev_stg head/tools/kerneldoc/subsys/Doxyfile-dev_streams head/tools/kerneldoc/subsys/Doxyfile-dev_utopia Added: head/tools/kerneldoc/subsys/Doxyfile-dev_aacraid ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_aacraid Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel aacraid device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_aacraid/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/aacraid/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_aacraid/dev_aacraid.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_al_eth ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_al_eth Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel al_eth device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_al_eth/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/al_eth/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_al_eth/dev_al_eth.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_alpm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_alpm Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel alpm device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_alpm/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/alpm/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_alpm/dev_alpm.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_altera ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_altera Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel altera device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_altera/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/altera/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_altera/dev_altera.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_amd_ecc_inject ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_amd_ecc_inject Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel amd_ecc_inject device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_amd_ecc_inject/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/amd_ecc_inject/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_amd_ecc_inject/dev_amd_ecc_inject.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_amdgpio ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_amdgpio Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel amdgpio device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_amdgpio/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/amdgpio/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_amdgpio/dev_amdgpio.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_amdpm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_amdpm Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel amdpm device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_amdpm/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/amdpm/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_amdpm/dev_amdpm.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_amdsmb ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_amdsmb Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel amdsmb device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_amdsmb/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/amdsmb/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_amdsmb/dev_amdsmb.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_amdsmn ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_amdsmn Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel amdsmn device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_amdsmn/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/amdsmn/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_amdsmn/dev_amdsmn.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_axgbe ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_axgbe Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel axgbe device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_axgbe/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/axgbe/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_axgbe/dev_axgbe.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_beri ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_beri Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel beri device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_beri/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/beri/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_beri/dev_beri.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_bhnd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bhnd Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel bhnd device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_bhnd/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/bhnd/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_bhnd/dev_bhnd.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_bnxt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bnxt Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel bnxt device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_bnxt/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/bnxt/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_bnxt/dev_bnxt.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_bvm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bvm Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel bvm device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_bvm/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/bvm/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_bvm/dev_bvm.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_cadence ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cadence Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel cadence device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_cadence/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/cadence/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_cadence/dev_cadence.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_chromebook_platform ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_chromebook_platform Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel chromebook_platform device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_chromebook_platform/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/chromebook_platform/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_chromebook_platform/dev_chromebook_platform.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_cyapa ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cyapa Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel cyapa device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_cyapa/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/cyapa/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_cyapa/dev_cyapa.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_dme ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_dme Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel dme device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_dme/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/dme/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_dme/dev_dme.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_dpaa ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_dpaa Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel dpaa device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_dpaa/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/dpaa/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_dpaa/dev_dpaa.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_drm2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_drm2 Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel drm2 device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_drm2/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/drm2/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_drm2/dev_drm2.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_dwc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_dwc Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel dwc device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_dwc/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/dwc/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_dwc/dev_dwc.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_efidev ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_efidev Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel efidev device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_efidev/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/efidev/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_efidev/dev_efidev.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ena ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ena Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ena device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ena/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ena/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ena/dev_ena.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_etherswitch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_etherswitch Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel etherswitch device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_etherswitch/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/etherswitch/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_etherswitch/dev_etherswitch.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_evdev ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_evdev Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel evdev device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_evdev/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/evdev/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_evdev/dev_evdev.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_extres ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_extres Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel extres device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_extres/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/extres/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_extres/dev_extres.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ffec ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ffec Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ffec device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ffec/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ffec/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ffec/dev_ffec.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_filemon ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_filemon Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel filemon device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_filemon/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/filemon/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_filemon/dev_filemon.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_gxemul ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_gxemul Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel gxemul device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_gxemul/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/gxemul/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_gxemul/dev_gxemul.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_hdmi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_hdmi Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel hdmi device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_hdmi/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/hdmi/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_hdmi/dev_hdmi.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_hptnr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_hptnr Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel hptnr device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_hptnr/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/hptnr/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_hptnr/dev_hptnr.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_hyperv ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_hyperv Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel hyperv device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_hyperv/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/hyperv/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_hyperv/dev_hyperv.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ichiic ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ichiic Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ichiic device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ichiic/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ichiic/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ichiic/dev_ichiic.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_imcsmb ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_imcsmb Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel imcsmb device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_imcsmb/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/imcsmb/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_imcsmb/dev_imcsmb.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_intel ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_intel Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel intel device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_intel/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/intel/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_intel/dev_intel.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_intpm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_intpm Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel intpm device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_intpm/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/intpm/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_intpm/dev_intpm.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ioat ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ioat Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ioat device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ioat/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ioat/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ioat/dev_ioat.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_isci ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_isci Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel isci device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_isci/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/isci/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_isci/dev_isci.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_iscsi_initiator ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_iscsi_initiator Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel iscsi_initiator device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_iscsi_initiator/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/iscsi_initiator/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_iscsi_initiator/dev_iscsi_initiator.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_iser ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_iser Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel iser device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_iser/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/iser/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_iser/dev_iser.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_isl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_isl Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel isl device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_isl/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/isl/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_isl/dev_isl.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ismt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ismt Sat Jan 26 18:23:19 2019 (r343478) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ismt device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ismt/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Jan 26 19:11:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7232B14AAB6A; Sat, 26 Jan 2019 19:11:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65147684C0; Sat, 26 Jan 2019 19:11:26 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f52.google.com with SMTP id t24so10393177ioi.0; Sat, 26 Jan 2019 11:11:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=PMuL/e1hexQ6CqqKdReSMYwk1EyfeYy6Nvs2tN4w/pI=; b=f7bUWKRCIO8U6x/7T6m5ux/55uQutYdbYMqDg3CyxdZLvDzRgi2bwcixAUWKfr48jR wX0h9rnitFZPfxiza22UyhVzN9fq+edwF0CBU7j6+YIsbx+5s9dulKvqaSJLy+KHpyT1 78bMY8Wmssuq6a5xICOAPkQ98vri6bL6U+beVRV5z5H1st/q7yOZxfa7BNFOQJqWyCLl 3bjTWn2trU7kUc9haQVik1qoue0PhdSbCr8epohpcu82CBOeMi97yy0+yBTDh1sBh2a5 KxDqCj8O2R5yQN1dr8rw9RWb7wlMCLuVP+R02bYq+/hHstBE2dKR1nwTYyv9Pnfq+zWG Nf8A== X-Gm-Message-State: AHQUAuaDZYVGAraMxVaECyTU54bU/UaBwcmh6haMvSLwzyVg/WHoHuvh mbJUvWR+QxGL0Q+dycn82srFK15T X-Google-Smtp-Source: AHgI3IZ25k9MpYZuYT75/ggWIGBASZcZwMNjBebWEg1DcJQ1KZwjpEA71SDz84M7ylf2cvRsfGQ7QA== X-Received: by 2002:a5d:934a:: with SMTP id i10mr9124881ioo.162.1548529880046; Sat, 26 Jan 2019 11:11:20 -0800 (PST) Received: from mail-io1-f42.google.com (mail-io1-f42.google.com. [209.85.166.42]) by smtp.gmail.com with ESMTPSA id o192sm14823060itb.31.2019.01.26.11.11.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 26 Jan 2019 11:11:19 -0800 (PST) Received: by mail-io1-f42.google.com with SMTP id k7so10331137iob.6; Sat, 26 Jan 2019 11:11:19 -0800 (PST) X-Received: by 2002:a6b:ee16:: with SMTP id i22mr3417581ioh.124.1548529879611; Sat, 26 Jan 2019 11:11:19 -0800 (PST) MIME-Version: 1.0 References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> In-Reply-To: <201901251709.x0PH9Rc4094379@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sat, 26 Jan 2019 11:11:08 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r343440 - head/bin/sh To: svn-src-head@freebsd.org Cc: src-committers , svn-src-all@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 65147684C0 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.52 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-5.55 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.84)[-0.842,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-2.69)[ip: (-7.76), ipnet: 209.85.128.0/17(-3.70), asn: 15169(-1.93), country: US(-0.08)]; RCVD_IN_DNSWL_NONE(0.00)[52.166.85.209.list.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 19:11:27 -0000 I didn't really feel the need to weigh in on this bikeshed thread previously, but apparently some folks are calling for a revert. Why? I don't really understand how this meets the high bar for summary revert, even if you disagree with the change made (and disagreement is fine, of course). So I'll raise my hand for "leave it in" and encourage talking out your bikeshed. It would be persuasive to come up with a specific list of complaints, ideally excluding ones that have been shown to be baseless. So far there has been a lot of mudslinging and it's difficult to sort out the preference complaints from the security complaints from the (well-intentioned, but ultimately inaccurate) fiction. I don't think a "heckler's veto" should be granted. If you don't use root/toor, that's fine! But I think that sort of (heavily) discounts how much weight your opinion of root/toor defaults should be given. If you use Expect, great. You should be setting a specific PS1 anyway (both before and after this change). After all, this is just the default. Users have been free to set a custom PS1 for root in .profile since time began. Has anyone verified the claim that freebsd-update will actually modify a user's home directory contents, or was that just speculation? I don't know one way or the other and I think it's still an open question. Best regards, Conrad On Fri, Jan 25, 2019 at 9:09 AM Edward Tomasz Napierala wrote: > > Author: trasz > Date: Fri Jan 25 17:09:26 2019 > New Revision: 343440 > URL: https://svnweb.freebsd.org/changeset/base/343440 > > Log: > Comment out the default sh(1) aliases for root, introduced in r343416. > The rest of this stuff is still to be discussed, but I think at this > point we have the agreement that the aliases should go. > > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > > Modified: > head/bin/sh/dot.shrc > > Modified: head/bin/sh/dot.shrc > ============================================================================== > --- head/bin/sh/dot.shrc Fri Jan 25 17:08:28 2019 (r343439) > +++ head/bin/sh/dot.shrc Fri Jan 25 17:09:26 2019 (r343440) > @@ -18,13 +18,13 @@ > # set -o vi > > > -# some useful aliases > -alias h='fc -l' > -alias j=jobs > -alias m="$PAGER" > -alias ll='ls -laFo' > -alias l='ls -l' > -alias g='egrep -i' > +# # some useful aliases > +# alias h='fc -l' > +# alias j=jobs > +# alias m="$PAGER" > +# alias ll='ls -laFo' > +# alias l='ls -l' > +# alias g='egrep -i' > > # # be paranoid > # alias cp='cp -ip' > From owner-svn-src-head@freebsd.org Sat Jan 26 20:35:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A95D14ADC10 for ; Sat, 26 Jan 2019 20:35:28 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09C096C8C4 for ; Sat, 26 Jan 2019 20:35:27 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1548534863; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=KR3k+mbbeoWxwma9C5y6y9YZvsXkmgbr31ghte8XolcTVs/ge95gg1A8z3uEzZWg56ucYu9UQ7e59 Pwqml7++qjVGX3NKemACCAEYiCmmCX928a4dIjU4o0XvZxue6e6l857MuEP1W0qnoS4uvPiwVqqaed LJdSoQHofud+oP+c6NtHDY0TvIf8v1R2bHPWA2KhEcbyveMxQb5VUL6tPIikgzosddkd1aZUWxdbAu rbdm2y9ZUMPBHCowlCbsxrzNC9ivUNqxepeMrBcmJ9MX1BIs4/NeSokNBJFtat2p56tocBzAubIyzR ajaXdER+UbdSIZb8W5dDvUzJHBKRkAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=dcPrGvCF2AX7zGjKI+YsJmoKrYt6k3I8rGW511yUsLg=; b=dgKbIlNRwAqMK46JSkFESvv4r6hvR/WROXZFqATiUpHPWlwLRkEmA6WeGMWG8ZPR+oT2r/nu46q5c V5erkNwDgPEWfnrNH+TY/pEugYzsjkcXa0s6jmrfm/vDijHOmqqpmzRxh4xbY5gv7VE3H2vSMoHjfH 98+dvpwJ88v/QiMyp4X66letmzh5sp+iphDe1eMtnB7R9319Yz1qq+NGZ5XW9D3yxgSNPZJoe9jhVM hjy3eefO7ApN86OWDIDFI1pX2VVKuJ69bZt6tBjYka/1s3vTb4UV5NwWcKiDCzceOBQX8XUUYTjRm9 Xflx7ucf4l6h3Ip7GCPpJaT++cM2l7Q== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=dcPrGvCF2AX7zGjKI+YsJmoKrYt6k3I8rGW511yUsLg=; b=wxXBsNBWx6kAk7HQ4vF5UfjVtSN/CDs30f6Lev0XJ0lwv6QqNaTEH7Szfwsa821jMRns0UMS9Emaz +XewwBkLLsQc5Hs62YFJOhIeIDa0ptJZGNF4iJ//6uGWr81AQxXDhDNxcDoQ+qe/+7tvxj13u+OIk7 553S9ivEdqcrIy0H2b5Sz7Qs3G4t1UwPVWSkZFoXdqFcy0h6ID7MihovyE6Rs6Oh4xcc7GqJvM2hWZ 5X/nNiCn6aFcNaJK1n7IbQY0TcYxg6aY6ctAxULBBLGilnObAPdYmih1e4ZN8ZbyfKZd9NNQZOvuAQ e9AjIPJQFjeT9zguU5rQuSEZsujQigg== X-MHO-RoutePath: aGlwcGll X-MHO-User: c27b956f-21a9-11e9-befd-af03bedce89f X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id c27b956f-21a9-11e9-befd-af03bedce89f; Sat, 26 Jan 2019 20:34:21 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x0QKZIES009150; Sat, 26 Jan 2019 13:35:18 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <03987a1c3ad0c362d50dcefdfd653dec033d14ed.camel@freebsd.org> Subject: Re: svn commit: r343440 - head/bin/sh From: Ian Lepore To: cem@freebsd.org, svn-src-head@freebsd.org Cc: src-committers , svn-src-all@freebsd.org Date: Sat, 26 Jan 2019 13:35:18 -0700 In-Reply-To: References: <201901251709.x0PH9Rc4094379@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 09C096C8C4 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 20:35:28 -0000 On Sat, 2019-01-26 at 11:11 -0800, Conrad Meyer wrote: > I didn't really feel the need to weigh in on this bikeshed thread > previously, but apparently some folks are calling for a revert. Why? > I don't really understand how this meets the high bar for summary > revert, even if you disagree with the change made (and disagreement > is > fine, of course). > > So I'll raise my hand for "leave it in" and encourage talking out > your > bikeshed. It would be persuasive to come up with a specific list of > complaints, ideally excluding ones that have been shown to be > baseless. So far there has been a lot of mudslinging and it's > difficult to sort out the preference complaints from the security > complaints from the (well-intentioned, but ultimately inaccurate) > fiction. I don't think a "heckler's veto" should be granted. > > If you don't use root/toor, that's fine! But I think that sort of > (heavily) discounts how much weight your opinion of root/toor > defaults > should be given. > > If you use Expect, great. You should be setting a specific PS1 > anyway > (both before and after this change). After all, this is just the > default. Users have been free to set a custom PS1 for root in > .profile since time began. > > Has anyone verified the claim that freebsd-update will actually > modify > a user's home directory contents, or was that just speculation? I > don't know one way or the other and I think it's still an open > question. > > Best regards, > Conrad > Wait a sec... something has been stable and working fine for 30 years, then it gets changed to reflect one man's personal preferences, and it's the people who object to that who have to jump through flaming hoops to justify themselves? Screw that. Don't bother to CC me in any replies, I'm out of this conversation. It's a pity the freebsd prject has turned into linux. -- ian > On Fri, Jan 25, 2019 at 9:09 AM Edward Tomasz Napierala > wrote: > > > > Author: trasz > > Date: Fri Jan 25 17:09:26 2019 > > New Revision: 343440 > > URL: https://svnweb.freebsd.org/changeset/base/343440 > > > > Log: > > Comment out the default sh(1) aliases for root, introduced in > > r343416. > > The rest of this stuff is still to be discussed, but I think at > > this > > point we have the agreement that the aliases should go. > > > > MFC after: 2 weeks > > Sponsored by: DARPA, AFRL > > > > Modified: > > head/bin/sh/dot.shrc > > > > Modified: head/bin/sh/dot.shrc > > =================================================================== > > =========== > > --- head/bin/sh/dot.shrc Fri Jan 25 17:08:28 > > 2019 (r343439) > > +++ head/bin/sh/dot.shrc Fri Jan 25 17:09:26 > > 2019 (r343440) > > @@ -18,13 +18,13 @@ > > # set -o vi > > > > > > -# some useful aliases > > -alias h='fc -l' > > -alias j=jobs > > -alias m="$PAGER" > > -alias ll='ls -laFo' > > -alias l='ls -l' > > -alias g='egrep -i' > > +# # some useful aliases > > +# alias h='fc -l' > > +# alias j=jobs > > +# alias m="$PAGER" > > +# alias ll='ls -laFo' > > +# alias l='ls -l' > > +# alias g='egrep -i' > > > > # # be paranoid > > # alias cp='cp -ip' > > > > From owner-svn-src-head@freebsd.org Sat Jan 26 20:43:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CAA214ADFFF; Sat, 26 Jan 2019 20:43:29 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23FD76CD73; Sat, 26 Jan 2019 20:43:29 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16F7925558; Sat, 26 Jan 2019 20:43:29 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QKhSKs081626; Sat, 26 Jan 2019 20:43:28 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QKhS2S081625; Sat, 26 Jan 2019 20:43:28 GMT (envelope-from se@FreeBSD.org) Message-Id: <201901262043.x0QKhS2S081625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Sat, 26 Jan 2019 20:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343479 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 343479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 23FD76CD73 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 20:43:29 -0000 Author: se Date: Sat Jan 26 20:43:28 2019 New Revision: 343479 URL: https://svnweb.freebsd.org/changeset/base/343479 Log: Fix potential buffer overflow and undefined behavior. The buffer allocated in read_chat() could be 1 element too short, if the chatstr parameter passed in is 1 or 3 charachters long (e.g. "a" or "a b"). The allocation of the pointer array does not account for the terminating NULL pointer in that case. Overlapping source and destination strings are undefined in strcpy(). Instead of moving a string to the left by one character just increment the char pointer before it is assigned to the results array. MFC after: 2 weeks Modified: head/libexec/getty/chat.c Modified: head/libexec/getty/chat.c ============================================================================== --- head/libexec/getty/chat.c Sat Jan 26 18:23:19 2019 (r343478) +++ head/libexec/getty/chat.c Sat Jan 26 20:43:28 2019 (r343479) @@ -141,7 +141,7 @@ read_chat(char **chatstr) int l; if ((l=strlen(str)) > 0 && (tmp=malloc(l + 1)) != NULL && - (res=malloc((l / 2 + 1) * sizeof(char *))) != NULL) { + (res=malloc(((l + 1) / 2 + 1) * sizeof(char *))) != NULL) { static char ws[] = " \t"; char * p; @@ -216,7 +216,7 @@ read_chat(char **chatstr) q = strrchr(p+1, *p); if (q != NULL && *q == *p && q[1] == '\0') { *q = '\0'; - strcpy(p, p+1); + p++; } } From owner-svn-src-head@freebsd.org Sat Jan 26 21:30:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D11614AEF5A; Sat, 26 Jan 2019 21:30:27 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B74516E0EC; Sat, 26 Jan 2019 21:30:26 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB8F225C2C; Sat, 26 Jan 2019 21:30:26 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QLUQ2a002875; Sat, 26 Jan 2019 21:30:26 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QLUQnf002874; Sat, 26 Jan 2019 21:30:26 GMT (envelope-from se@FreeBSD.org) Message-Id: <201901262130.x0QLUQnf002874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Sat, 26 Jan 2019 21:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343480 - head/lib/libfigpar X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/lib/libfigpar X-SVN-Commit-Revision: 343480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B74516E0EC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 21:30:27 -0000 Author: se Date: Sat Jan 26 21:30:26 2019 New Revision: 343480 URL: https://svnweb.freebsd.org/changeset/base/343480 Log: Silence Clang Scan warning about potentially unsafe use of strcpy. While this is a false positive, the use of strdup() simplifies the code. MFC after: 2 weeks Modified: head/lib/libfigpar/string_m.c Modified: head/lib/libfigpar/string_m.c ============================================================================== --- head/lib/libfigpar/string_m.c Sat Jan 26 20:43:28 2019 (r343479) +++ head/lib/libfigpar/string_m.c Sat Jan 26 21:30:26 2019 (r343480) @@ -119,10 +119,9 @@ replaceall(char *source, const char *find, const char /* If replace is longer than find, we'll need to create a temp copy */ if (rlen > flen) { - temp = malloc(slen + 1); - if (errno != 0) /* could not allocate memory */ + temp = strdup(source); + if (temp == NULL) /* could not allocate memory */ return (-1); - strcpy(temp, source); } else temp = source; From owner-svn-src-head@freebsd.org Sat Jan 26 21:35:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A86314AF1E0; Sat, 26 Jan 2019 21:35:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F11076E576; Sat, 26 Jan 2019 21:35:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEC7725DFC; Sat, 26 Jan 2019 21:35:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QLZpKg008071; Sat, 26 Jan 2019 21:35:51 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QLZp6Y008070; Sat, 26 Jan 2019 21:35:51 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201901262135.x0QLZp6Y008070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 26 Jan 2019 21:35:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343481 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 343481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F11076E576 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 21:35:52 -0000 Author: marius Date: Sat Jan 26 21:35:51 2019 New Revision: 343481 URL: https://svnweb.freebsd.org/changeset/base/343481 Log: - In _iflib_fl_refill(), don't mark an RX buffer as available in the corresponding bitmap before adding an mbuf has actually succeeded. Previously, m_gethdr(M_NOWAIT, ...) failing caused a "hole" in the RX ring but not in its bitmap. One implication of such a hole was that in a subsequent call to _iflib_fl_refill() with the RX buffer accounting still indicating another reclaimable buffer, bit_ffc(3) nevertheless returned -1 in frag_idx which in turn caused havoc when used as an index. Thus, additionally assert that frag_idx is 0 or greater. Another possible consequence of a hole in the RX ring was a NULL- dereference when trying to use the unallocated mbuf, for example in iflib_rxd_pkt_get(). While at it, make the variable declarations in _iflib_fl_refill() conform to style(9) and remove redundant checks already performed by bit_ffc{,_at}(3). - In iflib_queues_alloc(), don't pass redundant M_ZERO to bit_alloc(3). Reported and tested by: pho Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Sat Jan 26 21:30:26 2019 (r343480) +++ head/sys/net/iflib.c Sat Jan 26 21:35:51 2019 (r343481) @@ -1921,27 +1921,27 @@ _rxq_refill_cb(void *arg, bus_dma_segment_t *segs, int static void _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int count) { + struct if_rxd_update iru; + struct rxq_refill_cb_arg cb_arg; struct mbuf *m; - int idx, frag_idx = fl->ifl_fragidx; - int pidx = fl->ifl_pidx; caddr_t cl, *sd_cl; struct mbuf **sd_m; - struct if_rxd_update iru; - struct rxq_refill_cb_arg cb_arg; bus_dmamap_t *sd_map; - int n, i = 0; bus_addr_t bus_addr, *sd_ba; - int err; + int err, frag_idx, i, idx, n, pidx; qidx_t credits; sd_m = fl->ifl_sds.ifsd_m; sd_map = fl->ifl_sds.ifsd_map; sd_cl = fl->ifl_sds.ifsd_cl; sd_ba = fl->ifl_sds.ifsd_ba; + pidx = fl->ifl_pidx; idx = pidx; + frag_idx = fl->ifl_fragidx; credits = fl->ifl_credits; - n = count; + i = 0; + n = count; MPASS(n > 0); MPASS(credits + n <= fl->ifl_size); @@ -1963,9 +1963,11 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun * * If the cluster is still set then we know a minimum sized packet was received */ - bit_ffc_at(fl->ifl_rx_bitmap, frag_idx, fl->ifl_size, &frag_idx); - if ((frag_idx < 0) || (frag_idx >= fl->ifl_size)) - bit_ffc(fl->ifl_rx_bitmap, fl->ifl_size, &frag_idx); + bit_ffc_at(fl->ifl_rx_bitmap, frag_idx, fl->ifl_size, + &frag_idx); + if (frag_idx < 0) + bit_ffc(fl->ifl_rx_bitmap, fl->ifl_size, &frag_idx); + MPASS(frag_idx >= 0); if ((cl = sd_cl[frag_idx]) == NULL) { if ((cl = m_cljget(NULL, M_NOWAIT, fl->ifl_buf_size)) == NULL) break; @@ -1995,12 +1997,12 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun bus_addr = sd_ba[frag_idx]; } - bit_set(fl->ifl_rx_bitmap, frag_idx); MPASS(sd_m[frag_idx] == NULL); if ((m = m_gethdr(M_NOWAIT, MT_NOINIT)) == NULL) { break; } sd_m[frag_idx] = m; + bit_set(fl->ifl_rx_bitmap, frag_idx); #if MEMORY_LOGGING fl->ifl_m_enqueued++; #endif @@ -2025,7 +2027,6 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun fl->ifl_pidx = idx; fl->ifl_credits = credits; } - } if (i) { @@ -4896,7 +4897,6 @@ iflib_device_deregister(if_ctx_t ctx) for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) free(fl->ifl_rx_bitmap, M_IFLIB); - } tqg = qgroup_if_config_tqg; if (ctx->ifc_admin_task.gt_uniq != NULL) @@ -5304,7 +5304,8 @@ iflib_queues_alloc(if_ctx_t ctx) } for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) - fl->ifl_rx_bitmap = bit_alloc(fl->ifl_size, M_IFLIB, M_WAITOK|M_ZERO); + fl->ifl_rx_bitmap = bit_alloc(fl->ifl_size, M_IFLIB, + M_WAITOK); } /* TXQs */ From owner-svn-src-head@freebsd.org Sat Jan 26 21:36:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A88FA14AF224; Sat, 26 Jan 2019 21:36:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B67BE6E69E; Sat, 26 Jan 2019 21:36:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0QLaAhr095519; Sat, 26 Jan 2019 13:36:10 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0QLaAJv095518; Sat, 26 Jan 2019 13:36:10 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901262136.x0QLaAJv095518@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r343480 - head/lib/libfigpar In-Reply-To: <201901262130.x0QLUQnf002874@repo.freebsd.org> To: Stefan Esser Date: Sat, 26 Jan 2019 13:36:10 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: B67BE6E69E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 21:36:20 -0000 > Author: se > Date: Sat Jan 26 21:30:26 2019 > New Revision: 343480 > URL: https://svnweb.freebsd.org/changeset/base/343480 > > Log: > Silence Clang Scan warning about potentially unsafe use of strcpy. > > While this is a false positive, the use of strdup() simplifies the code. Though that might be true, it also has to recalculate the length of the string which was already known by slen. I am not sure how often this code is called, but that is wasted cycles in a library. > > MFC after: 2 weeks > > Modified: > head/lib/libfigpar/string_m.c > > Modified: head/lib/libfigpar/string_m.c > ============================================================================== > --- head/lib/libfigpar/string_m.c Sat Jan 26 20:43:28 2019 (r343479) > +++ head/lib/libfigpar/string_m.c Sat Jan 26 21:30:26 2019 (r343480) > @@ -119,10 +119,9 @@ replaceall(char *source, const char *find, const char > > /* If replace is longer than find, we'll need to create a temp copy */ > if (rlen > flen) { > - temp = malloc(slen + 1); > - if (errno != 0) /* could not allocate memory */ > + temp = strdup(source); > + if (temp == NULL) /* could not allocate memory */ > return (-1); > - strcpy(temp, source); > } else > temp = source; > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Jan 26 21:59:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D461D14B00B6 for ; Sat, 26 Jan 2019 21:59:51 +0000 (UTC) (envelope-from 010001688c2cfc42-22c55805-59b0-42b4-8ca5-022401255606-000000@amazonses.com) Received: from a8-56.smtp-out.amazonses.com (a8-56.smtp-out.amazonses.com [54.240.8.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 775866F38C for ; Sat, 26 Jan 2019 21:59:51 +0000 (UTC) (envelope-from 010001688c2cfc42-22c55805-59b0-42b4-8ca5-022401255606-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=dqtolf56kk3wpt62c3jnwboqvr7iedax; d=tarsnap.com; t=1548539985; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=IyONnK3KcNDAb/NMkPxFDPeRpbXHOzoujmuqOvon/xs=; b=Ot8jElswK/CGA+XuxlvgI4Ykowh9W8nf6or7hm9gQxYENb2YNS7TfdIWrdExB7XS F/JRmmDcAXo6g2weDVXDQCyeSaU6w5ntpmTXLX9ZmL9VJkeFU4wW6ssQeYd/nQvu4np 1kaz9HDp0r2S9mwbQnUA6s0n5sjdig15VEMbaLI4= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1548539985; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=IyONnK3KcNDAb/NMkPxFDPeRpbXHOzoujmuqOvon/xs=; b=Mnyy6EodEt7IOEE8b0DG8za1syR2AEiJL6cs0JiuWRJujcOSveTCfHmc2WU56ZaF /IybMFRS2ZEYsrFjBUb7e60dA2L7AC74WTBNMefLgRGnQsoWRepJZ3QpCRh3Ugk93UH sJ2IFR4EeLMn3Rvlgpq5A6J5c+TkDNM56t1q9KjM= Subject: Re: svn commit: r343480 - head/lib/libfigpar To: rgrimes@freebsd.org, Stefan Esser Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901262136.x0QLaAJv095518@pdx.rh.CN85.dnsmgr.net> From: Colin Percival Openpgp: preference=signencrypt Autocrypt: addr=cperciva@tarsnap.com; prefer-encrypt=mutual; keydata= mQGhBElrAAcRBACDfDys4ZtK+ErCJ1HAzYeteKpm3OEsvT/49AjUTLihkF79HhIKrCQU+1KC zv7BwHCMLb6hq30As9L7iFKG7n5QFLFC4Te/VcITUnWHMG/c3ViLOfJGvi+9/nOEHaM1dVJY D6tEp5yM1nHmVQpo9932j4KGuGFR0LhOK5IHXOSfGwCgxSFDPdgxe2OEjWxjGgY+oV3EafcD +JROXCTjlcQiG/OguQH4Vks3mhHfFnEppLxTkDuYgHZQiUtpcT9ssH5khgqoTyMar05OUdAj ZIhNbWDh4LgTj+7ZmvLhXT5Zxw8LX9d7T36aTB8XDQSenDqEtinMWOb0TCBBLbsB8EFG1WTT ESbZci9jJS5yhtktuZoY/eM8uXMD/3k4FWFO80VRRkELSp+XSy/VlSQjyi/rhl2nQq/oOA9F oJbDaB0yq9VNhxP+uFBzBWSqeIX0t1ZWLtNfVFr4TRP5hihI5ICrg/0OpqgisKsU2NFe9xyO hyJLYmfD8ebpDJ/9k30C7Iju9pVrwLm1QgS4S2fqJRcR+U4WbjvP7CgStCVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFAdGFyc25hcC5jb20+iGEEExECACEFAklrALYCGwMHCwkIBwMCAQQV AggDBBYCAwECHgECF4AACgkQOM7KaQxqam6/igCgn+z2k3V5ggNppmWrZstt1U2lugsAoL7L wS9V9yLtil3oWmHtwpUqYruEuQINBElrAAcQCAD3ZLMIsP4CIDoJORg+YY0lqLVBgcnF7pFb 4Uy2+KvdWofN+DKH61rZLjgXXkNE9M4EQC1B4lGttBP8IY2gs41y3AUogGdyFbidq99rCBz7 LTsgARHwFxZoaHmXyiZLEU1QZuMqwPZV1mCviRhN5E3rRqYNXVcrnXAAuhBpvNyj/ntHvcDN 2/m+ochiuBYueU4kX3lHya7sOj+mTsndcWmQ9soOUyr8O0r/BG088bMn4qqtUw4dl5/pglXk jbl7uOOPinKf0WVd2r6M0wLPJCD4NPHrCWRLLLAjwfjrtoSRvXxDbXhCdgGBa72+K8eYLzVs hgq7tJOoBWzjVK6XRxR7AAMGB/9Mo3iJ2DxqDecd02KCB5BsFDICbJGhPltU7FwrtbC7djSb XUrwsEVLHi4st4cbdGNCWCrp0BRezXZKohKnNAPFOTK++ZfgeKxrV2sJod+Q9RILF86tQ4XF 7A7Yme5hy92t/WgiU4vc/fWbgP8gV/19f8nunaT2E9NSa70mZFjZNu4iuwThoUUO5CV3Wo0Y UISsnRK8XD1+LR3A2qVyLiFRwh/miC1hgLFCTGCQ3GLxZeZzIpYSlGdQJ0L5lixW5ZQD9r1I 8i/8zhE6qRFAM0upUMI3Gt1Oq2w03DiXrZU0Fu/R8Rm8rlnkQKA+95mRTUq1xL5P5NZIi4gJ Z569OPMFiEkEGBECAAkFAklrAAcCGwwACgkQOM7KaQxqam41igCfbaldnFTu5uAdrnrghESv EI3CAo8AoLkNMks1pThl2BJNRm4CtTK9xZeH Message-ID: <010001688c2cfc42-22c55805-59b0-42b4-8ca5-022401255606-000000@email.amazonses.com> Date: Sat, 26 Jan 2019 21:59:45 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <201901262136.x0QLaAJv095518@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2019.01.26-54.240.8.56 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-Rspamd-Queue-Id: 775866F38C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 21:59:52 -0000 On 1/26/19 1:36 PM, Rodney W. Grimes wrote: >> Author: se >> Date: Sat Jan 26 21:30:26 2019 >> New Revision: 343480 >> URL: https://svnweb.freebsd.org/changeset/base/343480 >> >> Log: >> Silence Clang Scan warning about potentially unsafe use of strcpy. >> >> While this is a false positive, the use of strdup() simplifies the code. > > Though that might be true, it also has to recalculate the > length of the string which was already known by slen. > > I am not sure how often this code is called, > but that is wasted cycles in a library. The length of the string was already being recalculated, by strcpy. It seems to me that this could be written as temp = malloc(slen + 1); if (temp == NULL) /* could not allocate memory */ return (-1); memcpy(temp, source, slen + 1); which avoids both recalculating the string length and using strcpy? >> Modified: head/lib/libfigpar/string_m.c >> ============================================================================== >> --- head/lib/libfigpar/string_m.c Sat Jan 26 20:43:28 2019 (r343479) >> +++ head/lib/libfigpar/string_m.c Sat Jan 26 21:30:26 2019 (r343480) >> @@ -119,10 +119,9 @@ replaceall(char *source, const char *find, const char >> >> /* If replace is longer than find, we'll need to create a temp copy */ >> if (rlen > flen) { >> - temp = malloc(slen + 1); >> - if (errno != 0) /* could not allocate memory */ >> + temp = strdup(source); >> + if (temp == NULL) /* could not allocate memory */ >> return (-1); >> - strcpy(temp, source); >> } else >> temp = source; -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Sat Jan 26 22:24:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8BD014B0AA8; Sat, 26 Jan 2019 22:24:15 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DD2B7021E; Sat, 26 Jan 2019 22:24:15 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F4D926670; Sat, 26 Jan 2019 22:24:15 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QMOFe4034235; Sat, 26 Jan 2019 22:24:15 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QMOFca034234; Sat, 26 Jan 2019 22:24:15 GMT (envelope-from se@FreeBSD.org) Message-Id: <201901262224.x0QMOFca034234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Sat, 26 Jan 2019 22:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343482 - head/lib/libfigpar X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/lib/libfigpar X-SVN-Commit-Revision: 343482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DD2B7021E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 22:24:16 -0000 Author: se Date: Sat Jan 26 22:24:15 2019 New Revision: 343482 URL: https://svnweb.freebsd.org/changeset/base/343482 Log: Slightly improve previous commit that silenced a Clang Scan warning. The strdup() call does not take advantage of the known length of the source string. Replace by malloc() and memcpy() utilizimng the pre- calculated string length. Submitted by: cperciva Reported by: rgrimes MFC after: 2 weeks Modified: head/lib/libfigpar/string_m.c Modified: head/lib/libfigpar/string_m.c ============================================================================== --- head/lib/libfigpar/string_m.c Sat Jan 26 21:35:51 2019 (r343481) +++ head/lib/libfigpar/string_m.c Sat Jan 26 22:24:15 2019 (r343482) @@ -119,9 +119,10 @@ replaceall(char *source, const char *find, const char /* If replace is longer than find, we'll need to create a temp copy */ if (rlen > flen) { - temp = strdup(source); + temp = malloc(slen + 1); if (temp == NULL) /* could not allocate memory */ return (-1); + memcpy(temp, source, slen + 1); } else temp = source; From owner-svn-src-head@freebsd.org Sat Jan 26 22:26:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD1FF14B0B6F; Sat, 26 Jan 2019 22:26:26 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C75AA70394; Sat, 26 Jan 2019 22:26:25 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-402.fritz.box (p200300CD5F2FCF00641090E029F19200.dip0.t-ipconnect.de [IPv6:2003:cd:5f2f:cf00:6410:90e0:29f1:9200]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id E81B315306; Sat, 26 Jan 2019 22:26:24 +0000 (UTC) (envelope-from se@freebsd.org) Subject: Re: svn commit: r343480 - head/lib/libfigpar To: Colin Percival , rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901262136.x0QLaAJv095518@pdx.rh.CN85.dnsmgr.net> <010001688c2cfc3e-e319d851-8b9e-4468-8bd1-f93331f35116-000000@email.amazonses.com> From: Stefan Esser Openpgp: preference=signencrypt Autocrypt: addr=se@freebsd.org; prefer-encrypt=mutual; keydata= mQENBFVxiRIBCADOLNOZBsqlplHUQ3tG782FNtVT33rQli9EjNt2fhFERHIo4NxHlWBpHLnU b0s4L/eItx7au0i7Gegv01A9LUMwOnAc9EFAm4EW3Wmoa6MYrcP7xDClohg/Y69f7SNpEs3x YATBy+L6NzWZbJjZXD4vqPgZSDuMcLU7BEdJf0f+6h1BJPnGuwHpsSdnnMrZeIM8xQ8PPUVQ L0GZkVojHgNUngJH6e21qDrud0BkdiBcij0M3TCP4GQrJ/YMdurfc8mhueLpwGR2U1W8TYB7 4UY+NLw0McThOCLCxXflIeF/Y7jSB0zxzvb/H3LWkodUTkV57yX9IbUAGA5RKRg9zsUtABEB AAG0J1N0ZWZhbiBFw59lciAoRnJlZUJTRCkgPHNlQGZyZWVic2Qub3JnPokBVAQTAQoAPgIb AwULCQgHAwUVCgkICwUWAwIBAAIeAQIXgBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+q BQkLJQETAAoJEEfrte9a/fVEOeMH/icmdK1eZQvB3U8quJo9VMaZsaTuCMbUE4NThyfsIvIm MCd+rb/yULmMYwqNfjyKB1x4ikR4x+94l+yJoz7K0Usks+eNKDmMGJM6pWWssTigaJubFdVd hVVC+C1QJi7JshYSib08uONoPmO4lv5Az0TDYGtsMzsES2sIlc62c9go5WPGYhQFRbX3Lk6y V6m8OHh+G9XGSj3oPO4UteRwu+SzTdOLunZBWG1wu34+IeZm663D+2gOppQLWpLa2qaTerqw THu377ayZ2B2LPJ5JkvkZeHYPkwDQ+b5PGn0UhfkxPnDVYki5F7qKxvQ5uq1/q9YaCX7mmOl H2yO7tgVsrW5AQ0EVXGJEgEIALEj9qCXMZVucjpcd3QxM/TlUr98m5viEd1z4tCnPUyRWcIC EVtj2h5xMH+2iB0q1+KWhq+NsWtvScmEmfHnsr7dJ1K677OdpDhKVaJk61eeRulFY1R4yb6C 1MMxK+WgYB+vvpG0UeyR0M4uBewcPvRsq4yGUHFQKtLAbMdoPTSryJA+ElnmK1vdY+rPcHgi OIMBZM7ahsPXC0C9K4e5SP9clGyIoMpbfHXdx9q+Rp3zVtlbhyk3BS/xccu/+9pk9ICXL6GR js2sNnJ0wxdU1DsAlC59a5MnSruwiZFwRnkQhr3x6wk97Lg7sLS9jjTnCN7LGlVmSmpOEMy6 uq1AWfUAEQEAAYkBPAQYAQoAJgIbDBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+rBQkL JQEZAAoJEEfrte9a/fVEuesH/2DNxGWnHvWwMyiyhlQtafvDKwEn/wAgR8gHJFodB7emf8rA TnukH7MVttCoHtjN5lvv9RSBHjNTZls5wR/ANlwdRuPQHd8ZGxLe3S6IuUB3zDSwFltLGurO N2kOMhs5mTGyypSa+uw3rtQbUAVYf1oPbiR4FLtiM8FLyEvE95hX5fPq9Qvx9FmN79kmCIEw jDKPqDaUf/OR2fEF0LSIbXHEk4tNqCEwx5DIJ0fp5/z5UzICUAmwxyRs5O/Hre1jzPsMVyud Ml9t7UTOJGKVWwRory1PMnOFxN+iz5/d4FhYSKXF7kfMiFgol4LuWaxJRwbBrr71VGBrRy2a L1nw6Bc= Message-ID: Date: Sat, 26 Jan 2019 23:26:23 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <010001688c2cfc3e-e319d851-8b9e-4468-8bd1-f93331f35116-000000@email.amazonses.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: C75AA70394 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 22:26:26 -0000 Am 26.01.19 um 22:59 schrieb Colin Percival: > On 1/26/19 1:36 PM, Rodney W. Grimes wrote: >>> Author: se >>> Date: Sat Jan 26 21:30:26 2019 >>> New Revision: 343480 >>> URL: https://svnweb.freebsd.org/changeset/base/343480 >>> >>> Log: >>> Silence Clang Scan warning about potentially unsafe use of strcpy. >>> >>> While this is a false positive, the use of strdup() simplifies the code. >> >> Though that might be true, it also has to recalculate the >> length of the string which was already known by slen. >> >> I am not sure how often this code is called, >> but that is wasted cycles in a library. > > The length of the string was already being recalculated, by strcpy. > > It seems to me that this could be written as > > temp = malloc(slen + 1); > if (temp == NULL) /* could not allocate memory */ > return (-1); > memcpy(temp, source, slen + 1); > > which avoids both recalculating the string length and using strcpy? In principle you are right, there is a small run-time cost by not using the known length for the allocation. The Clang Scan checks are leading to lots (thousands) of false positives and a I have looked at quite a number and abstained from silencing them in the hope that the scan will be improved. It should learn that at least the trivial case of an allocation of the value of strlen()+1 followed by a strcpy (and no further strcat or the like) is safe. But I have seen cases where the assumption is that "i<0" followed by "i>=0" at the same location and then a warning about potential problem. I have committed the version you suggest in rev. 343482 ... Regards, STefan From owner-svn-src-head@freebsd.org Sat Jan 26 22:27:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4845014B0BD0; Sat, 26 Jan 2019 22:27:13 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2607704E0; Sat, 26 Jan 2019 22:27:12 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3BA226673; Sat, 26 Jan 2019 22:27:12 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QMRCdm034410; Sat, 26 Jan 2019 22:27:12 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0QMRCbv034408; Sat, 26 Jan 2019 22:27:12 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201901262227.x0QMRCbv034408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 26 Jan 2019 22:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343483 - in head/sbin: newfs tunefs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sbin: newfs tunefs X-SVN-Commit-Revision: 343483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E2607704E0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 22:27:13 -0000 Author: mckusick Date: Sat Jan 26 22:27:12 2019 New Revision: 343483 URL: https://svnweb.freebsd.org/changeset/base/343483 Log: Update tunefs and newfs error messages for the -L (volume label) option to note that underscores are valid. PR: 235182 Reported by: Rodney W. Grimes (rgrimes@) Sponsored by: Netflix Modified: head/sbin/newfs/newfs.c head/sbin/tunefs/tunefs.c Modified: head/sbin/newfs/newfs.c ============================================================================== --- head/sbin/newfs/newfs.c Sat Jan 26 22:24:15 2019 (r343482) +++ head/sbin/newfs/newfs.c Sat Jan 26 22:27:12 2019 (r343483) @@ -155,7 +155,8 @@ main(int argc, char *argv[]) while (isalnum(volumelabel[++i]) || volumelabel[i] == '_'); if (volumelabel[i] != '\0') { - errx(1, "bad volume label. Valid characters are alphanumerics."); + errx(1, "bad volume label. Valid characters " + "are alphanumerics and underscores."); } if (strlen(volumelabel) >= MAXVOLLEN) { errx(1, "bad volume label. Length is longer than %d.", Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Sat Jan 26 22:24:15 2019 (r343482) +++ head/sbin/tunefs/tunefs.c Sat Jan 26 22:27:12 2019 (r343483) @@ -191,9 +191,8 @@ main(int argc, char *argv[]) i = -1; while (isalnum(Lvalue[++i]) || Lvalue[i] == '_'); if (Lvalue[i] != '\0') { - errx(10, - "bad %s. Valid characters are alphanumerics.", - name); + errx(10, "bad %s. Valid characters are " + "alphanumerics and underscores.", name); } if (strlen(Lvalue) >= MAXVOLLEN) { errx(10, "bad %s. Length is longer than %d.", From owner-svn-src-head@freebsd.org Sat Jan 26 23:09:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECA6D14B1DF7; Sat, 26 Jan 2019 23:09:06 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 687EA7173D; Sat, 26 Jan 2019 23:09:06 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id x0QN92C5059454; Sun, 27 Jan 2019 02:09:02 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Sun, 27 Jan 2019 02:09:02 +0300 (MSK) From: Dmitry Morozovsky To: Kirk McKusick cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343483 - in head/sbin: newfs tunefs In-Reply-To: <201901262227.x0QMRCbv034408@repo.freebsd.org> Message-ID: References: <201901262227.x0QMRCbv034408@repo.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Sun, 27 Jan 2019 02:09:02 +0300 (MSK) X-Rspamd-Queue-Id: 687EA7173D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.971,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 23:09:07 -0000 Kirk, On Sat, 26 Jan 2019, Kirk McKusick wrote: > Author: mckusick > Date: Sat Jan 26 22:27:12 2019 > New Revision: 343483 > URL: https://svnweb.freebsd.org/changeset/base/343483 > > Log: > Update tunefs and newfs error messages for the -L (volume label) option > to note that underscores are valid. while you're here -- most of FSes also allow dash as a valid symbol in FS name. I stepped on it several times, and even did some local patch, but was too lazy to sumbit it. could you please look into it? thanks! > > PR: 235182 > Reported by: Rodney W. Grimes (rgrimes@) > Sponsored by: Netflix > > Modified: > head/sbin/newfs/newfs.c > head/sbin/tunefs/tunefs.c > > Modified: head/sbin/newfs/newfs.c > ============================================================================== > --- head/sbin/newfs/newfs.c Sat Jan 26 22:24:15 2019 (r343482) > +++ head/sbin/newfs/newfs.c Sat Jan 26 22:27:12 2019 (r343483) > @@ -155,7 +155,8 @@ main(int argc, char *argv[]) > while (isalnum(volumelabel[++i]) || > volumelabel[i] == '_'); > if (volumelabel[i] != '\0') { > - errx(1, "bad volume label. Valid characters are alphanumerics."); > + errx(1, "bad volume label. Valid characters " > + "are alphanumerics and underscores."); > } > if (strlen(volumelabel) >= MAXVOLLEN) { > errx(1, "bad volume label. Length is longer than %d.", > > Modified: head/sbin/tunefs/tunefs.c > ============================================================================== > --- head/sbin/tunefs/tunefs.c Sat Jan 26 22:24:15 2019 (r343482) > +++ head/sbin/tunefs/tunefs.c Sat Jan 26 22:27:12 2019 (r343483) > @@ -191,9 +191,8 @@ main(int argc, char *argv[]) > i = -1; > while (isalnum(Lvalue[++i]) || Lvalue[i] == '_'); > if (Lvalue[i] != '\0') { > - errx(10, > - "bad %s. Valid characters are alphanumerics.", > - name); > + errx(10, "bad %s. Valid characters are " > + "alphanumerics and underscores.", name); > } > if (strlen(Lvalue) >= MAXVOLLEN) { > errx(10, "bad %s. Length is longer than %d.", > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@freebsd.org Sat Jan 26 23:28:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9807814B29F3; Sat, 26 Jan 2019 23:28:25 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0068D72476; Sat, 26 Jan 2019 23:28:25 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [76.77.180.168] (port=52601 helo=[192.168.86.32]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gnWcE-000GoJ-Jl; Sat, 26 Jan 2019 14:39:54 -0800 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r343480 - head/lib/libfigpar From: Devin Teske X-Mailer: iPhone Mail (15D60) In-Reply-To: <010001688c2cfc3e-e319d851-8b9e-4468-8bd1-f93331f35116-000000@email.amazonses.com> Date: Sat, 26 Jan 2019 15:28:22 -0800 Cc: rgrimes@freebsd.org, Stefan Esser , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <75F63D9C-0EF2-40EB-BDC6-A2ADFD3C3A89@freebsd.org> References: <201901262136.x0QLaAJv095518@pdx.rh.CN85.dnsmgr.net> <010001688c2cfc3e-e319d851-8b9e-4468-8bd1-f93331f35116-000000@email.amazonses.com> To: Colin Percival Sender: devin@shxd.cx X-Rspamd-Queue-Id: 0068D72476 X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [4.62 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; IP_SCORE(0.21)[ip: (0.59), ipnet: 64.201.240.0/20(0.30), asn: 36734(0.24), country: US(-0.08)]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.93)[0.928,0]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.83)[0.826,0]; MX_GOOD(-0.01)[cached: mail.shxd.cx]; NEURAL_SPAM_LONG(0.97)[0.970,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[dteske@freebsd.org,devin@shxd.cx]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:36734, ipnet:64.201.240.0/20, country:US]; FROM_NEQ_ENVFROM(0.00)[dteske@freebsd.org,devin@shxd.cx]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 23:28:25 -0000 > On 26 Jan 2019, at 1:59 PM, Colin Percival wrote: >=20 > On 1/26/19 1:36 PM, Rodney W. Grimes wrote: >>> Author: se >>> Date: Sat Jan 26 21:30:26 2019 >>> New Revision: 343480 >>> URL: https://svnweb.freebsd.org/changeset/base/343480 >>>=20 >>> Log: >>> Silence Clang Scan warning about potentially unsafe use of strcpy. >>>=20 >>> While this is a false positive, the use of strdup() simplifies the code= . >>=20 >> Though that might be true, it also has to recalculate the >> length of the string which was already known by slen. >>=20 >> I am not sure how often this code is called, >> but that is wasted cycles in a library. >=20 > The length of the string was already being recalculated, by strcpy. >=20 > It seems to me that this could be written as >=20 > temp =3D malloc(slen + 1); > if (temp =3D=3D NULL) /* could not allocate memory */ > return (-1); > memcpy(temp, source, slen + 1); >=20 > which avoids both recalculating the string length and using strcpy? >=20 Thanks for fixing that. =E2=80=94=20 Cheers, Devin >>> Modified: head/lib/libfigpar/string_m.c >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D >>> --- head/lib/libfigpar/string_m.c Sat Jan 26 20:43:28 2019 (r34347= 9) >>> +++ head/lib/libfigpar/string_m.c Sat Jan 26 21:30:26 2019 (r34348= 0) >>> @@ -119,10 +119,9 @@ replaceall(char *source, const char *find, const ch= ar=20 >>>=20 >>> /* If replace is longer than find, we'll need to create a temp copy *= / >>> if (rlen > flen) { >>> - temp =3D malloc(slen + 1); >>> - if (errno !=3D 0) /* could not allocate memory */ >>> + temp =3D strdup(source); >>> + if (temp =3D=3D NULL) /* could not allocate memory */ >>> return (-1); >>> - strcpy(temp, source); >>> } else >>> temp =3D source;