]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoFix prompt for MFSROOT in tinybsd
gonzo [Thu, 24 Jan 2019 06:34:29 +0000 (06:34 +0000)]
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 <brock@cotcomsol.com>
MFC after: 1 week

5 years agoiwm - Remove unused TX_CMD_NEXT_FRAME_*
kevans [Thu, 24 Jan 2019 03:50:27 +0000 (03:50 +0000)]
iwm - Remove unused TX_CMD_NEXT_FRAME_*

Taken-From: Linux git b1e06c65fb69c5e3fddcd91987561e225eaa9bfa

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (b0c6116f364a121ab6b9d634ca1997d4167fa747)

5 years agoiwm - Remove unused REPLY_MAX
kevans [Thu, 24 Jan 2019 03:50:03 +0000 (03:50 +0000)]
iwm - Remove unused REPLY_MAX

Taken-From: Linux git e4eb275ac5cfe71686612d929a9829345b2a4ada

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (92a727c99d6ec5abf14bb6853e95e3a187a0cd4e)

5 years agoiwm - Update alive response handling, add v4 and remove old versions.
kevans [Thu, 24 Jan 2019 03:49:35 +0000 (03:49 +0000)]
iwm - Update alive response handling, add v4 and remove old versions.

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (3820e2bf3331ced3541d1811a38c5a5136dfab93)

5 years agoiwm - Fix race during detach, where a callout is left after driver is gone.
kevans [Thu, 24 Jan 2019 03:49:11 +0000 (03:49 +0000)]
iwm - Fix race during detach, where a callout is left after driver is gone.

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (ba3b4ff9a1fc04a349df05d6d3449f4d9b15c4be)

5 years agoif_iwm - Stop iwm_watchdog callout when idle.
kevans [Thu, 24 Jan 2019 03:48:50 +0000 (03:48 +0000)]
if_iwm - Stop iwm_watchdog callout when idle.

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (6a8683b0e9d734f23bd9647e117da198c2b9a74e)

5 years agoiwm - Always clear watchdog timer, when bringing down firmware state.
kevans [Thu, 24 Jan 2019 03:48:27 +0000 (03:48 +0000)]
iwm - Always clear watchdog timer, when bringing down firmware state.

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (8abdc2b36a45c4e9c95fc8263ca532ea26633dcb)

5 years agoiwm - Clear Time Event active state, when receiving End Notification.
kevans [Thu, 24 Jan 2019 03:47:47 +0000 (03:47 +0000)]
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 <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (e8cb71584a6a72232c13151d60e57f7f229220eb)

5 years agoiwm - Improve firmware Time Event handling.
kevans [Thu, 24 Jan 2019 03:47:04 +0000 (03:47 +0000)]
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 <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (706a3044afd27c3fecfdf57bec1695310e53e228)

5 years agoiwm - Avoid Tx watchdog timeout, when dropping a connection.
kevans [Thu, 24 Jan 2019 03:46:35 +0000 (03:46 +0000)]
iwm - Avoid Tx watchdog timeout, when dropping a connection.

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (3e12596fb5c55351517cdd741d72979388a8c75c)

5 years agoiwm - Track firmware state better, and improve handling in iwm_newstate().
kevans [Thu, 24 Jan 2019 03:45:55 +0000 (03:45 +0000)]
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 <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (8a41b10ac639d0609878696808387a6799d39b57)

5 years agoif_iwm - Add firmware API definitions for TX power commands.
kevans [Thu, 24 Jan 2019 03:45:24 +0000 (03:45 +0000)]
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 <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (fd4f9de8bc72ea961e50829b45b59d0549040b7d)

5 years agoif_iwm - Configure the PCIe LTR, fix PCI express capability accesses.
kevans [Thu, 24 Jan 2019 03:44:48 +0000 (03:44 +0000)]
if_iwm - Configure the PCIe LTR, fix PCI express capability accesses.

Taken-From: Linux iwlwifi

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (08a7ad5a5ff65aaaf2df6a609be7a4e1df43efc3)

5 years agoif_iwm - Update struct iwm_scan_results_notif. Remove old/unused definitions
kevans [Thu, 24 Jan 2019 03:44:20 +0000 (03:44 +0000)]
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 <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (c947b0b8dc96dabefd63f7b70d53695e36c7b64f)

5 years agoiwm - Reduce gratuitous differences with Linux iwlwifi in struct naming.
kevans [Thu, 24 Jan 2019 03:43:45 +0000 (03:43 +0000)]
iwm - Reduce gratuitous differences with Linux iwlwifi in struct naming.

* Rename some structs and struct members for firmware handling.

Submitted by: Augustin Cavalier <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (4b1006a6e4d0f61d48c67b46e1f791e30837db67)

5 years agoif_iwm - Check sc->sc_attached flag in suspend/resume callbacks.
kevans [Thu, 24 Jan 2019 03:42:59 +0000 (03:42 +0000)]
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 <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (67b5e090efb225654815fed91020db6cfc16bb19)

5 years agoif_iwm - Move iwm_read_firmware() call into iwm_attach().
kevans [Thu, 24 Jan 2019 03:42:23 +0000 (03:42 +0000)]
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 <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (0104ee1f4cb6a2313c00c2526c6ae98d42e5041d)

5 years agoif_iwm - The iwm_prepare_card_hw() in iwm_attach() is only needed on 8K hw.
kevans [Thu, 24 Jan 2019 03:41:44 +0000 (03:41 +0000)]
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 <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (e8560f8dc58df12a7c79a6bb4e6ccb156e001085)

5 years agoif_iwm - Update firmware rs table, instead of indexing the table in tx cmds.
kevans [Thu, 24 Jan 2019 03:41:09 +0000 (03:41 +0000)]
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 <waddlesplash@gmail.com> (Haiku)
Obtained from: DragonFlyBSD (5d6b465e288ac5b52d7115688d4e6516acbbea1c)

5 years agoixl(4): Fix handling data passed with ioctl from NVM update tool
erj [Thu, 24 Jan 2019 01:08:37 +0000 (01:08 +0000)]
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 <krzysztof.galazka@intel.com>
Reported by: Finn <ixbug@riseup.net>
MFC after: 5 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D18817

5 years agointel iflib drivers: correct initialization of tx_cidx_processed
erj [Thu, 24 Jan 2019 01:03:00 +0000 (01:03 +0000)]
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 <jacob.e.keller@intel.com>
Reviewed by: shurd@
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D18545

5 years agoFix up r343367
ngie [Wed, 23 Jan 2019 23:48:57 +0000 (23:48 +0000)]
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

5 years agoUnbreak the build on architectures where size_t isn't synonymous with uintmax_t
ngie [Wed, 23 Jan 2019 23:30:55 +0000 (23:30 +0000)]
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

5 years agoRemove documentation for the nonexistant cred_update_thread(9).
brooks [Wed, 23 Jan 2019 23:25:42 +0000 (23:25 +0000)]
Remove documentation for the nonexistant cred_update_thread(9).

This was a tangential change submitted as part of D18930.

Submitted by: jack@gandi.net

5 years agoUnbreak the gcc build with sendfile_test after r343362
ngie [Wed, 23 Jan 2019 23:06:39 +0000 (23:06 +0000)]
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

5 years agoStyle.
markj [Wed, 23 Jan 2019 22:19:49 +0000 (22:19 +0000)]
Style.

Reviewed by: bz
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agoFix an LLE lookup race.
markj [Wed, 23 Jan 2019 22:18:23 +0000 (22:18 +0000)]
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 <chernov_victor@list.ru>,
Mike Andrews <mandrews@bit0.com>
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18906

5 years agoAdd [initial] functional tests for sendfile(2) as lib/libc/sys/sendfile
ngie [Wed, 23 Jan 2019 22:00:17 +0000 (22:00 +0000)]
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

5 years agoRemove extraneous setutxent() calls in write(1).
markj [Wed, 23 Jan 2019 20:02:17 +0000 (20:02 +0000)]
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

5 years agoCorrect uma_prealloc()'s use of domainset iterators after r339925.
markj [Wed, 23 Jan 2019 18:58:15 +0000 (18:58 +0000)]
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

5 years agoAdd USB quirk.
hselasky [Wed, 23 Jan 2019 18:53:13 +0000 (18:53 +0000)]
Add USB quirk.

Submitted by: Gary Jennejohn <gljennjohn@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoFixed issues reported by coverity scan.
ram [Wed, 23 Jan 2019 17:34:01 +0000 (17:34 +0000)]
Fixed issues reported by coverity scan.

Approved by: mav
MFC after: 3 weeks

5 years agoocs_fc: Ensure that we zero-initialize memory before copying it out.
markj [Wed, 23 Jan 2019 17:28:39 +0000 (17:28 +0000)]
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 <vlad@tsyrklevich.net>
Reviewed by: emaste, ram
MFC after: 1 day
Security: Kernel memory disclosure
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18914

5 years agogmirror: Relocate DEVICE_FLAGS to adjacent lines
cem [Wed, 23 Jan 2019 16:44:21 +0000 (16:44 +0000)]
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

5 years agonetmap: improvements to the netmap kloop (CSB mode)
vmaffione [Wed, 23 Jan 2019 14:51:36 +0000 (14:51 +0000)]
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

5 years agonetmap: fix knote() argument to match the mutex state
vmaffione [Wed, 23 Jan 2019 14:21:23 +0000 (14:21 +0000)]
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 <aleksandr.fedorov@itglobal.com>
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D18876

5 years agonet80211: turn channel mode check into assertion.
avos [Wed, 23 Jan 2019 13:17:03 +0000 (13:17 +0000)]
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

5 years agoifconfig: drop unused macros from ifieee80211.c
avos [Wed, 23 Jan 2019 13:07:05 +0000 (13:07 +0000)]
ifconfig: drop unused macros from ifieee80211.c

MFC after: 5 days

5 years agonet80211: fix channel list construction for non-auto operating mode.
avos [Wed, 23 Jan 2019 12:43:46 +0000 (12:43 +0000)]
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

5 years agoSilence Clang Scan warning about use of unitialized variable.
se [Wed, 23 Jan 2019 10:05:27 +0000 (10:05 +0000)]
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

5 years agoFix systat's :only command parser for the multiple arguments case
gonzo [Wed, 23 Jan 2019 02:46:35 +0000 (02:46 +0000)]
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 <andyf@speednet.com.au>
MFC after: 1 week

5 years agolibbe(3): simplify import, allow replication streams
kevans [Wed, 23 Jan 2019 02:09:15 +0000 (02:09 +0000)]
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 <freebsd@mhka.no>
MFC after: 1 week

5 years agoAdd quirk to enable mic and headphones redirection on HP Spectre laptops.
wulf [Tue, 22 Jan 2019 22:39:46 +0000 (22:39 +0000)]
Add quirk to enable mic and headphones redirection on HP Spectre laptops.

Tested on HP AF006UR.

MFC after: 2 weeks

5 years agoRework CASE_IOC_IFGROUPREQ() to require a case before the macro.
brooks [Tue, 22 Jan 2019 17:39:26 +0000 (17:39 +0000)]
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

5 years agoSilence a CI warning regarding the use of strcpy().
se [Tue, 22 Jan 2019 13:11:15 +0000 (13:11 +0000)]
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

5 years agoRemove unused *_sysinit_flags() declarations.
kib [Tue, 22 Jan 2019 12:56:49 +0000 (12:56 +0000)]
Remove unused *_sysinit_flags() declarations.

Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 3 days

5 years agoAdd missing dependency to vmxnet3 Makefile and clean it up a bit otherwise.
pkelsey [Tue, 22 Jan 2019 04:36:19 +0000 (04:36 +0000)]
Add missing dependency to vmxnet3 Makefile and clean it up a bit otherwise.

MFC after: 1 week

5 years ago[ndis] Fix unregistered use of FPU by NDIS in kernel on amd64
gonzo [Tue, 22 Jan 2019 03:53:42 +0000 (03:53 +0000)]
[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 <vladislav.movchan@gmail.com>
MFC after: 1 month

5 years agopf tests: Check size validation in DIOCGETSRCNODES
kp [Tue, 22 Jan 2019 02:56:36 +0000 (02:56 +0000)]
pf tests: Check size validation in DIOCGETSRCNODES

Ensure that invalid sizes for DIOCGETSRCNODES do not cause panics.

MFC after:  1 week

5 years agoRemove unused function gsc_destroy()
pkelsey [Tue, 22 Jan 2019 02:53:59 +0000 (02:53 +0000)]
Remove unused function gsc_destroy()

gsc_destroy() is no longer needed as of r343287.

MFC after: 1 week

5 years agopf: Validate psn_len in DIOCGETSRCNODES
kp [Tue, 22 Jan 2019 02:13:33 +0000 (02:13 +0000)]
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

5 years agoiwn(4): drop i_seq field initialization for A-MPDU frames.
avos [Tue, 22 Jan 2019 01:44:47 +0000 (01:44 +0000)]
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

5 years agoonvert vmx(4) to being an iflib driver.
pkelsey [Tue, 22 Jan 2019 01:11:17 +0000 (01:11 +0000)]
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.<index>.iflib.tx_abdicate=1.

Reviewed by: shurd
MFC after: 1 week
Relnotes: yes
Sponsored by: RG Nets
Differential Revision: https://reviews.freebsd.org/D18761

5 years agoFix various resource leaks that can occur in the error paths of
pkelsey [Tue, 22 Jan 2019 00:56:44 +0000 (00:56 +0000)]
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

5 years agoReduce pf.conf parsing cost for configs that define N queues from O(N^2) to O(N)
pkelsey [Tue, 22 Jan 2019 00:50:24 +0000 (00:50 +0000)]
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

5 years agonfs: Zero the buffers exported by NFSSVC_DUMPCLIENTS and DUMPLOCKS.
markj [Mon, 21 Jan 2019 23:54:33 +0000 (23:54 +0000)]
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 <vlad@tsyrklevich.net>
Reviewed by: rmacklem
MFC after: 1 day
Security: Kernel memory disclosure
Sponsored by: The FreeBSD Foundation

5 years agoList caph_limit_stream() in the synopsis.
markj [Mon, 21 Jan 2019 20:56:29 +0000 (20:56 +0000)]
List caph_limit_stream() in the synopsis.

Fix typos while here.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agoOptimize RISC-V copyin(9)/copyout(9) routines.
markj [Mon, 21 Jan 2019 19:38:53 +0000 (19:38 +0000)]
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 <mhorne063@gmail.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18851

5 years agoDeduplicate common code in copyin()/copyout() with a macro.
markj [Mon, 21 Jan 2019 19:37:12 +0000 (19:37 +0000)]
Deduplicate common code in copyin()/copyout() with a macro.

No functional change intended.

Submitted by: Mitchell Horne <mhorne063@gmail.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18850

5 years agofreebsd-update: Allow upgrade from pre-release builds
emaste [Mon, 21 Jan 2019 19:21:11 +0000 (19:21 +0000)]
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 <aryeeteygerald_rogers.com>
Reported by: delphij, des
Reviewed by: delphij
MFC with: r343122
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18881

5 years agofreebsd-update: Update /etc/passwd after password db changes
emaste [Mon, 21 Jan 2019 19:04:37 +0000 (19:04 +0000)]
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 <aryeeteygerald_rogers.com>
Reviewed by: jilles
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18827

5 years agocxgbe(4): Allow negative values in hw.cxgbe.fw_install and take them to
np [Mon, 21 Jan 2019 18:42:16 +0000 (18:42 +0000)]
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

5 years agofrebsd-update: fix --currently-running after r343122
emaste [Mon, 21 Jan 2019 18:41:57 +0000 (18:41 +0000)]
frebsd-update: fix --currently-running after r343122

PR: 234771
Submitted by: Gerald Aryeetey <aryeeteygerald_rogers.com>
Reported by: Brandon Schneider
MFC with: r343122
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18896

5 years agohwpmc: Plug memory disclosures from PMC_OP_{GETPMCINFO,GETCPUINFO}.
markj [Mon, 21 Jan 2019 18:07:02 +0000 (18:07 +0000)]
hwpmc: Plug memory disclosures from PMC_OP_{GETPMCINFO,GETCPUINFO}.

admbugs: 765
Reported by: Vlad Tsyrklevich <vlad@tsyrklevich.net>
MFC after: 1 day
Security: Kernel memory disclosure
Sponsored by: The FreeBSD Foundation

5 years agocxgbe(4): Use a truncated firmware header for version checks. All the
np [Mon, 21 Jan 2019 17:58:06 +0000 (17:58 +0000)]
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

5 years agolinuxulator: fix stack memory disclosure in linux_sigaltstack
emaste [Mon, 21 Jan 2019 17:12:16 +0000 (17:12 +0000)]
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 <vlad@tsyrklevich.net>
Reviewed by: Andrew
MFC after: 1 day
Security: Kernel stack memory disclosure
Sponsored by: The FreeBSD Foundation

5 years agolinuxulator: fix stack memory disclosure in linux_sigaltstack
emaste [Mon, 21 Jan 2019 16:25:40 +0000 (16:25 +0000)]
linuxulator: fix stack memory disclosure in linux_sigaltstack

admbugs: 765
Reported by: Vlad Tsyrklevich <vlad@tsyrklevich.net>
Reviewed by: andrew
MFC after: 1 day
Security: Kernel memory disclosure
Sponsored by:   The FreeBSD Foundation

5 years agolinuxulator: fix stack memory disclosure in linux_ioctl_termio
emaste [Mon, 21 Jan 2019 16:21:03 +0000 (16:21 +0000)]
linuxulator: fix stack memory disclosure in linux_ioctl_termio

admbugs: 765
Reported by: Vlad Tsyrklevich <vlad@tsyrklevich.net>
Reviewed by: andrew
MFC after: 1 day
Security: Kernel stack memory disclosure
Sponsored by: The FreeBSD Foundation

5 years agolinuxulator: fix stack memory disclosure in linux_ioctl_v4l
emaste [Mon, 21 Jan 2019 16:19:02 +0000 (16:19 +0000)]
linuxulator: fix stack memory disclosure in linux_ioctl_v4l

admbugs: 765
Reported by: Vlad Tsyrklevich <vlad@tsyrklevich.net>
Reviewed by: andrew
MFC after: 1 day
Security: Kernel stack memory disclosure
Sponsored by: The FreeBSD Foundation

5 years agoCorrect a typo: was -> way.
gjb [Mon, 21 Jan 2019 15:27:58 +0000 (15:27 +0000)]
Correct a typo: was -> way.

Submitted by: Larry Hynes
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agoawg: fix soft reset failure with no link
kevans [Mon, 21 Jan 2019 14:35:36 +0000 (14:35 +0000)]
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

5 years agoFix duplicate wpa_supplicant(8) / hostapd(8) startup with devd(8)
avos [Mon, 21 Jan 2019 04:50:56 +0000 (04:50 +0000)]
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

5 years agoFix cmp(1) tests for "special" mode.
markj [Mon, 21 Jan 2019 03:57:49 +0000 (03:57 +0000)]
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

5 years agoRevert r343117.
markj [Mon, 21 Jan 2019 03:47:20 +0000 (03:47 +0000)]
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

5 years agodevd.conf(5): add otus(4) into wifi-driver-regex
avos [Mon, 21 Jan 2019 03:38:37 +0000 (03:38 +0000)]
devd.conf(5): add otus(4) into wifi-driver-regex

MFC after: 5 days

5 years agoiwm(4): Fix possible null pointer indirection
kevans [Mon, 21 Jan 2019 01:45:35 +0000 (01:45 +0000)]
iwm(4): Fix possible null pointer indirection

Obtained from: DragonFlyBSD (obtained from Haiku)
MFC after: 1 week

5 years agourtw(4): add length checks in Rx path.
avos [Mon, 21 Jan 2019 00:53:38 +0000 (00:53 +0000)]
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

5 years agoiwn(4): drop return code from iwn_*attach functions (they cannot fail)
avos [Mon, 21 Jan 2019 00:09:54 +0000 (00:09 +0000)]
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

5 years agorun(4): add more length checks in Rx path.
avos [Mon, 21 Jan 2019 00:03:35 +0000 (00:03 +0000)]
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

5 years agocxgbe(4): Clear the reply-pending status of a hashfilter when the reply
np [Sun, 20 Jan 2019 23:30:16 +0000 (23:30 +0000)]
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

5 years agoAdd more profile-enabled libraries to remove when WITHOUT_PROFILE is defined
gonzo [Sun, 20 Jan 2019 22:34:04 +0000 (22:34 +0000)]
Add more profile-enabled libraries to remove when WITHOUT_PROFILE is defined

PR: 230898
Submitted by: Herbert J. Skuhra <herbert@mailbox.org>
MFC after: 1 week

5 years agoDon't mess with BLOCKSIZE in shell startup files - it's set by login.conf(5);
trasz [Sun, 20 Jan 2019 22:08:49 +0000 (22:08 +0000)]
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

5 years agoUnbreak mip64 build after r328437
gonzo [Sun, 20 Jan 2019 21:09:44 +0000 (21:09 +0000)]
Unbreak mip64 build after r328437

Add exit and getchar functions to beri/boot2 code. They are required by
panic_action functin introduced in r328437

5 years agoAdd KBD_BOOTPROTO quirk for Logitech G510s USB keyboard
gonzo [Sun, 20 Jan 2019 20:29:26 +0000 (20:29 +0000)]
Add KBD_BOOTPROTO quirk for Logitech G510s USB keyboard

PR: 232136
Submitted by: dgilbert@eicat.ca
MFC after: 1 week

5 years agoFix inconsistency in return values introduced by r343222
gonzo [Sun, 20 Jan 2019 19:55:54 +0000 (19:55 +0000)]
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

5 years agoFix crash in systat(4) when certain commands are called without arguments
gonzo [Sun, 20 Jan 2019 19:47:33 +0000 (19:47 +0000)]
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 <mt@markoturk.info>
MFC after: 1 week

5 years agoRemove IEEE80211_AMPDU_AGE config option.
avos [Sun, 20 Jan 2019 15:17:56 +0000 (15:17 +0000)]
Remove IEEE80211_AMPDU_AGE config option.

It is noop since r297774.

5 years agosh: Send libedit "ferr" output to fd 2
jilles [Sun, 20 Jan 2019 14:25:25 +0000 (14:25 +0000)]
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.

5 years agonet80211: resolve ioctl <-> detach race for ieee80211com structure
avos [Sun, 20 Jan 2019 13:39:18 +0000 (13:39 +0000)]
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

5 years ago[smbfs] Allow semicolon in mounts that support long names
gonzo [Sun, 20 Jan 2019 05:52:16 +0000 (05:52 +0000)]
[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

5 years ago[ifconfig] Print more WPS attributes in verbose "list scan" output
gonzo [Sun, 20 Jan 2019 00:45:44 +0000 (00:45 +0000)]
[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 <fbsd@opal.com>
MFC after: 3 weeks

5 years agoixgbe: this statement may fall through warnings with gcc
tsoome [Sat, 19 Jan 2019 20:45:41 +0000 (20:45 +0000)]
ixgbe: this statement may fall through warnings with gcc

The recent gcc versions (7 and 8 at least) can check for switch case
statements for fall through (implicit-fallthrough). When fall through
is intentional, the default method for warning suppression is to place
comment /* FALLTHROUGH */ exactly before next case statement.

Differential Revision: https://reviews.freebsd.org/D18577

5 years agonet80211: drop m_pullup call from ieee80211_crypto_decap.
avos [Sat, 19 Jan 2019 16:04:26 +0000 (16:04 +0000)]
net80211: drop m_pullup call from ieee80211_crypto_decap.

For most wireless drivers Rx mbuf is allocated as one
contiguous chunk; only few are using chains for allocations -
but even then at least MCLBYTES (minus Rx descriptor size) is
available in the first mbuf.

In addition to the above, m_pullup was never called here - otherwise,
reallocation will break post-crypto_decap logic (ieee80211_decap,
ieee80211_deliver_data...), so just remove it; length check is left
in case if some truncated frame appears here.

PR: 234241
MFC after: 1 week

5 years ago[aic7xxx] Use correct product name 29320LPE instead of non-existent 39320LPE
gonzo [Sat, 19 Jan 2019 05:31:48 +0000 (05:31 +0000)]
[aic7xxx] Use correct product name 29320LPE instead of non-existent 39320LPE

The PCI id belongs to Adaptec 29320LPE controller. The same fix also was
merged[1] to OpenBSD driver ~6 years ago.

[1] https://github.com/openbsd/src/commit/f997b5

PR: 172133
Submitted by: henning.petersen@t-online.de
MFC after:  1 week

5 years agodpaa: fix 32-bit build
jhibbits [Sat, 19 Jan 2019 05:20:31 +0000 (05:20 +0000)]
dpaa: fix 32-bit build

Book-E powerpc uses 64-bit vm_paddr_t, and 32-bit powerpc has 32-bit pointers,
so gcc errors with cast to pointer from integer of different size.  As this will
not actually be used in reality anyway, simply quiet the warning by casting
through uintptr_t.

MFC after: 3 weeks
MFC with: r343168

5 years agopowerpc/dpaa: Handle DMAP virtual addresses in DPAA
jhibbits [Sat, 19 Jan 2019 04:54:12 +0000 (04:54 +0000)]
powerpc/dpaa: Handle DMAP virtual addresses in DPAA

sendfile(2) appears to now use DMAP wherever possible.  These addresses are not
managed by pmap, so pmap_kextract() returns a 0 physical address, causing
failure.

This change fixes nginx running on P5020 SoC.

MFC after: 3 weeks

5 years agopowerpc: Fix opaque irq data initialization
jhibbits [Sat, 19 Jan 2019 04:47:19 +0000 (04:47 +0000)]
powerpc: Fix opaque irq data initialization

The powerpc_intr structure is not zero-initialized, so on an invariants
build would panic in the xics driver with an invalid pointer.  Also fix the
xics driver to share the private data setup code between xics_enable() and
xics_bind().

Reported by: Leonardo Bianconi

5 years agovmm(4): Mask Spectre feature bits on AMD hosts
cem [Fri, 18 Jan 2019 23:54:51 +0000 (23:54 +0000)]
vmm(4): Mask Spectre feature bits on AMD hosts

For parity with Intel hosts, which already mask out the CPUID feature
bits that indicate the presence of the SPEC_CTRL MSR, do the same on
AMD.

Eventually we may want to have a better support story for guests, but
for now, limit the damage of incorrectly indicating an MSR we do not yet
support.

Eventually, we may want a generic CPUID override system for
administrators, or for minimum supported feature set in heterogenous
environments with failover.  That is a much larger scope effort than
this bug fix.

PR: 235010
Reported by: Rys Sommefeldt <rys AT sommefeldt.com>
Sponsored by: Dell EMC Isilon

5 years agoFix top(1) long options handling
jhibbits [Fri, 18 Jan 2019 23:26:31 +0000 (23:26 +0000)]
Fix top(1) long options handling

getopt_long(3) requires the long options be terminated by a NULL block.
Without the terminator, an invalid long option results in a segmentation
fault.

Reported by: Brandon Bergren
MFC after: 1 week

5 years agoClarify error messages a bit.
marck [Fri, 18 Jan 2019 23:00:52 +0000 (23:00 +0000)]
Clarify error messages a bit.

X-Found-With: r343112
MFC after: 1 month