]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
4 years agoMFC r349527,349538:
mm [Thu, 11 Jul 2019 00:22:10 +0000 (00:22 +0000)]
MFC r349527,349538:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1217: RAR5 reader - fix ARM filter going beyond window buffer boundary
            (OSS-Fuzz 15431)
  PR #1218: Fixes to sparse file handling

git-svn-id: svn://svn.freebsd.org/base/stable/10@349901 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r349503-349504:
cy [Fri, 5 Jul 2019 04:24:09 +0000 (04:24 +0000)]
MFC r349503-349504:

Document the -B, binary logfile, and the -C config file options.
Reference the ipmon.5 man page and ipmon.conf.

PR: 238816

git-svn-id: svn://svn.freebsd.org/base/stable/10@349759 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r349505: Upgrade to Bzip2 version 1.0.7.
delphij [Thu, 4 Jul 2019 07:36:09 +0000 (07:36 +0000)]
MFC r349505: Upgrade to Bzip2 version 1.0.7.

git-svn-id: svn://svn.freebsd.org/base/stable/10@349719 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r349409 and r349410:
hselasky [Wed, 3 Jul 2019 18:26:07 +0000 (18:26 +0000)]
MFC r349409 and r349410:
Fix support for LIBUSB_HOTPLUG_ENUMERATE in libusb. Currently all
devices are enumerated regardless of of the LIBUSB_HOTPLUG_ENUMERATE
flag. Make sure when the flag is not specified no arrival events are
generated for currently enumerated devices.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@349669 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r349370:
hselasky [Wed, 3 Jul 2019 18:19:29 +0000 (18:19 +0000)]
MFC r349370:
Fix parsing of corrupt data in usbdump(8). Check that the transfer
type array lookup is within bounds to avoid segfault.

PR: 238801
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@349666 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r349448:
cy [Wed, 3 Jul 2019 18:11:22 +0000 (18:11 +0000)]
MFC r349448:

Fix a typo.

PR/238816 initially addressed updates to usage() however it has now
become a shopping list of fixes to ipmon man pages and usage().

PR: 238816

git-svn-id: svn://svn.freebsd.org/base/stable/10@349659 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r348993,349135:
mm [Fri, 28 Jun 2019 22:36:27 +0000 (22:36 +0000)]
MFC r348993,349135:
Sync libarchive with vendor including security fixes

r348993:
  - version bumped to 3.4.0
  - check_symlinks_fsobj() without chdir() and fchdir()
  - bsdtar.1 manpage fixes
  - patches from OpenBSD to libarchive_fe/passphrase.c

r349135:
  PR #1212: RAR5 reader - window_mask was not updated correctly
            (OSS-Fuzz 15278)
  OSS-Fuzz 15120: RAR reader - extend use after free bugfix

git-svn-id: svn://svn.freebsd.org/base/stable/10@349525 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoCorrect Konrad Zuse's year of birth.
grog [Sat, 22 Jun 2019 23:36:28 +0000 (23:36 +0000)]
Correct Konrad Zuse's year of birth.

git-svn-id: svn://svn.freebsd.org/base/stable/10@349296 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r348797:
hselasky [Tue, 11 Jun 2019 08:53:26 +0000 (08:53 +0000)]
MFC r348797:
Fix for reading the configuration descriptor in libusb. Catch invalid
configuration descriptor reads early on to avoid issues with devices
that don't check for a valid USB configuration read request.

Submitted by: takahiro.kurosawa@gmail.com
PR: 238412

git-svn-id: svn://svn.freebsd.org/base/stable/10@348895 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r348631:
hselasky [Mon, 10 Jun 2019 13:37:38 +0000 (13:37 +0000)]
MFC r348631:
In usb(4) fix a lost completion event issue towards libusb(3). It may happen
if a USB transfer is cancelled that we need to fake a completion event.
Implement missing support in ugen_fs_copy_out() to handle this.

This fixes issues with webcamd(8) and firefox.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@348857 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r348604:
hselasky [Mon, 10 Jun 2019 13:17:39 +0000 (13:17 +0000)]
MFC r348604:
In xhci(4) there is no stream ID in the completion TRB.
Instead iterate all the stream IDs in stream mode to find
the matching USB transfer.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@348853 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r348603:
hselasky [Sun, 9 Jun 2019 08:22:38 +0000 (08:22 +0000)]
MFC r348603:
Make sure the DMA tags get freed in mlx5en(4).

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@348832 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r347990:
mm [Tue, 4 Jun 2019 10:36:26 +0000 (10:36 +0000)]
MFC r347990:
Sync libarchive with vendor.

Relevant vendor changes:
  Issue #795: XAR - do not try to add xattrs without an allocated name
  PR #812: non-recursive option for extract and list
  PR #958: support reading metadata from compressed files
  PR #999: add --exclude-vcs option to bsdtar
  Issue #1062: treat empty archives with a GNU volume header as valid
  PR #1074: Handle ZIP files with trailing 0s in the extra fields
            (Android APK archives)
  PR #1109: Ignore padding in Zip extra field data (Android APK archives)
  PR #1167: fix problems related to unreadable directories
  Issue #1168: fix handling of strtol() and strtoul()
  PR #1172: RAR5 - fix invalid window buffer read in E8E9 filter
  PR #1174: ZIP reader - fix of MSZIP signature parsing
  PR #1175: gzip filter - fix reading files larger than 4GB from memory
  PR #1177: gzip filter - fix memory leak with repeated header reads
  PR #1180: ZIP reader - add support for Info-ZIP Unicode Path Extra Field
  PR #1181: RAR5 - fix merge_block() recursion
            (OSS-Fuzz 12999, 13029, 13144, 13478, 13490)
  PR #1183: fix memory leak when decompressing ZIP files with LZMA
  PR #1184: fix RAR5 OSS-Fuzz issues 12466, 14490, 14491, 12817
    OSS-Fuzz 12466: RAR5 - fix buffer overflow when parsing huffman tables
    OSS-Fuzz 14490, 14491: RAR5 - fix bad shift-left operations
    OSS-Fuzz 12817: RAR5 - handle a case with truncated huffman tables
  PR #1186: RAR5 - fix invalid type used for dictionary size mask
            (OSS-Fuzz 14537)
  PR #1187: RAR5 - fix integer overflow (OSS-Fuzz 14555)
  PR #1190: RAR5 - RAR5 don't try to unpack entries marked as directories
            (OSS-Fuzz 14574)
  PR #1196: RAR5 - fix a potential SIGSEGV on 32-bit builds
  OSS-Fuzz 2582: RAR - fix use after free if there is an invalid entry
  OSS-Fuzz 14331: RAR5 - fix maximum owner name length
  OSS-Fuzz 13965: RAR5 - use unsigned int for volume number + range check

  Additional RAR5 reader changes:
    - support symlinks, hardlinks, file owner, file group, versioned files
    - change ARCHIVE_FORMAT_RAR_V5 to 0x100000
    - set correct mode for readonly directories
    - support readonly, hidden and system Windows file attributes

MFC r347999:
Install missing data file for
lib.libarchive.functional_test.test_read_format_zip_utf8_paths

git-svn-id: svn://svn.freebsd.org/base/stable/10@348608 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMF11 r347561.
obrien [Tue, 14 May 2019 04:34:58 +0000 (04:34 +0000)]
MF11 r347561.
MFC r344085: Note that readpassphrase() came into FreeBSD's libc at 4.6.

git-svn-id: svn://svn.freebsd.org/base/stable/10@347562 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r347234:
cy [Fri, 10 May 2019 01:02:07 +0000 (01:02 +0000)]
MFC r347234:

Improve the legibility of the login.access.5 man page by separating
each argument into its own paragraph.

git-svn-id: svn://svn.freebsd.org/base/stable/10@347420 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC: r346856
rmacklem [Mon, 6 May 2019 03:20:02 +0000 (03:20 +0000)]
MFC: r346856
Add #ifdef INET6 around declaration of nbuf.

It was reported that without #ifdef INET6 around the declaration of "nbuf",
a build would report an unused variable. For some reason, I didn't see that
warning when I did a build, but it seems reasonable to add these #ifdef INET6's.

git-svn-id: svn://svn.freebsd.org/base/stable/10@347174 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC: r346365
rmacklem [Fri, 3 May 2019 02:30:01 +0000 (02:30 +0000)]
MFC: r346365
Fix the NFSv4.0 server so that it does not support NFSv4.1 attributes.

During inspection of a packet trace, I noticed that an NFSv4.0 mount
reported that it supported attributes that are only defined for NFSv4.1.
In practice, this bug appears to be benign, since NFSv4.0 clients will
not use attributes that were added for NFSv4.1.
However, this was not correct and this patch fixes the NFSv4.0 server
so that it only supports attributes defined for NFSv4.0.
It also adds a definition for NFSv4.1 attributes that can only be set,
although it is only defined as 0 for now.
This is anticipation of the addition of support for the NFSv4.1 mode+mask
attribute soon.

git-svn-id: svn://svn.freebsd.org/base/stable/10@347040 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC: r346709
rmacklem [Thu, 2 May 2019 01:17:55 +0000 (01:17 +0000)]
MFC: r346709
Add support to nfsdumpstate for printing of INET6 addresses for locks.

r346190 added support for printing of INET6 addresses for the "-o" option
(all opens) but missed adding support for INET6 addresses for the "-l" option.
This patch adds that support.

git-svn-id: svn://svn.freebsd.org/base/stable/10@347010 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC r346804:
cy [Wed, 1 May 2019 01:49:33 +0000 (01:49 +0000)]
MFC r346804:

Left justify a function header brace as it should be.
No functional change.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346982 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC: r346191
rmacklem [Sat, 27 Apr 2019 02:43:27 +0000 (02:43 +0000)]
MFC: r346191
Add support for INET6 addresses to the kernel code that dumps open/lock state.

PR#223036 reported that INET6 callback addresses were not printed by
nfsdumpstate(8). This kernel patch adds INET6 addresses to the dump structure,
so that nfsdumpstate(8) can print them out, post-r346190.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346779 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

4 years agoMFC: r346190
rmacklem [Sat, 27 Apr 2019 02:34:10 +0000 (02:34 +0000)]
MFC: r346190
Fix nfsdumpstate(8) so that it can print out INET6 callback addresses.

The patch adds support for printing of INET6 callback addresses.
It also adds the #ifdef INET, INET6 as requested by bz@.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346778 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r346229 and r346248:
hselasky [Thu, 25 Apr 2019 12:02:17 +0000 (12:02 +0000)]
MFC r346229 and r346248:
Fix spelling and remove superfluous USB keyword.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@346669 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoFix Makefile after r346467 merged incorrect include file.
rmacklem [Sun, 21 Apr 2019 14:45:18 +0000 (14:45 +0000)]
Fix Makefile after r346467 merged incorrect include file.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346487 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r345995
rmacklem [Sun, 21 Apr 2019 01:33:13 +0000 (01:33 +0000)]
MFC: r345995
Delete the BUGS entry related to failing when jails are enabled.

r345994 has finally fixed the bug that caused the nfsuserd(8) daemon to
fail when jails were enabled, so delete the BUGS entry from the man page.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346468 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r345994
rmacklem [Sun, 21 Apr 2019 01:25:27 +0000 (01:25 +0000)]
MFC: r345994
Fix nfsuserd so that it handles the mapped localhost address when jails
are enabled.

The nfsuserd(8) daemon does not function correctly when jails are enabled,
since localhost gets mapped to another IP address and, as such, the upcall
RPC fails.
This patch fixes the problem by doing a getsockname(2) of a socket mapped
to localhost to find out what the correct address is for the comparison
test with the upcall's from IP address.
This patch also adds INET6 support and the required #ifdef's for INET and
INET6. It now uses INET6 by default for the upcalls, if the kernel has
INET6 support and the daemon is also built with INET6 support.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346467 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r345992, r346087
rmacklem [Sun, 21 Apr 2019 01:15:54 +0000 (01:15 +0000)]
MFC: r345992, r346087
Add INET6 support for the upcalls to the nfsuserd daemon.

The kernel code uses UDP to do upcalls to the nfsuserd(8) daemon to get
updates to the username<->uid and groupname<->gid mappings.
A change to AF_LOCAL last year had to be reverted, since it could result
in vnode locking issues on the AF_LOCAL socket.
This patch adds INET6 support and the required #ifdef INET and INET6
to the code.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346466 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r345866
rmacklem [Thu, 18 Apr 2019 02:54:07 +0000 (02:54 +0000)]
MFC: r345866
Fix malloc stats for the RPCSEC_GSS server code when DEBUG is enabled.

The code enabled when "DEBUG" is defined uses mem_alloc(), which is a
malloc(.., M_RPC, M_WAITOK | M_ZERO), but then calls gss_release_buffer()
which does a free(.., M_GSSAPI) to free the memory.
This patch fixes the problem by replacing mem_alloc() with a
malloc(.., M_GSSAPI, M_WAITOK | M_ZERO).
This bug affects almost no one, since the sources are not normally built
with "DEBUG" defined.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346344 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r345818, r345828
rmacklem [Tue, 16 Apr 2019 02:48:04 +0000 (02:48 +0000)]
MFC: r345818, r345828
Fix a race in the RPCSEC_GSS server code that caused crashes.

When a new client structure was allocated, it was added to the list
so that it was visible to other threads before the expiry time was
initialized, with only a single reference count.
The caller would increment the reference count, but it was possible
for another thread to decrement the reference count to zero and free
the structure before the caller incremented the reference count.
This could occur because the expiry time was still set to zero when
the new client structure was inserted in the list and the list was
unlocked.

This patch fixes the race by initializing the reference count to two
and initializing all fields, including the expiry time, before inserting
it in the list.

git-svn-id: svn://svn.freebsd.org/base/stable/10@346262 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r345497:
mm [Wed, 10 Apr 2019 21:46:28 +0000 (21:46 +0000)]
MFC r345497:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1153: fixed 2 bugs in ZIP reader [1]
  PR #1143: ensure archive_read_disk_entry_from_file() uses ARCHIVE_READ_DISK
  Changes to file flags code, support more file flags on FreeBSD:
    UF_OFFLINE, UF_READONLY, UF_SPARSE, UF_REPARSE, UF_SYSTEM
    UF_ARCHIVE is not supported by intention (yet)

PR: 236300 [1]

git-svn-id: svn://svn.freebsd.org/base/stable/10@346105 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r345499:
hselasky [Fri, 5 Apr 2019 11:35:58 +0000 (11:35 +0000)]
MFC r345499:
Change all kernel C-type macros into static inline functions.

The current kernel C-type macros might obscurely hide the fact that
the input argument might be used multiple times.

This breaks code like:
isalpha(*ptr++)

Use static inline functions instead of macros to fix this.

Reviewed by: kib @
Differential Revision: https://reviews.freebsd.org/D19694
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@345943 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r345359, r345384:
markj [Thu, 4 Apr 2019 02:08:36 +0000 (02:08 +0000)]
MFC r345359, r345384:
Don't attempt to measure TSC skew when running as a VM guest.

PR: 218452

git-svn-id: svn://svn.freebsd.org/base/stable/10@345869 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r345611:
rpokala [Wed, 3 Apr 2019 06:37:25 +0000 (06:37 +0000)]
MFC r345611:

Teach jedec_dimm(4) to be more forgiving of non-fatal errors.

It looks like some DIMMs claim to have a TSOD, but actually don't. Some
claim they weren't able to change the SPD page, but they did. Neither of
those should be fatal errors.

git-svn-id: svn://svn.freebsd.org/base/stable/10@345838 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r345252:
avos [Mon, 1 Apr 2019 07:54:27 +0000 (07:54 +0000)]
MFC r345252:
net80211: correct check for SMPS node flags updates

Update node flags when driver supports SMPS, not when it is disabled or
in dynamic mode ((iv_htcaps & HTCAP_SMPS) != 0).

Was checked with RTL8188EE (1T1R), STA mode - 'smps' word should disappear
from 'ifconfig wlan0' output.

git-svn-id: svn://svn.freebsd.org/base/stable/10@345761 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r345524: Import tzdata 2019a
philip [Fri, 29 Mar 2019 01:41:51 +0000 (01:41 +0000)]
MFC r345524: Import tzdata 2019a

git-svn-id: svn://svn.freebsd.org/base/stable/10@345671 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r345318:
avos [Wed, 27 Mar 2019 08:55:59 +0000 (08:55 +0000)]
MFC r345318:
lockf(1): return EX_UNAVAILABLE if -n is used and the lock file does not
exist

Apply EX_UNAVAILABLE patch part from PR 170775 to match the documentation.

Was checked with a command from PR 210770:
lockf -n /tmp/doesnotexist echo; echo $?

PR: 210770

git-svn-id: svn://svn.freebsd.org/base/stable/10@345569 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342961:
hselasky [Tue, 26 Mar 2019 13:53:33 +0000 (13:53 +0000)]
MFC r342961:
snd_uaudio: Add quirks for Edirol UA-25EX in advanced driver mode.

Extend the vendor class USB audio quirk to cover devices without
the USB audio control descriptor.

PR: 234794
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@345546 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r344795:
hselasky [Tue, 26 Mar 2019 13:46:47 +0000 (13:46 +0000)]
MFC r344795:
Fix typos in libusb.

Found by: Denis Ahrens <denis@h3q.com>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@345541 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r345009:
dab [Mon, 25 Mar 2019 17:04:33 +0000 (17:04 +0000)]
MFC r345009:

Fix a scribbler in the PMS driver.

The ESGL bit was left uninitialized when executing the REPORT LUNS
ioctl. This could allow a zeroed data buffer to be treated as a
scatter/gather list. The firmware would eventually walk past the end
of the data buffer, potentially find what looked like a valid
address/length pair, and write the result to semi-random memory.

Obtained from:  Dell EMC Isilon
Sponsored by:   Dell EMC Isilon

git-svn-id: svn://svn.freebsd.org/base/stable/10@345508 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r344748:
avos [Fri, 15 Mar 2019 08:21:11 +0000 (08:21 +0000)]
MFC r344748:
Allow to build ifconfig(8) without wireless support

The change removes SIOC[GS]IEEE80211 handling from ifconfig(8)
if WITHOUT_WIRELESS_SUPPORT=yes is set in src.conf(5).

Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D19289

git-svn-id: svn://svn.freebsd.org/base/stable/10@345174 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r344470:
dab [Thu, 7 Mar 2019 13:11:00 +0000 (13:11 +0000)]
MFC r344470:

Fix several Coverity-detected issues in newsyslog.

- CID 1394815, CID 1305673: Dereference before null check - memory was
  allocated and the allocation checked for NULL with a call to errx()
  if it failed. Code below that was guaranteed that the pointer was
  non-NULL, but there was another check for NULL at the exit of the
  function (after the memory had already been referenced). Eliminate
  the useless NULL check.

- CID 1007452: Resource leak - Storage intended to be allocated and
  returned to the caller was never freed. This was the result of a
  regression in the function signature introduced in r208648 (2010)
  (thanks for that find, @cem!). Fixed by altering the function
  signature and passing the allocated memory to the caller as
  intended. This also fixes PR158794.

- CID 1008620: Logically dead code in newsyslog.c - This was a direct
  result of CID 1007452. Since the memory allocated as described there
  was not returned to the caller, a subsequent check for the memory
  having been allocated was dead code. Returning the memory
  re-animates the code that is the subject of this CID.

- CID 1006131: Unused value - in parsing a configuration file, a
  pointer to the end of the last field was saved, but not used after
  that. Rewrite to use the pointer value. This could have been fixed
  by avoiding the assignment altogether, but this solutions more
  closely follows the pattern used in the preceding code.

PR:             158794
Reported by:    Coverity, Ken-ichi EZURA <k.ezura@gmail.com> (PR158794)

Sponsored by: Dell EMC Isilon

git-svn-id: svn://svn.freebsd.org/base/stable/10@344882 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r344245:
avos [Mon, 4 Mar 2019 03:38:43 +0000 (03:38 +0000)]
MFC r344245:
snmp_hostres(3): fix a typo in sanity checks in handle_chunk()

PR: 204253
Submitted by: David Binderman <dcb314@hotmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@344747 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r344244:
avos [Mon, 4 Mar 2019 03:30:39 +0000 (03:30 +0000)]
MFC r344244:
Fix memory / resource leaks in usr.sbin/rpc.ypupdated/update.c

Re-apply r343909 to this file to get the issue fixed.

PR: 204956
Reported by: David Binderman <dcb314@hotmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@344746 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r344477:
hselasky [Fri, 1 Mar 2019 08:06:23 +0000 (08:06 +0000)]
MFC r344477:
Add new USB quirk.

PR: 235897
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@344695 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r344063,r344088:
mm [Thu, 28 Feb 2019 22:57:09 +0000 (22:57 +0000)]
MFC r344063,r344088:

MFC r344063:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1085: Fix a null pointer dereference bug in zip writer
  PR #1110: ZIP reader added support for XZ, LZMA, PPMD8 and BZIP2
            decopmpression
  PR #1116: Add support for 64-bit ar format
  PR #1120: Fix a 7zip crash [1] and a ISO9660 infinite loop [2]
  PR #1125: RAR5 reader - fix an invalid read and a memory leak
  PR #1131: POSIX reader - do not fail when tree_current_lstat() fails
            due to ENOENT [3]
  PR #1134: Delete unnecessary null pointer checks before calls of free()
  OSS-Fuzz 10843: Force intermediate to uint64_t to make UBSAN happy.
  OSS-Fuzz 11011: Avoid buffer overflow in rar5 reader

MFC r344088:
  archive_read_disk_posix.c: initialize delayed_errno

PR: 233006 [3]
Security: CVE-2019-1000019 [1], CVE-2019-1000020 [2]

git-svn-id: svn://svn.freebsd.org/base/stable/10@344674 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r344473:
dab [Wed, 27 Feb 2019 22:29:37 +0000 (22:29 +0000)]
MFC r344473:

CID 1332000: Logically dead code in sys/dev/pms/RefTisa/tisa/sassata/sas/ini/itdio.c

A pointer is first tested for NULL. If non-NULL, another pointer is
set equal to the first. The second pointer is then checked for NULL
and an error path taken if so. This second test and the associated
path is dead code as the pointer value, having just been checked for
NULL, cannot be NULL at this point. Remove the dead code.

Sponsored by: Dell EMC Isilon

git-svn-id: svn://svn.freebsd.org/base/stable/10@344646 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r344198:
avos [Thu, 21 Feb 2019 09:54:57 +0000 (09:54 +0000)]
MFC r344198:
GC ATA_REQUEST_TIMEOUT option remnants

It was removed from code in r249083 and from sys/conf/options in r249213.

PR: 193935, 222170

git-svn-id: svn://svn.freebsd.org/base/stable/10@344431 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r344024:
dab [Wed, 20 Feb 2019 22:49:09 +0000 (22:49 +0000)]
MFC r344024:

CID 1009492: Logically dead code in sys/cam/scsi/scsi_xpt.c

In `probedone()`, for the `PROBE_REPORT_LUNS` case, all paths that
fall to the bottom of the case set `lp` to `NULL`, so the test for a
non-NULL value of `lp` and call to `free()` if true is dead code as
the test can never be true. Fix by eliminating the whole if
statement. To guard against a possible future change that accidentally
violates this assumption, use a `KASSERT()` to catch if `lp` is
non-NULL.

Sponsored by: Dell EMC Isilon

git-svn-id: svn://svn.freebsd.org/base/stable/10@344394 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343501:
avos [Sun, 17 Feb 2019 02:58:44 +0000 (02:58 +0000)]
MFC r343501:
Add NO_6_BYTE / NO_SYNC_CACHE quirks for (C|D|E).* Olympus digital cameras

PR: 97472
Submitted by: Fabio Luis Girardi <papelhigienico@gmail.com>
Reviewed by: imp

git-svn-id: svn://svn.freebsd.org/base/stable/10@344221 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343980:
avos [Sat, 16 Feb 2019 01:05:22 +0000 (01:05 +0000)]
MFC r343980:
ifconfig(8): display 802.11n rates correctly for 'roam:rate' parameter

git-svn-id: svn://svn.freebsd.org/base/stable/10@344196 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343909:
avos [Sat, 16 Feb 2019 00:37:08 +0000 (00:37 +0000)]
MFC r343909:
newkey(8): fix 'tmpname' memory leak (always) and input file descriptor leak
when output file cannot be opened

PR: 201732
Reported by: David Binderman <dcb314@hotmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@344193 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343905:
hselasky [Fri, 15 Feb 2019 09:22:23 +0000 (09:22 +0000)]
MFC r343905:
Improve Bluetooth device discovery support for Android and Microsoft devices.

Tested using the virtual_bt_speaker(8) tool from the virtual_oss(8)
project at github.com.

PR: 210089
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@344146 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343591:
cy [Thu, 14 Feb 2019 00:52:03 +0000 (00:52 +0000)]
MFC r343591:

Do not obtain an already held read lock. This causes a witness panic when
ipfs is invoked. This is the second of two panics resolving PR 235110.

PR: 235110
Reported by: David.Boyd49@twc.com

git-svn-id: svn://svn.freebsd.org/base/stable/10@344113 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343871:
avos [Wed, 13 Feb 2019 09:28:48 +0000 (09:28 +0000)]
MFC r343871:
recoverdisk(1): fclose() file supplied via '-r readlist' parameter when
it's no longer needed

PR: 204952
Reported by: David Binderman <dcb314@hotmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@344091 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343870:
avos [Tue, 12 Feb 2019 07:03:37 +0000 (07:03 +0000)]
MFC r343870:
ipcs(1): drop obsolete error checking

This code is unreachable since r77551.

PR: 201728

git-svn-id: svn://svn.freebsd.org/base/stable/10@344044 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343698, r343700:
avos [Sun, 10 Feb 2019 20:42:06 +0000 (20:42 +0000)]
MFC r343698, r343700:
ifconfig(8): display management / multicast wlan(4) rates properly

For 11n / 11ac we are still using non-11n rates for management and
multicast traffic by default; check 'MCS rate' bit to determine how
to print them correctly.

PR: 161035

git-svn-id: svn://svn.freebsd.org/base/stable/10@343974 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343837:
avos [Sun, 10 Feb 2019 20:26:12 +0000 (20:26 +0000)]
MFC r343837:
net80211(4): validate supplied roam:rate values from ifconfig(8)

git-svn-id: svn://svn.freebsd.org/base/stable/10@343973 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343604:
avos [Fri, 8 Feb 2019 14:32:27 +0000 (14:32 +0000)]
MFC r343604:
bwn(4): reuse ieee80211_tx_complete function

git-svn-id: svn://svn.freebsd.org/base/stable/10@343910 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343603:
avos [Fri, 8 Feb 2019 13:57:28 +0000 (13:57 +0000)]
MFC r343603:
ipw(4): reuse ieee80211_tx_complete function

This should partially fix 'netstat -b -I wlan0' output

git-svn-id: svn://svn.freebsd.org/base/stable/10@343907 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343572:
hselasky [Fri, 8 Feb 2019 10:28:13 +0000 (10:28 +0000)]
MFC r343572:
Add support for Audio Sink and Audio Source profiles to sdpd(8).

This allows user-space programs like virtual_oss(8) to act
as a Bluetooth speaker device.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@343902 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343683:
avos [Fri, 8 Feb 2019 04:48:12 +0000 (04:48 +0000)]
MFC r343683:
Do not acquire IEEE80211_LOCK twice in cac_timeout(); reuse
locked function instead.

It is externally visible since r257065.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343894 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r337272:
bdrewery [Thu, 7 Feb 2019 23:57:28 +0000 (23:57 +0000)]
MFC r337272:

  Fix some filemon path logging issues.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343886 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343633:
bdrewery [Thu, 7 Feb 2019 21:37:06 +0000 (21:37 +0000)]
MFC r343633:

  Shar files may be seen as binary by grep.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343879 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343682:
avos [Wed, 6 Feb 2019 02:35:56 +0000 (02:35 +0000)]
MFC r343682:
sys/dev/wtap: Check return value from malloc(..., M_NOWAIT) and
drop unneeded cast.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343823 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343681:
avos [Wed, 6 Feb 2019 02:18:11 +0000 (02:18 +0000)]
MFC r343681:
run(4): fix allocated memory type for ieee80211_node(4)

PR: 177366

git-svn-id: svn://svn.freebsd.org/base/stable/10@343821 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343574:
avos [Wed, 6 Feb 2019 02:07:37 +0000 (02:07 +0000)]
MFC r343574:
Fix compilation with 'option NDISAPI + device ndis' and
without 'device pccard' in the kernel config file.

PR: 171532
Reported by: Robert Bonomi <bonomi@host128.r-bonomi.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@343820 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343697:
avos [Wed, 6 Feb 2019 01:53:01 +0000 (01:53 +0000)]
MFC r343697:
net80211(4): fix rate check when 'roaming' ifconfig(8) option is set to 'auto'

Do not try to clear 'basic rate' bit from roamRate; it cannot be here and,
actually, this operation clears 'MCS rate' bit instead, breaking comparison
for 11n / 11ac modes.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343818 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343542:
avos [Wed, 6 Feb 2019 01:42:26 +0000 (01:42 +0000)]
MFC r343542:
upgt(4): unbreak build with UPGT_DEBUG

git-svn-id: svn://svn.freebsd.org/base/stable/10@343816 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343541:
avos [Tue, 5 Feb 2019 03:01:10 +0000 (03:01 +0000)]
MFC r343541:
Drop some unneeded includes from wireless USB drivers.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343760 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343576:
avos [Mon, 4 Feb 2019 03:44:07 +0000 (03:44 +0000)]
MFC r343576:
ndiscvt(8): abort if no IDs were found during conversion.

PR: 69268
Submitted by: <darius@dons.net.au>

git-svn-id: svn://svn.freebsd.org/base/stable/10@343730 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343600:
cy [Sun, 3 Feb 2019 00:36:12 +0000 (00:36 +0000)]
MFC r343600:

Document the instance context pointer.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343691 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343502:
avos [Sat, 2 Feb 2019 16:57:49 +0000 (16:57 +0000)]
MFC r343502:
Remove RADIUS-related files when WITHOUT_RADIUS_SUPPORT=true is set
in src.conf(5)

PR: 234041

git-svn-id: svn://svn.freebsd.org/base/stable/10@343685 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343453:
hselasky [Fri, 1 Feb 2019 10:09:54 +0000 (10:09 +0000)]
MFC r343453:
Add new USB quirk.

PR: 235202
Differential Revision: https://reviews.freebsd.org/D18917
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@343658 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343496:
avos [Fri, 1 Feb 2019 03:26:10 +0000 (03:26 +0000)]
MFC r343496:
pcf(4): fix parentheses in if condition

PR: 210709
Submitted by: David Binderman <dcb314@hotmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@343643 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343495:
avos [Fri, 1 Feb 2019 02:43:13 +0000 (02:43 +0000)]
MFC r343495:
wlan.4: improve wording

PR: 218075
Submitted by: Aaron Taylor <halfnote1004@gmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@343639 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343473:
avos [Thu, 31 Jan 2019 11:36:28 +0000 (11:36 +0000)]
MFC r343473:
geom_uzip(4): move NULL pointer KASSERT check before it is dereferenced

PR: 203499
Submitted by: <chadf@triularity.org>

MFC r343475:
geom_uzip(4): set 'gp != NULL' assertion on top of the function

There was yet another access to this variable in g_trace() few
lines upper.

PR: 203499
Reported by: cem

git-svn-id: svn://svn.freebsd.org/base/stable/10@343605 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343486:
cy [Wed, 30 Jan 2019 02:39:08 +0000 (02:39 +0000)]
MFC r343486:

Fix a typo.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343568 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343341:
avos [Mon, 28 Jan 2019 00:51:26 +0000 (00:51 +0000)]
MFC r343341:
ifconfig: drop unused macros from ifieee80211.c

git-svn-id: svn://svn.freebsd.org/base/stable/10@343506 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r342634 (partial)
marius [Sun, 27 Jan 2019 19:05:18 +0000 (19:05 +0000)]
MFC: r342634 (partial)

o Don't allocate resources for SDMA in sdhci(4) if the controller or the
  front-end doesn't support SDMA or the latter implements a platform-
  specific transfer method instead. While at it, factor out allocation
  and freeing of SDMA resources to sdhci_dma_{alloc,free}() in order to
  keep the code more readable when adding support for ADMA variants.

o Base the size of the SDMA bounce buffer on MAXPHYS up to the maximum
  of 512 KiB instead of using a fixed 4-KiB-buffer. With the default
  MAXPHYS of 128 KiB and depending on the controller and medium, this
  reduces the number of SDHCI interrupts by a factor of ~16 to ~32 on
  sequential reads while an increase of throughput of up to ~84 % was
  seen.

  Front-ends for broken controllers that only support an SDMA buffer
  boundary of a specific size may set SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY
  and supply a size via struct sdhci_slot. According to Linux, only -
  unsupported in stable/10 anyway - Qualcomm MSM-type SDHCI controllers
  are affected by this, though.

  Requested by: Shreyank Amartya (unconditional bump to 512 KiB)

o Introduce a SDHCI_DEPEND macro for specifying the dependency of the
  front-end modules on the sdhci(4) one and bump the module version
  of sdhci(4) to 2 via an also newly introduced SDHCI_VERSION in order
  to ensure that all components are in sync WRT struct sdhci_slot.

o In sdhci(4):
  - Make pointers const were applicable, and
  - replace a few device_printf(9) calls with slot_printf() for
    consistency.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343505 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343190:
avos [Sat, 26 Jan 2019 12:41:16 +0000 (12:41 +0000)]
MFC r343190:
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

git-svn-id: svn://svn.freebsd.org/base/stable/10@343465 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343103:
cy [Wed, 23 Jan 2019 02:43:49 +0000 (02:43 +0000)]
MFC r343103:

Remove redundant ipfilter version of pcap-bpf.h. As of r214535 it was
no longer needed.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343337 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343073:
cy [Wed, 23 Jan 2019 02:40:29 +0000 (02:40 +0000)]
MFC r343073:

Remove an IRIX-only source file.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343336 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: 325765 (imp) Add notes about overlapping copies.
rgrimes [Tue, 22 Jan 2019 21:52:07 +0000 (21:52 +0000)]
MFC: 325765 (imp) Add notes about overlapping copies.

Add notes to each of these that specifically state that results are
undefined if the strings overlap. In the case of memcpy, we document
the overlapping behavior on FreeBSD (pre-existing). For str*, it is
left unspecified, however, since the default (and x86) implementations
do not handle overlapping strings properly.

PR: 223653
Approved by: phk (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@343326 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343023:
pfg [Mon, 21 Jan 2019 14:55:10 +0000 (14:55 +0000)]
MFC r343023:
msun: reduce diff between src/e_j0.c and src/e_j0f.c

PR: 229501

git-svn-id: svn://svn.freebsd.org/base/stable/10@343258 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342791: fix a typo in chio(4) (which propagates into chio(1))
joerg [Sun, 20 Jan 2019 21:49:13 +0000 (21:49 +0000)]
MFC r342791: fix a typo in chio(4) (which propagates into chio(1))

git-svn-id: svn://svn.freebsd.org/base/stable/10@343227 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342884:
hselasky [Fri, 18 Jan 2019 08:59:00 +0000 (08:59 +0000)]
MFC r342884:
Fix loopback traffic when using non-lo0 link local IPv6 addresses.

The loopback interface can only receive packets with a single scope ID,
namely the scope ID of the loopback interface itself. To mitigate this
packets which use the scope ID are appearing as received by the real
network interface, see "origifp" in the patch. The current code would
drop packets which are designated for loopback which use a link-local
scope ID in the destination address or source address, because they
won't match the lo0's scope ID. To fix this restore the network
interface pointer from the scope ID in the destination address for
the problematic cases. See comments added in patch for a more detailed
description.

This issue was introduced with route caching by karels@ .

Reviewed by: bz (network)
Differential Revision: https://reviews.freebsd.org/D18769
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@343139 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342778:
hselasky [Fri, 18 Jan 2019 08:49:10 +0000 (08:49 +0000)]
MFC r342778:
Reduce timeout for reading the USB HUB port status to 1000ms and try to filter
out dead USB HUB devices by implementing an error counter, so that the USB
enumeration thread does not spend all its time reading from non-responding
devices, blocking user-space access in the end.

Tested by: Matthias Apitz <guru@unixarea.de>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@343136 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342730:
hselasky [Fri, 18 Jan 2019 08:45:56 +0000 (08:45 +0000)]
MFC r342730:
Improve USB generic debug messages. Print process ID and name when opening
and closing usb/ugenX.Y character device nodes.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@343133 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343043: scp: disallow empty or current directory
emaste [Wed, 16 Jan 2019 15:19:09 +0000 (15:19 +0000)]
MFC r343043: scp: disallow empty or current directory

Obtained from: OpenBSD scp.c 1.198
Security: CVE-2018-20685
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@343098 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342966:
avos [Tue, 15 Jan 2019 02:26:03 +0000 (02:26 +0000)]
MFC r342966:
net80211: fix possible panic for some drivers after r342465

Check if rate control structures were allocated before trying to
access them in various places; this was possible before on
allocation failure (unlikely), but was revealed after r342211
where allocation was deferred.

The patch was adjusted a bit since file contents are different enough
since r306591.

Also, 'rate_stats' sysctl is not available here, so the panic is
unlikely to happen here even without this patch.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343036 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342810:
avos [Sun, 13 Jan 2019 02:27:10 +0000 (02:27 +0000)]
MFC r342810:
powerd(8): allow to force a method of battery state query

This change allows to determine power source via sysctl or /dev/apm
when devd(8) is running (used by default).

Based on patch from PR; other changes on top of it:
- '-f' (force) -> '-s' (source) parameter renaming;
- allow 'apm' -> 'devd' transition when '-s devd' is set
(if APM is enabled);
- man page update.

PR: 125707
Submitted by: Konstantin Stepanov <milezv@yandex.ru>
Reviewed by: bcr, imp
Differential Revision: https://reviews.freebsd.org/D18742

git-svn-id: svn://svn.freebsd.org/base/stable/10@342983 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342605:
cy [Sun, 6 Jan 2019 00:32:14 +0000 (00:32 +0000)]
MFC r342605:

TCP_PAWS_IDLE is does not exist in NetBSD and illumos. In FreeBSD
TCP_PAWS_IDLE is defined in netinet/tcp_seq.h, however this header
isn't included explicitly or implicitly at this point therefore
as far ipfilter is concerned TCP_PAWS_IDLE is not defined. Remove
the #ifdef and include netinet/tcp.h unconditionally.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342794 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r336610 (partial), r339207, r339267
marius [Sat, 5 Jan 2019 19:35:10 +0000 (19:35 +0000)]
MFC: r336610 (partial), r339207, r339267

- Or in the DMA coalescing Rx threshold so the other bits set in E1000_DMACR
  remain intact as intended in igb_init_dmac(). [1]

- Fix igb corrupting checksums with BPF and VLAN
  In stable/11, this merely syncs the code with head as the problem was
  introduced with r311849 in the latter and then fixed by r339207 with
  a different approach than the code used pre-r311849 and in stable/11.

- Use mbuf defines to construct csum offload masks rather than literals

MF11: r340148

Don't use 9k jumbo clusters

Reported by: Coverity
CID: 1304929 [1]

git-svn-id: svn://svn.freebsd.org/base/stable/10@342790 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342549:
hselasky [Thu, 3 Jan 2019 09:28:18 +0000 (09:28 +0000)]
MFC r342549:
Add USB quirk for SPL Crimson Rev 1.

PR: 234380
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@342727 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342456:
hselasky [Thu, 3 Jan 2019 09:25:39 +0000 (09:25 +0000)]
MFC r342456:
Fix reading of USB sample rate descriptor for SPL Crimson Rev 1.

Read first one entry, then try to read the full rate descriptor table.

PR: 234380
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@342724 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC 341800: Don't report stale signal information in ptrace_lwpinfo.
jhb [Wed, 2 Jan 2019 19:11:49 +0000 (19:11 +0000)]
MFC 341800: Don't report stale signal information in ptrace_lwpinfo.

Once a signal's siginfo was copied to 'td_si' as part of the signal
exchange in issignal(), it was never cleared.  This caused future
thread events that are reported as SIGTRAP events without signal
information to report the stale siginfo in 'td_si'.  For example, if a
debugger created a new process and used SIGSTOP to stop it after
PT_ATTACH, future system call entry / exit events would set PL_FLAG_SI
with the SIGSTOP siginfo in pl_siginfo.  This broke 'catch syscall' in
current versions of gdb as it assumed PL_FLAG_SI with SIGTRAP
indicates a breakpoint or single step trap.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342704 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342596:
cy [Wed, 2 Jan 2019 15:13:08 +0000 (15:13 +0000)]
MFC r342596:

Remove duplicate include of sys/mbuf.h.

Reported by: Trond Endrest <Trond.Endrestol@ximalas.info>

git-svn-id: svn://svn.freebsd.org/base/stable/10@342685 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342613: Import tzdata 2018h
philip [Tue, 1 Jan 2019 10:05:36 +0000 (10:05 +0000)]
MFC r342613: Import tzdata 2018h
MFC r342644: Import tzdata 2018i

git-svn-id: svn://svn.freebsd.org/base/stable/10@342669 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342385:
cy [Mon, 31 Dec 2018 03:53:33 +0000 (03:53 +0000)]
MFC r342385:

Remove an empty #if block.

The interesting thing is that looking through Darren's commit logs,
the line containing an extern ppsratecheck() definition was removed
from the v5-1-RELEASE branch but not from HEAD (I have taken his
CVS tree and converted it to GIT). There is a commit adding an
additional #if defined to the empty block. I can only assume that
this was intentional for something later. Looking through HEAD the
extern ppsratecheck() is there. However if we put it back it would
conflict with a static ppsratecheck() definition in fil.c when
building ipftest.

Therefore we remove this empty block.

ppsratecheck() is a function in the FreeBSD kernel. However ipftest
cannot call the ppsratecheck() in the kernel. Therefore one exists in
fil.c for use when building the userland ipftest utility which
approximates the packet filter in userland for testing of ipfilter
rules against packets captured with tcpdump.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342641 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342547:
cy [Sun, 30 Dec 2018 04:42:01 +0000 (04:42 +0000)]
MFC r342547:

Remove another empty #ifdef block. This empty block also exists in
the upstream HEAD.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342608 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342377:
cy [Sun, 30 Dec 2018 04:37:49 +0000 (04:37 +0000)]
MFC r342377:

Remove NETBSD_PF. NETBSD_PF is a flag that defines whether the pfil(9)
framework is available. pfil(9) has been in FreeBSD since FreeBSD 5
and according to svn log was first committed to HEAD in 2000, therefore
it is safe to say the check is no longer needed in FreeBSD.

pfil(9) first appeared in NetBSD 1.3 (hence the name NETBSD_PF).
Therefore it is safe to say that it is supported by every NetBSD system
today. The framework also exists in illumos.

As ipfilter code is shared and exchanged between FreeBSD and NetBSD, and
at some point in the future illumos too, and as all three platforms have
pfil(9), the redundant NETBSD_PF #defines and #ifdefs are removed.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342607 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f