svn commit: r343249 - head/sbin/devd

2019-01-20 Thread Andriy Voskoboinyk
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=).
  (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.confMon Jan 21 04:10:45 2019(r343248)
+++ head/sbin/devd/devd.confMon 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";
 };
___
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-unsubscr...@freebsd.org"


Re: svn commit: r343247 - head/usr.bin/cmp/tests

2019-01-20 Thread Enji Cooper

> 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


signature.asc
Description: Message signed with OpenPGP


Re: svn commit: r343247 - head/usr.bin/cmp/tests

2019-01-20 Thread Mark Johnston
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.
___
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-unsubscr...@freebsd.org"


Re: svn commit: r343247 - head/usr.bin/cmp/tests

2019-01-20 Thread Enji Cooper

> 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


signature.asc
Description: Message signed with OpenPGP


svn commit: r343247 - head/usr.bin/cmp/tests

2019-01-20 Thread Mark Johnston
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
___
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-unsubscr...@freebsd.org"


svn commit: r343245 - head/usr.bin/cmp

2019-01-20 Thread Mark Johnston
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();
+   if (caph_rights_limit(STDIN_FILENO, ) < 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();
 
___
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-unsubscr...@freebsd.org"


svn commit: r343244 - head/sbin/devd

2019-01-20 Thread Andriy Voskoboinyk
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.confMon Jan 21 03:01:41 2019(r343243)
+++ head/sbin/devd/devd.confMon 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
___
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-unsubscr...@freebsd.org"


svn commit: r343240 - head/sys/dev/iwm

2019-01-20 Thread Kyle Evans
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
___
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-unsubscr...@freebsd.org"


svn commit: r343238 - head/sys/dev/usb/wlan

2019-01-20 Thread Andriy Voskoboinyk
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, , 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_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)
+++ 

svn commit: r343235 - head/sys/dev/iwn

2019-01-20 Thread Andriy Voskoboinyk
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 voidiwn4965_attach(struct iwn_softc *, uint16_t);
+static voidiwn5000_attach(struct iwn_softc *, uint16_t);
 static int iwn_config_specific(struct iwn_softc *, uint16_t);
 static voidiwn_radiotap_attach(struct iwn_softc *);
 static voidiwn_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 = >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 = >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__);
 }
 
 /*
___
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-unsubscr...@freebsd.org"


svn commit: r343234 - head/sys/dev/usb/wlan

2019-01-20 Thread Andriy Voskoboinyk
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_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 

svn commit: r343225 - head/stand/mips/beri/boot2

2019-01-20 Thread Oleksandr Tymoshenko
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();
+}
___
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-unsubscr...@freebsd.org"


svn commit: r343233 - head/sys/dev/cxgbe

2019-01-20 Thread Navdeep Parhar
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), >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);
}
___
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-unsubscr...@freebsd.org"


svn commit: r343231 - in head: bin/csh bin/sh share/skel

2019-01-20 Thread Edward Tomasz Napierala
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
___
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-unsubscr...@freebsd.org"


svn commit: r343232 - head/tools/build/mk

2019-01-20 Thread Oleksandr Tymoshenko
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
 

svn commit: r343224 - in head/sys/dev/usb: . quirk

2019-01-20 Thread Oleksandr Tymoshenko
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: dgilb...@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, 0x, 0x, UQ_NO_STRINGS),
+   USB_QUIRK(LOGITECH, G510S, 0x, 0x, UQ_KBD_BOOTPROTO),
USB_QUIRK(REALTEK, RTL8196EU, 0x, 0x, UQ_CFG_INDEX_1),
USB_QUIRK(ELSA, MODEM1, 0x, 0x, UQ_CFG_INDEX_1),
USB_QUIRK(PLANEX2, MZKUE150N, 0x, 0x, UQ_CFG_INDEX_1),

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsSun Jan 20 19:55:54 2019(r343223)
+++ head/sys/dev/usb/usbdevsSun Jan 20 20:29:26 2019(r343224)
@@ -2842,6 +2842,7 @@ product LOGITECH UN58A0xc030  iFeel Mouse
 product LOGITECH UN53B 0xc032  iFeel MouseMan
 product LOGITECH WMPAD 0xc208  WingMan GamePad Extreme
 product LOGITECH WMRPAD0xc20a  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
___
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-unsubscr...@freebsd.org"


svn commit: r343222 - head/usr.bin/systat

2019-01-20 Thread Oleksandr Tymoshenko
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
___
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-unsubscr...@freebsd.org"


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

2019-01-20 Thread Andriy Voskoboinyk
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
 optionsIEEE80211_DEBUG # enable debug msgs
-optionsIEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
 optionsIEEE80211_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/RK3188Sun Jan 20 15:00:15 2019(r343218)
+++ head/sys/arm/conf/RK3188Sun Jan 20 15:17:56 2019(r343219)
@@ -79,7 +79,6 @@ devicebpf
 
 # Wireless NIC cards
 optionsIEEE80211_DEBUG
-optionsIEEE80211_AMPDU_AGE
 optionsIEEE80211_SUPPORT_MESH
 optionsIEEE80211_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
 optionsIEEE80211_DEBUG #enable debugging msgs
-optionsIEEE80211_AMPDU_AGE #age frames in AMPDU reorder q's
 optionsIEEE80211_SUPPORT_MESH  #enable 802.11s D3.0 support
 optionsIEEE80211_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_BACKTRACEopt_hwpmc_hooks.h
 # 802.11 support layer
 IEEE80211_DEBUGopt_wlan.h
 IEEE80211_DEBUG_REFCNT opt_wlan.h
-IEEE80211_AMPDU_AGEopt_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
 optionsIEEE80211_DEBUG # enable debug msgs
-optionsIEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's
 optionsIEEE80211_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  

svn commit: r343223 - head/usr.bin/systat

2019-01-20 Thread Oleksandr Tymoshenko
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);
}
 
/*
___
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-unsubscr...@freebsd.org"


Re: svn commit: r343213 - in head/sys: net80211 sys

2019-01-20 Thread Andriy Voskoboinyk
Sun, 20 Jan 2019 16:02:08 +0200 було написано 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 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?




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’t  
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

___
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-unsubscr...@freebsd.org"


svn commit: r343215 - head/bin/sh

2019-01-20 Thread Jilles Tjoelker
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);
___
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-unsubscr...@freebsd.org"


Re: svn commit: r343213 - in head/sys: net80211 sys

2019-01-20 Thread 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 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
___
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-unsubscr...@freebsd.org"


svn commit: r343213 - in head/sys: net80211 sys

2019-01-20 Thread Andriy Voskoboinyk
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_vaps)) != NULL)
+   while ((vap = TAILQ_FIRST(>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)
}
 }
 
+#defineMS(_v, _f)  (((_v) & _f##_M) >> _f##_S)
+int
+ieee80211_com_vincref(struct ieee80211vap *vap)
+{
+   uint32_t ostate;
+
+   ostate = atomic_fetchadd_32(>iv_com_state, IEEE80211_COM_REF_ADD);
+
+   if (ostate & IEEE80211_COM_DETACHED) {
+   atomic_subtract_32(>iv_com_state, IEEE80211_COM_REF_ADD);
+   return (ENETDOWN);
+   }
+
+   if (MS(ostate, IEEE80211_COM_REF) == IEEE80211_COM_REF_MAX) {
+   atomic_subtract_32(>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(>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(>iv_com_state, IEEE80211_COM_DETACHED);
+   while (MS(atomic_load_32(>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;
+intieee80211_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
 #defineieee80211_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
==
--- 

svn commit: r343209 - head/sys/fs/smbfs

2019-01-20 Thread Oleksandr Tymoshenko
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: t...@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;
 
___
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-unsubscr...@freebsd.org"