]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
5 years agoMFC r339472: rc.initdiskless: fix commentary grammar after r339465
eugen [Mon, 19 Nov 2018 06:52:20 +0000 (06:52 +0000)]
MFC r339472: rc.initdiskless: fix commentary grammar after r339465

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

5 years agoMFC r339465: rc.initdiskless: add support for auxiliary NVRAM.
eugen [Mon, 19 Nov 2018 06:39:00 +0000 (06:39 +0000)]
MFC r339465: rc.initdiskless: add support for auxiliary NVRAM.

  Currently, rc.inidiskless assumes that local system configuration
  changes are kept in some mountable file system. For example,
  nanobsd uses dedicated partition mounted as /cfg for this.

  However, small embedded devices like MIPS routers may have no enough flash
  space to keep full-blown file system but have only one or couple
  small flash blocks to keep persistent local configuration overrides.

  This change extends rc.initdiskless and introduces ability to run auxiliary
  command /conf/T/M/extract that is supposed to extract configuration overrides
  from such local storage.

  For example, the command /conf/default/etc/extract may contain something like:

  cd "$1" && bsdcpio --quiet -idu < /dev/map/cfg

  bsdcpio command extracts compressed archive from the storage to /etc
  assuming the storage is exposed by the kernel as /dev/map/cfg to userland.

PR: 204215

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

5 years agoMFC: r339999
rmacklem [Sun, 18 Nov 2018 23:48:15 +0000 (23:48 +0000)]
MFC: r339999
Fix NFS client vnode locking to avoid a crash during forced dismount.

A crash was reported where the crash occurred in nfs_advlock() when the
NFS_ISV4(vp) macro was being executed. This was caused by the vnode
being VI_DOOMED due to a forced dismount in progress.
This patch fixes the problem by locking the vnode before executing the
NFS_ISV4() macro.

PR: 232673

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

5 years agoMFC r340248:
hselasky [Sun, 11 Nov 2018 12:34:19 +0000 (12:34 +0000)]
MFC r340248:
Don't read the USB audio sync endpoint when we don't use it to save
isochronous bandwidth.

Sponsored by: Mellanox Technologies

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

5 years agoMFC r340212:
hselasky [Sat, 10 Nov 2018 10:32:55 +0000 (10:32 +0000)]
MFC r340212:
Sometimes the complete split packet may be queued too early and the
transaction translator will return a NAK. Ignore this message and
retry the complete split instead.

Sponsored by: Mellanox Technologies

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

5 years agoMFC r340089:
hselasky [Fri, 9 Nov 2018 08:47:54 +0000 (08:47 +0000)]
MFC r340089:
Use correct type for IOCTL request argument.
This fixes signed IOCTL value warnings in uhsoctl().

Submitted by: Marcin Cieslak <saper@saper.info>
Sponsored by: Mellanox Technologies

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

5 years agoMFC r339595: nfsrvd_readdirplus: for some errors, do not fail the entire request
avg [Tue, 6 Nov 2018 14:22:44 +0000 (14:22 +0000)]
MFC r339595: nfsrvd_readdirplus: for some errors, do not fail the entire request

Sponsored by: Panzura

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

5 years agoMFC: 339585
whu [Wed, 31 Oct 2018 06:24:07 +0000 (06:24 +0000)]
MFC: 339585

    r339585:
Do not drop UDP traffic when TXCSUM_IPV6 flag is on

PR: 231797
Submitted by: whu
Reviewed by: dexuan
Obtained from: Kevin Morse
Sponsored by: Microsoft

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

5 years agoMFC r339848: Import tzdata 2018g
philip [Wed, 31 Oct 2018 02:02:41 +0000 (02:02 +0000)]
MFC r339848: Import tzdata 2018g

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

5 years agoMFC 338408: Don't directly dereference a user pointer in the VPD ioctl.
jhb [Tue, 30 Oct 2018 21:31:32 +0000 (21:31 +0000)]
MFC 338408: Don't directly dereference a user pointer in the VPD ioctl.

The PCIOCLISTVPD ioctl on /dev/pci is used to fetch a list of VPD
key-value pairs for a specific PCI function.  It is used by
'pciconf -l -V'.  The list is stored in a userland-supplied buffer as
an array of variable-length structures where the key and data length
are stored in a fixed-size header followed by the variable-length
value as a byte array.  To facilitate walking this array in userland,
<sys/pciio.h> provides a PVE_NEXT() helper macro to return a pointer
to the next array element by reading the the length out of the current
header and using it to compute the address of the next header.

To simplify the implementation, the ioctl handler was also using
PVE_NEXT() when on the user address of the user buffer to compute the
user address of the next array element.  However, the PVE_NEXT() macro
when used with a user address was reading the value's length by
indirecting the user pointer.  The value was ready after the current
record had been copied out to the user buffer, so it appeared to work
on architectures where user addresses are directly dereferencable from
the kernel (all but powerpc and i386 after the 4:4 split).  The recent
enablement of SMAP on amd64 caught this violation however.  To fix,
add a variant of PVE_NEXT() for use in the ioctl handler that takes an
explicit value length.

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

5 years agoMFC r339366
davidcs [Mon, 29 Oct 2018 21:31:23 +0000 (21:31 +0000)]
MFC r339366
Add support for Error Recovery

Submitted by:Vaishali.Kulkarni@cavium.com

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

5 years agoMFC r338734
davidcs [Mon, 29 Oct 2018 21:14:48 +0000 (21:14 +0000)]
MFC r338734

Fixed isses:
  State check before enqueuing transmit task in bxe_link_attn() routine.
  State check before invoking bxe_nic_unload in bxe_shutdown().

Submitted by:Vaishali.Kulkarni@cavium.com

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

5 years agoMFC r337528: add an option for ddb ps command to print process arguments
avg [Mon, 29 Oct 2018 12:48:30 +0000 (12:48 +0000)]
MFC r337528: add an option for ddb ps command to print process arguments

Sponsored by: Panzura

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

5 years agoMFC r303648: Fix ddb "show proc" to show full arguments
avg [Mon, 29 Oct 2018 12:45:08 +0000 (12:45 +0000)]
MFC r303648: Fix ddb "show proc" to show full arguments

PR: 200052

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

5 years agoMFC r339587:
hselasky [Mon, 29 Oct 2018 12:11:27 +0000 (12:11 +0000)]
MFC r339587:
Added support for formula-based arbitrary baud rates, in contrast to
the current fixed values, which enables use of rates above 1 Mbps.
Improved the detection of HXD chips, and the status flag handling as
well.

Submitted by: Gabor Simon <gabor.simon75@gmail.com>
PR: 225932
Differential revision: https://reviews.freebsd.org/D16639
Sponsored by: Mellanox Technologies

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

5 years agoMFC r339582:
hselasky [Thu, 25 Oct 2018 14:56:19 +0000 (14:56 +0000)]
MFC r339582:
Drop sequencer mutex around uiomove() and make sure we don't move more bytes
than is available, else a panic might happen.

Found by: Peter Holm <peter@holm.cc>
Sponsored by: Mellanox Technologies

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

5 years agoMFC r339581:
hselasky [Thu, 25 Oct 2018 14:35:52 +0000 (14:35 +0000)]
MFC r339581:
Fix off-by-one which can lead to panics.

Found by: Peter Holm <peter@holm.cc>
Sponsored by: Mellanox Technologies

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

5 years agoMFC r339584:
slavash [Thu, 25 Oct 2018 14:12:48 +0000 (14:12 +0000)]
MFC r339584:
mlx5: Notify user that the ConnectX-6 shutdown its port due to power limitation

If power exceed the slot limit, or slot limit is unknown the ConnectX-6
firmware will shutdown its port.
Inform the user via debug message.

Approved by:    hselasky (mentor), kib (mentor)
Sponsored by:   Mellanox Technologies

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

5 years agoMFC r339509: Fix loader.conf(5) "password" feature
dteske [Wed, 24 Oct 2018 23:21:12 +0000 (23:21 +0000)]
MFC r339509: Fix loader.conf(5) "password" feature

Restore the ability to prevent the user from interrupting the boot process
without first entering the password stored in loader.conf(5).

PR: kern/207069
Reported by: david@dcrosstech.com
Sponsored by: Smule, Inc.

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

5 years agoMFC r339462: make upgrade from previous FreeBSD versions less painful
eugen [Wed, 24 Oct 2018 05:15:46 +0000 (05:15 +0000)]
MFC r339462: make upgrade from previous FreeBSD versions less painful
and make previously working configuration like this work again:

gif_interfaces="gif0"
gifconfig_gif0="1.1.1.1 2.2.2.2"
ifconfig_gif0="inet 192.168.1.1 192.168.1.2 netmask 255.255.255.252"

PR: 204700

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

5 years agoMFC r339503: Import tzdata 2018f
philip [Tue, 23 Oct 2018 01:42:43 +0000 (01:42 +0000)]
MFC r339503: Import tzdata 2018f

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

5 years agoMFC r339388:
hselasky [Fri, 19 Oct 2018 08:40:25 +0000 (08:40 +0000)]
MFC r339388:
Fix for reception of large full speed isochronous frames via the transaction
translator, when using the DWC OTG USB controller driver. Make sure to re-try
getting the complete split packets until a DATA0 packet is received. Larger
isochronous frames may be split into multiple MDATA packets terminated
by a single DATA0 packet.

PR: 230434
Sponsored by: Mellanox Technologies

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

5 years agoMFC r339211:
jamie [Wed, 17 Oct 2018 16:17:56 +0000 (16:17 +0000)]
MFC r339211:

  Fix the test prohibiting jails from sharing IP addresses.

  It's not supposed to be legal for two jails to contain the same IP address,
  unless both jails contain only that one address.  This is the behavior
  documented in jail(8), and is there to prevent confusion when multiple
  jails are listening on IADDR_ANY.

  VIMAGE jails (now the default for GENERIC kernels) test this correctly,
  but non-VIMAGE jails have been performing an incomplete test when nested
  jails are used.

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

5 years agoMFC r338200: Adding device ID for Terratec SiXPack 5.1+.
avatar [Wed, 10 Oct 2018 22:51:45 +0000 (22:51 +0000)]
MFC r338200: Adding device ID for Terratec SiXPack 5.1+.

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

5 years agoMFC r338993:
hselasky [Fri, 5 Oct 2018 07:50:44 +0000 (07:50 +0000)]
MFC r338993:
When multiple threads are involved receiving completion events in LibUSB
make sure there is always a master polling thread, by setting the "ctx_handler"
field in the context. Else the reception of completion events can stop.
This happens if event threads are created and destroyed during runtime.

Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR: 231742
Sponsored by: Mellanox Technologies

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

5 years agoSelectivly backport fix for firmware command hang when switching from
hselasky [Tue, 2 Oct 2018 16:01:33 +0000 (16:01 +0000)]
Selectivly backport fix for firmware command hang when switching from
polling-based firmware commands to event based firmware commands.

This is a direct commit.

Linux commit:
a7e1f04905e5b2b90251974dddde781301b6be37

Sponsored by: Mellanox Technologies

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

5 years agoDocument EN-18:09 through EN-18:12.
gjb [Mon, 1 Oct 2018 18:15:25 +0000 (18:15 +0000)]
Document EN-18:09 through EN-18:12.

Sponsored by: The FreeBSD Foundation

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

5 years agoMFC r337222:
asomers [Mon, 1 Oct 2018 18:00:52 +0000 (18:00 +0000)]
MFC r337222:

Fix LOCAL_PEERCRED with socketpair(2)

Enable the LOCAL_PEERCRED socket option for unix domain stream sockets
created with socketpair(2). Previously, it only worked with unix domain
stream sockets created with socket(2)/listen(2)/connect(2)/accept(2).

PR: 176419
Reported by: Nicholas Wilson <nicholas@nicholaswilson.me.uk>
Differential Revision: https://reviews.freebsd.org/D16350

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

5 years agoMFC r336871, r336874
asomers [Mon, 1 Oct 2018 16:23:00 +0000 (16:23 +0000)]
MFC r336871, r336874

r336871:
getrusage(2): fix return value under 32-bit emulation

According to the man page, getrusage(2) should return EFAULT if the rusage
argument lies outside of the process's address space. But due to an
oversight in r100384, that's never been the case during 32-bit emulation.
Fix it.

PR: 230153
Reported by: tests(7)
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D16500

r336874:
freebsd32_getrusage(2): skip freebsd32_rusage_out on error

PR: 230153
Reported by: kib
X-MFC-With: 336871
Differential Revision: https://reviews.freebsd.org/D16500

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

5 years agoMFC r337973:
asomers [Mon, 1 Oct 2018 16:14:38 +0000 (16:14 +0000)]
MFC r337973:

Add Modbus Application Protocol to /etc/services

IANA reassigned ports 502 and 802 on 2014-06-10

PR: 213276
Submitted by: Mark.Martinec@ijs.si

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

5 years agoMFC r338216:
asomers [Mon, 1 Oct 2018 16:11:09 +0000 (16:11 +0000)]
MFC r338216:

tftpd: Fix data corruption bug with netascii

Transferring files in netascii format requires, among other things,
translating all CR characters to a CR,NUL pair. tftpd does this correctly
except when the CR occurs as the last octet of a packet. In that case, it
erroneously drops the NUL which should be part of the following packet. The
bug was caused by using 0 as a sentinel value in a variable that could
legitimately hold 0. Fix it by switching the sentinel value to -1.

PR: 178055
Reported by: Richard <rsitze@gmail.com>
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D16853

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

5 years agoMFC r337779:
asomers [Mon, 1 Oct 2018 16:10:27 +0000 (16:10 +0000)]
MFC r337779:

tftp: Close a resource leak when putting files

Reported by: Coverity
CID: 1394842

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

5 years agoMFC r336609:
asomers [Mon, 1 Oct 2018 16:09:20 +0000 (16:09 +0000)]
MFC r336609:

Fix several Coverity warnings in tftp

Some of the changes are in the libexec/tftpd directory, but to functions that
are only used by tftp(1) (they share some code).

* strcpy => strlcpy (1006793100679410067961006741)
* Unchecked return value and TOCTTOU (1009314)
* NULL pointer dereference (10180351018036)

Reported by: Coverity
CID: 100679310067941006796100674110093141018035
CID: 1018036

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

5 years agoMFC r336605:
asomers [Mon, 1 Oct 2018 16:08:27 +0000 (16:08 +0000)]
MFC r336605:

Fix multiple Coverity warnings in tftpd(8)

* Initialize uninitialized variable (CID 1006502)
* strcpy => strlcpy (CID 100679210067911006790)
* Check function return values (CID 100944210094411009440)
* Delete dead code in receive_packet (not reported by Coverity)
* Remove redundant alarm(3) in receive_packet (not reported by Coverity)

Reported by: Coverity
CID: 1006502100679210067911006790100944210094411009440
Differential Revision: https://reviews.freebsd.org/D11287

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

5 years agoMFC r336587:
asomers [Mon, 1 Oct 2018 16:07:32 +0000 (16:07 +0000)]
MFC r336587:

tftpd(8): when completing an WRQ, flush the file before acknowleding receipt

tftpd(8) should flush a newly written file to disk before ACKing the final DATA
packet.  Otherwise there is a narrow race window when a subsequent read may not
see the file.  This is somewhat related to r330710, but the race window is much
smaller.  Hopefully this will fix the intermittent tests in Jenkins.

Reported by: Jenkins

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

5 years agoMFC r338827:
mm [Fri, 28 Sep 2018 22:02:01 +0000 (22:02 +0000)]
MFC r338827:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1019: Add allocation check for the zip_entry struct
  Oss-Fuzz #10192: Handle whitespace-only ACL fields correctly

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

5 years agoMFC 337673: Add an overview section to bus_dma.9.
jhb [Fri, 28 Sep 2018 17:40:06 +0000 (17:40 +0000)]
MFC 337673: Add an overview section to bus_dma.9.

Describe the role of tags and mapping objects as abstractions.
Describe static vs dynamic transaction types and give a brief overview
of the set of functions and object life cycles used for static vs
dynamic.

While here, fix a few other typos and expand a bit on parent tags.

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

5 years agoThere are various cases where we modify the inp_vflag and inp_inc.inc_flags
gordon [Thu, 27 Sep 2018 18:48:50 +0000 (18:48 +0000)]
There are various cases where we modify the inp_vflag and inp_inc.inc_flags
fields during a syscall, but don't restore those fields if the operation
fails.  This can leave the inp structure in an inconsistent state and cause
various problems.

Restore the inp_vflag and inp_inc.inc_flags fields when the underlying
operation fails and the inp could be in an inconsistent state.

This is a direct commit to the branch as the code is different enough in
the other branches to make it difficult to resolve a merge.

Submitted by: jtl@
Reported by: Jakub Jirasek, Secunia Research at Flexera
Reviewed by: jhb@
Approved by: so
Security: FreeBSD-EN-18:11.listen
Security: CVE-2018-6925

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

5 years agoMFC r338982.
gordon [Thu, 27 Sep 2018 18:44:40 +0000 (18:44 +0000)]
MFC r338982.

Clear stack allocated data structure to prevent kernel memory leak.

Reported by: Thomas Barabosch, Fraunhofer FKIE
Reviewed by: wes@
Approved by: so
Security: FreeBSD-EN-18:12.mem
Security: CVE-2018-17155

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

5 years agoMFC r338724:
markj [Mon, 24 Sep 2018 14:50:44 +0000 (14:50 +0000)]
MFC r338724:
Fix an nvpair leak in vdev_geom_read_config().

PR: 230704

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

5 years agoMFC r338754:
gjb [Fri, 21 Sep 2018 15:58:08 +0000 (15:58 +0000)]
MFC r338754:
 Update the pkg-stage.sh script used to populate packages on the
 dvd1.iso installation medium from including KDE4 to KDE5, as the
 KDE4-based ports have been marked as deprecated in the Ports
 Collection.

Sponsored by: The FreeBSD Foundation

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

5 years agoMFC r317659, r317752:
mav [Wed, 19 Sep 2018 19:54:13 +0000 (19:54 +0000)]
MFC r317659, r317752:
Make some UART consoles to not spin wait for data to be sent.

At least with Tx FIFO enabled it shows me ~10% reduction of verbose boot
time with serial console at 115200 baud.

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

5 years agoMFC r308750:
mav [Wed, 19 Sep 2018 19:52:53 +0000 (19:52 +0000)]
MFC r308750:
Add support for UART found in the Ingenic XBurst system on chips.

These CPUs has non-standard UART enable bit hidden in the UART FIFO
Control Register.

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

5 years agoMFC r338600:
mm [Wed, 19 Sep 2018 09:41:44 +0000 (09:41 +0000)]
MFC r338600:
Update libarchive to 3.3.3

As all important changes have already been merged from libarchive git
this is just a version number bump, documentation update and some
polishing for cpio tests. Other source code changes are not relevant to
FreeBSD.

Relnotes: yes

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

5 years agoMFC r338679:
hselasky [Wed, 19 Sep 2018 08:12:41 +0000 (08:12 +0000)]
MFC r338679:
Improve LibUSB debugging by simultaneously allowing both function
and transfer prints. Make sure the debug level comes from the
correct USB context.

Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR: 231264
Sponsored by: Mellanox Technologies

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

5 years agoMFC r338616:
hselasky [Wed, 19 Sep 2018 07:57:30 +0000 (07:57 +0000)]
MFC r338616:
Fix issues about cancelling USB transfers in LibUSB when the USB device has
been detached. When a USB device has been detached the kernel file handle
stops responding to commands. USB applications which continue to run after
the USB device has been detached, depend on LibUSB generated events to tear
down its pending USB transfers. Add code to handle the needed cleanup when
processing the USB transfer(s) fails and prevent new USB transfer(s) from
being submitted.

Found by: Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com>
PR: 231076
Sponsored by: Mellanox Technologies

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

5 years agoMFC r309748 (by glebius):
dim [Tue, 18 Sep 2018 20:46:55 +0000 (20:46 +0000)]
MFC r309748 (by glebius):

Treat R_X86_64_PLT32 relocs as R_X86_64_PC32.

If we load a binary that is designed to be a library, it produces
relocatable code via assembler directives in the assembly itself
(rather than compiler options).  This emits R_X86_64_PLT32 relocations,
which are not handled by the kernel linker.

Submitted by: gallatin
Reviewed by: kib
PR: 231451

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

5 years agoAdd xml:id for diff reduction.
gjb [Thu, 13 Sep 2018 15:58:03 +0000 (15:58 +0000)]
Add xml:id for diff reduction.

Sponsored by: The FreeBSD Foundation

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

5 years agoDocument SA-18:12 and EN-18:08.
gjb [Thu, 13 Sep 2018 15:55:22 +0000 (15:55 +0000)]
Document SA-18:12 and EN-18:08.

Sponsored by: The FreeBSD Foundation

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

5 years agoMFC: r333614, r333647, r338275, r338280, r338513
marius [Thu, 13 Sep 2018 10:18:50 +0000 (10:18 +0000)]
MFC: r333614, r333647, r338275, r338280, r338513

- Let mmcsd_ioctl() ensure appropriate privileges via priv_check(9).
- If present, take advantage of the R/W cache of eMMC revision 1.5 and
  later devices. These caches work akin to the ones found in HDDs/SSDs
  that ada(4)/da(4) also enable if existent, but likewise increase the
  likelihood of data loss in case of a sudden power outage etc. On the
  other hand, write performance is up to twice as high for e. g. 1 GiB
  files depending on the actual chip and transfer mode employed.
  For maximum data integrity, the usage of eMMC caches can be disabled
  via the hw.mmcsd.cache tunable.
- Get rid of the NOP mmcsd_open().
- Obtain the bus mode (MMC or SD) from the directly superordinated
  bus rather than reaching up to the bridge and use the cached mode
  in mmcsd_delete(), too.
- Use le32dec(9) for decoding EXT_CSD values where it makes sense. [1]
- Locally cache some instance variable values in mmc_discover_cards()
  in order to improve the code readability a bit.

Obtained from: NetBSD [1]

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

5 years agoMFC: r333613
marius [Thu, 13 Sep 2018 09:26:16 +0000 (09:26 +0000)]
MFC: r333613

The broken DDR52 support of Intel Bay Trail eMMC controllers rumored
in the commit log of r321385 has been confirmed via the public VLI54
erratum. Thus, stop advertising DDR52 for these controllers.
Note that this change should hardly make a difference in practice as
eMMC chips from the same era as these SoCs most likely support HS200
at least, probably even up to HS400ES.

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

5 years agoMFC: r338261, r338512
marius [Thu, 13 Sep 2018 09:20:07 +0000 (09:20 +0000)]
MFC: r338261, r338512

- According to section 2.2.5 of the SDHCI specification version 4.20,
  SDHCI_TRNS_ACMD12 is to be set only for multiple-block read/write
  commands without data length information, so don't unconditionally
  set this bit. The result matches what e. g. Linux does.
- Section 2.2.19 of the SDHCI specification version 4.20 states that
  SDHCI_ACMD12_ERR should be only valid if SDHCI_INT_ACMD12ERR is set
  and hardware may clear SDHCI_ACMD12_ERR when SDHCI_INT_ACMD12ERR is
  cleared (differing silicon behavior is specifically allowed, though).
  Thus, read SDHCI_ACMD12_ERR before clearing SDHCI_INT_ACMD12ERR.
  While at it, use the 16-bit accessor rather than the 32-bit one for
  reading the 16-bit SDHCI_ACMD12_ERR.
- SDHCI_INT_TUNEERR isn't one of the ROC bits in SDHCI_INT_STATUS so
  clear it explicitly.
- Add missing prototypes and sort them.
- Explicitly compare a pointer to NULL. The __builtin_expect() of clang
  3.4.1 otherwise isn't able to cope with the expression.

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

5 years agoFix incorrect display of the sys.class.infiniband.xxx.ports.1.rate sysctl
hselasky [Wed, 12 Sep 2018 10:53:22 +0000 (10:53 +0000)]
Fix incorrect display of the sys.class.infiniband.xxx.ports.1.rate sysctl
entry in ibcore by adding support for new rate types.

This is a direct commit.

Sponsored by: Mellanox Technologies

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

5 years agoMFC 338603:
gordon [Wed, 12 Sep 2018 05:03:30 +0000 (05:03 +0000)]
MFC 338603:
Correct ELF header parsing code to prevent invalid ELF sections from
disclosing memory.

Submitted by: markj
Reported by: Thomas Barabosch, Fraunhofer FKIE
Approved by: so
Security: FreeBSD-SA-18:12.elf
Security: CVE-2018-6924
Sponsored by: The FreeBSD Foundation

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

5 years agoMFC r338492:
hselasky [Mon, 10 Sep 2018 08:10:52 +0000 (08:10 +0000)]
MFC r338492:
Add support for receive side scaling stride, RSSS, in mlx5en(4).

The receive side scaling stride parameter is a value which define the interval
between active receive side queues. The traffic for the inactive queues is
redirected to the nearest active queue by use of modulus. The default value
of this parameter is one, which means all receive side queues are used.

The point of this feature is to redirect more traffic to fewer receive side
queues in order to take more advantage of sorted large receive offload,
sorted LRO. The sorted LRO works better when more packets are accumulated
per service interval.

Sponsored by: Mellanox Technologies

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

5 years agoMFC r338490:
hselasky [Mon, 10 Sep 2018 08:06:34 +0000 (08:06 +0000)]
MFC r338490:
Don't stall transmit queue on drops in mlx5en(4).

When a transmitted packet is dropped don't stall the transmit queue.

Sponsored by: Mellanox Technologies

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

5 years agoMFC r338489:
hselasky [Mon, 10 Sep 2018 08:03:52 +0000 (08:03 +0000)]
MFC r338489:
Maximum number of mbuf frags is off-by-one for worst case scenario in mlx5en(4).

Inspecting the PRM no more than 0x3F data segments, DS, of size 16 bytes is
allowed.

Worst case scenario summary of DS usage:
Header is fixed: 2 DS
Maximum inlining: 98 => (98 - 2) / 16 = 6 DS
Remainder: 0x3F - 2 - 6 = 55 DS (mbuf frags)

Previously a value of 56 DS was used and this would work in the
normal case because not all inline data area was used up.

Sponsored by: Mellanox Technologies

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

5 years agoMFC r316623: fix build after incomplete MFC r338544 by me.
eugen [Sun, 9 Sep 2018 18:40:30 +0000 (18:40 +0000)]
MFC r316623: fix build after incomplete MFC r338544 by me.

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

5 years agoMFC r316615 by sevan: Remove the last vestiges of FDC_DEBUG & FD_DEBUG
eugen [Sun, 9 Sep 2018 18:10:35 +0000 (18:10 +0000)]
MFC r316615 by sevan: Remove the last vestiges of FDC_DEBUG & FD_DEBUG

PR:             105608
Submitted by:   Differential Revision:  https://reviews.freebsd.org/D10303

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

5 years agoMFC r338126: MFV r338092: ntp 4.2.8p12.
delphij [Sat, 8 Sep 2018 04:10:26 +0000 (04:10 +0000)]
MFC r338126: MFV r338092: ntp 4.2.8p12.

Relnotes: yes

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

5 years agoMFC: r338304
marius [Wed, 5 Sep 2018 20:47:51 +0000 (20:47 +0000)]
MFC: r338304

The read accessors generated by __BUS_ACCESSOR() have the problem that
they don't check the result of BUS_READ_IVAR(9) and silently return stack
garbage on failure in case a bus doesn't implement a particular instance
variable for example. With MMC bridges not providing MMCBR_IVAR_RETUNE_REQ,
yet, this in turn can cause mmc(4) to get into a state in which re-tuning
seems to be necessary but is inappropriate, causing mmc_wait_for_request()
to fail. Thus, don't use __BUS_ACCESSOR() for mmcbr_get_retune_req() and
instead provide a version of the latter which returns retune_req_none if
reading MMCBR_IVAR_RETUNE_REQ fails.

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

5 years agoAvoid printing extraneous function names when searching man page
cy [Wed, 5 Sep 2018 01:33:30 +0000 (01:33 +0000)]
Avoid printing extraneous function names when searching man page
database (apropos, man -k). This commit Replaces .SS with .SH,
similar to the man page provided by original heimdal (as in port).

PR: 230573
Submitted by: yuripv@yuripv.net

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

5 years agoMFC r337522:
delphij [Mon, 3 Sep 2018 06:57:25 +0000 (06:57 +0000)]
MFC r337522:

In read_zones(), check if the file name actually fit in the buffer
and make sure it would terminate with nul with strlcpy().

Reviewed by: imp (earlier revision)
Differential Revision: https://reviews.freebsd.org/D16595

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

5 years agoMFC r338038: Extending the delay cycles to give the codec more time to pump ADC data...
avatar [Sun, 26 Aug 2018 13:03:58 +0000 (13:03 +0000)]
MFC r338038: Extending the delay cycles to give the codec more time to pump ADC data across the AC-link.

Without this patch, some CS4614 cards will need users to reload the driver manually or
the hardware won't be initialised properly. Something like:

# kldload snd_csa
# kldunload snd_csa
# kldload snd_csa

Tested with: Terratec SiXPack 5.1+

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

5 years agoMFC r336420,336433,336593,336621,336622,336624,337394,337401,338141
cperciva [Sun, 26 Aug 2018 05:28:17 +0000 (05:28 +0000)]
MFC r336420,336433,336593,336621,336622,336624,337394,337401,338141

Teach the EC2 AMI upload code to:
* Mark EBS snapshots as public,
* Announce new AMIs to an SNS topic, and
* Place the SVN branch and revision into the AMI "description".

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

5 years agoMFC 338013: bsnmpd(8): fix and optimize interface description processing
eugen [Sat, 25 Aug 2018 10:42:44 +0000 (10:42 +0000)]
MFC 338013: bsnmpd(8): fix and optimize interface description processing

* correctly prepare a buffer to obtain interface description from a kernel
  and truncate long description instead of dropping it altogether and
  spamming logs;
* skip calling strlen() for each description and each SNMP request
  for MIB-II/ifXTable's ifAlias.
* teach bsnmpd to allocate memory dynamically for interface descriptions
  to decrease memory usage for common case and not to break
  if long description occurs;

PR: 217763
Reviewed by: harti and others
Differential Revision: https://reviews.freebsd.org/D16459

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

5 years agoMFC: r337438
rmacklem [Fri, 24 Aug 2018 22:48:19 +0000 (22:48 +0000)]
MFC: r337438
Allow newnfs_request() to retry all callback RPCs with an NFSERR_DELAY reply.

The code in newnfs_request() retries RPCs that get a reply of NFSERR_DELAY,
but exempts certain NFSv4 operations. However, for callback RPCs, there
should not be any exemptions at this time. The code would have erroneously
exempted the CBRECALL callback, since it has the same operation number as
the CLOSE operation.
This patch fixes this by checking for a callback RPC (indicated by clp != NULL)
and not checking for exempt operations for callbacks.
This would have only affected the NFSv4 server when delegations are enabled
(they are not enabled by default) and the client replies to CBRECALL with
NFSERR_DELAY. This may never actually happen.
Spotted during code inspection.

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

5 years agoMFC r338120: config(8): Allow escape-quoted empty strings
kevans [Thu, 23 Aug 2018 02:20:09 +0000 (02:20 +0000)]
MFC r338120: config(8): Allow escape-quoted empty strings

For use with things like BOOT_TAG=\"\" -- there are valid reasons to allow
empty strings, especially as these are usually being passed through as
options. The same argument could perhaps be made for the unquoted
variant in things like MODULES_OVERRIDE="", but it's not immediately clear
that this is an issue so I've left it untouched.

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

5 years agoMFC r337456:
pfg [Wed, 22 Aug 2018 04:21:25 +0000 (04:21 +0000)]
MFC r337456:
msdosfs: fixes for Undefined Behavior.

These were found by the Undefined Behaviour GsoC project at NetBSD:

Do not change signedness bit with left shift.
While there avoid signed integer overflow.
Address both issues with using unsigned type.

msdosfs_fat.c:512:42, left shift of 1 by 31 places cannot be represented
in type 'int'
msdosfs_fat.c:521:44, left shift of 1 by 31 places cannot be represented
in type 'int'
msdosfs_fat.c:744:14, left shift of 1 by 31 places cannot be represented
in type 'int'
msdosfs_fat.c:744:24, signed integer overflow: -2147483648 - 1 cannot be
represented in type 'int [20]'
msdosfs_fat.c:840:13, left shift of 1 by 31 places cannot be represented
in type 'int'
msdosfs_fat.c:840:36, signed integer overflow: -2147483648 - 1 cannot be
represented in type 'int [20]'

Detected with micro-UBSan in the user mode.

Hinted from: NetBSD (CVS 1.33)

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

5 years agoMFC r338047:
cy [Wed, 22 Aug 2018 01:43:11 +0000 (01:43 +0000)]
MFC r338047:

The bucket index is subtracted by one at lines 2304 and 2314.  When 0 it
becomes -1, except these are unsigned integers, so they become very large
numbers. Thus are always larger than the maximum bucket; the hash table
insertion fails causing NAT to fail.

This commit ensures that if the index is already zero it is not reduced
prior to insertion into the hash table.

PR: 208566

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

5 years agoMFC r338046:
cy [Wed, 22 Aug 2018 01:23:11 +0000 (01:23 +0000)]
MFC r338046:

Add handy DTrace probes useful in diagnosing NAT issues. DTrace probes
are situated next to error counters and/or in one instance prior to the
-1 return from various functions. This was useful in diagnosis of
PR/208566 and will be handy in the future diagnosing NAT failures.

PR: 208566

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

5 years agoMFC r338045:
cy [Wed, 22 Aug 2018 01:04:52 +0000 (01:04 +0000)]
MFC r338045:

Expose np (nat_t - an entry in the nat table structure) in the DTrace
probe when nat fails (label badnat). This is useful in diagnosing
failed NAT issues and was used in PR/208566.

PR: 208566

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

5 years agoMFC: r336839
rmacklem [Tue, 21 Aug 2018 11:17:25 +0000 (11:17 +0000)]
MFC: r336839
Modify the NFSv4.1 server so that it allows ReclaimComplete as done by ESXi 6.7.

I believe that a ReclaimComplete with rca_one_fs == TRUE is only
to be used after a file system has been transferred to a different
file server.  However, RFC5661 is somewhat vague w.r.t. this and
the ESXi 6.7 client does both a ReclaimComplete with rca_one_fs == TRUE
and one with ReclaimComplete with rca_one_fs == FALSE.
Therefore, just ignore the rca_one_fs == TRUE operation and return
NFS_OK without doing anything instead of replying NFS4ERR_NOTSUPP.
This allows the ESXi 6.7 NFSv4.1 client to do a mount.
After discussion on the NFSv4 IETF working group mailing list, doing this
along with setting a flag to note that a ReclaimComplete with rca_one_fs TRUE
was an appropriate way to handle this.
The flag that indicates that a ReclaimComplete with rca_one_fs == TRUE was
done may be used to disable replies of NFS4ERR_GRACE for non-reclaim
state operations in a future commit.

This patch along with r332790, r334492 and r336357 allow ESXi 6.7 NFSv4.1 mounts
work ok. ESX 6.5 NFSv4.1 mounts do not work well, due to what I believe are
violations of RFC-5661 and should not be used.

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

5 years agoMFC r337410:
cy [Tue, 21 Aug 2018 00:37:48 +0000 (00:37 +0000)]
MFC r337410:

Remove redundant and incorrect default definition of AF_INET6. AF_INET6
is defined in sys/socket.h where it's defined as 28.

A bit of trivia: On NetBSD AF_INET6 is defined as 24. On Solaris it is
defined as 26. This is probably why Darren defaulted to 26, because
ipfilter was originally written for SunOS 4 and Solaris many moons ago.

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

5 years agoMFC r337969:
kp [Mon, 20 Aug 2018 15:43:08 +0000 (15:43 +0000)]
MFC r337969:

pf: Limit the maximum number of fragments per packet

Similar to the network stack issue fixed in r337782 pf did not limit the number
of fragments per packet, which could be exploited to generate high CPU loads
with a crafted series of packets.

Limit each packet to no more than 64 fragments. This should be sufficient on
typical networks to allow maximum-sized IP frames.

This addresses the issue for both IPv4 and IPv6.

Security: CVE-2018-5391
Sponsored by: Klara Systems

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

5 years agoMFC r337867:
jamie [Mon, 20 Aug 2018 05:32:42 +0000 (05:32 +0000)]
MFC r337867:

  Don't let clobber jailparam values when checking for modification of
  init-only parameters.

PR: 230487
Submitted by: Jason Mader

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

5 years agoMFH r337745:
mm [Sat, 18 Aug 2018 23:24:53 +0000 (23:24 +0000)]
MFH r337745:
Sync libarchive with vendor..

Vendor changes:
  PR #1042: validate iso9660 directory record length

MFC after: 3 days
Security: CVE-2017-14501

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

5 years agoMFC r337322:
dim [Fri, 17 Aug 2018 06:31:30 +0000 (06:31 +0000)]
MFC r337322:

Fix build of hyperv with base gcc on i386

Summary:
Base gcc fails to compile `sys/dev/hyperv/pcib/vmbus_pcib.c` for i386,
with the following -Werror warnings:

cc1: warnings being treated as errors
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'new_pcichild_device':
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:567: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'vmbus_pcib_on_channel_callback':
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:940: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'hv_pci_protocol_negotiation':
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:1012: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'hv_pci_enter_d0':
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:1073: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'hv_send_resources_allocated':
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:1125: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c: In function 'vmbus_pcib_map_msi':
/usr/src/sys/dev/hyperv/pcib/vmbus_pcib.c:1730: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

This is because on i386, several casts from `uint64_t` to a pointer
reduce the value from 64 bit to 32 bit.

For gcc, this can be fixed by an intermediate cast to uintptr_t. Note
that I am assuming the incoming values will always fit into 32 bit!

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

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

5 years agoMFC r337558, r337560
cy [Fri, 17 Aug 2018 02:46:36 +0000 (02:46 +0000)]
MFC r337558, r337560

r337558:
Identify the return value (rval) that led to the IPv4 NAT failure
in ipf_nat_checkout() and report it in the frb_natv4out and frb_natv4in
dtrace probes.

This is currently being used to diagnose NAT failures in PR/208566. It's
rather handy so this commit makes it available for future diagnosis and
debugging efforts.

PR: 208566

r337560:
Correct a comment. Should have been detected by ipf_nat_in() not
ipf_nat_out().

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

5 years agoMFC r337727 (rewritten due to unmerged API change in 11+):
brooks [Thu, 16 Aug 2018 15:54:12 +0000 (15:54 +0000)]
MFC r337727 (rewritten due to unmerged API change in 11+):

Copy out from kernel to data, not the other way around.

Sponsored by: DARPA, AFRL

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

5 years agoDocument SA-18:09 through SA-18:11.
gjb [Thu, 16 Aug 2018 15:32:17 +0000 (15:32 +0000)]
Document SA-18:09 through SA-18:11.

Sponsored by: The FreeBSD Foundation

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

5 years agoMFC r337717, r337718:
gjb [Thu, 16 Aug 2018 15:17:22 +0000 (15:17 +0000)]
MFC r337717, r337718:

 r337717:
  Add lang/python2, lang/python3, and lang/python to GCE images
  to help avoid hard-coding 'python<MAJOR>.<MINOR>' in several
  scripts in the client-side scripts. [1]

 r337718:
  Add a space between a variable and escaped new line.

PR: 230248 [1]
Sponsored by: The FreeBSD Foundation

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

5 years agoLoad filesystem modules associated with allow.mount permissions.
jamie [Wed, 15 Aug 2018 22:32:55 +0000 (22:32 +0000)]
Load filesystem modules associated with allow.mount permissions.

PR: 192092

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

5 years agoMFC r331332:
jamie [Wed, 15 Aug 2018 21:38:44 +0000 (21:38 +0000)]
MFC r331332:

  If a jail parameter isn't found, try loading a related kernel module.

PR: 192092

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

5 years agoFix unauthenticated EAPOL-Key decryption vulnerability. [SA-18:11.hostapd]
delphij [Wed, 15 Aug 2018 05:05:02 +0000 (05:05 +0000)]
Fix unauthenticated EAPOL-Key decryption vulnerability. [SA-18:11.hostapd]

Approved by: so

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

5 years agoMFC r337508:
brooks [Tue, 14 Aug 2018 16:25:09 +0000 (16:25 +0000)]
MFC r337508:

Terminate filter_create_ext() args with NULL, not 0.

filter_create_ext() is documented to take a NULL terminated set of
arguments.  0 is promoted to an int so this would fail on 64-bit
systems if the value was not passed in a register.  On all currently
supported 64-bit architectures it is.

Obtained from: CheriBSD
Sponsored by: DARPA, AFRL

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

5 years agoMFC r337426:
markj [Tue, 14 Aug 2018 14:19:57 +0000 (14:19 +0000)]
MFC r337426:
ifconfig: Fix use of _Noreturn.

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

5 years agoBump the mlx5core, mlx5en(4) and mlx5ib driver version.
hselasky [Tue, 14 Aug 2018 11:52:05 +0000 (11:52 +0000)]
Bump the mlx5core, mlx5en(4) and mlx5ib driver version.

This is a direct commit.

Sponsored by: Mellanox Technologies

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

5 years agoMFC r330657:
hselasky [Tue, 14 Aug 2018 11:44:11 +0000 (11:44 +0000)]
MFC r330657:
Use vport rather than physical-port MTU in mlx5en(4).

Set and report vport MTU rather than physical MTU,
The driver will set both vport and physical port mtu
and will rely on the query of vport mtu.

SRIOV VFs have to report their MTU to their vport manager (PF),
and this will allow them to work with any MTU they need
without failing the request.

Also for some cases where the PF is not a port owner, PF can
work with MTU less than the physical port mtu if set physical
port mtu didn't take effect.

Based on Linux upstream commit:
cd255efff9baadd654d6160e52d17ae7c568c9d3

Submitted by: Meny Yossefi <menyy@mellanox.com>
Sponsored by: Mellanox Technologies

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

5 years agoMFC r325661:
hselasky [Tue, 14 Aug 2018 11:43:02 +0000 (11:43 +0000)]
MFC r325661:
Expose the current hardware MTU in mlx5en(4) as a separate entry
in the sysctl tree.

Sponsored by: Mellanox Technologies

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

5 years agoEnter error state when handling bad device in mlx5core and add checks
hselasky [Tue, 14 Aug 2018 11:24:14 +0000 (11:24 +0000)]
Enter error state when handling bad device in mlx5core and add checks
for error state to mlx5en(4) to make live migration work.

This is a direct commit.

Sponsored by: Mellanox Technologies

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

5 years agoMFC r336450:
hselasky [Tue, 14 Aug 2018 11:19:04 +0000 (11:19 +0000)]
MFC r336450:
Do not inline transmit headers and use HW VLAN tagging if supported by mlx5en(4).

Query the minimal inline mode supported by the card.
When creating a send queue, cache the queried mode and optimize the transmit
if no inlining is required.  In this case, we can avoid touching the headers
cache line and avoid dirtying several more lines by copying headers into
the send WQEs.  Also, if no inline headers are used, hardware assists in
the VLAN tag framing.

Submitted by: kib@, slavash@
Sponsored by: Mellanox Technologies

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

5 years agoMFC r336407:
hselasky [Tue, 14 Aug 2018 11:15:05 +0000 (11:15 +0000)]
MFC r336407:
Handle jumbo frames without requiring big clusters in mlx5en(4).

The scatter list is formed by the chunks of MCLBYTES each, and larger
than default packets are returned to the stack as the mbuf chain.

Submitted by: kib@
Sponsored by: Mellanox Technologies

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

5 years agoMFC r322325: cat: fix build with -DNO_UDOM_SUPPORT
kevans [Tue, 14 Aug 2018 01:57:11 +0000 (01:57 +0000)]
MFC r322325: cat: fix build with -DNO_UDOM_SUPPORT

PR: 230489

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

5 years agoMFC r337555, r337556:
gjb [Mon, 13 Aug 2018 14:24:00 +0000 (14:24 +0000)]
MFC r337555, r337556:
 r337555:
  Update and replace old rc daemons for GCE images.

 r337556:
  Invoke the growfs rc script for each boot on GCE.

PR: 229000, 230275
Sponsored by: The FreeBSD Foundation

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

5 years agoRemove mention of FreeBSD 9.x which is EoL'ed now.
delphij [Sun, 12 Aug 2018 21:43:59 +0000 (21:43 +0000)]
Remove mention of FreeBSD 9.x which is EoL'ed now.

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

5 years agoMFC SVN r336350: Send sysrc(8) error message to stderr (not stdout)
dteske [Fri, 10 Aug 2018 20:07:59 +0000 (20:07 +0000)]
MFC SVN r336350: Send sysrc(8) error message to stderr (not stdout)

PR: bin/229806
Reported by: Andreas Sommer <andreas.sommer87@googlemail.com>
Sponsored by: Smule, Inc.

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

5 years agoMFC r336695
davidcs [Thu, 9 Aug 2018 01:39:47 +0000 (01:39 +0000)]
MFC r336695
Remove support for QLNX_RCV_IN_TASKQ - i.e., Rx only in TaskQ.
Added support for LLDP passthru
Upgrade ECORE to version 8.33.5.0
Upgrade STORMFW to version 8.33.7.0

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

5 years agoMFC r336680
davidcs [Thu, 9 Aug 2018 01:05:25 +0000 (01:05 +0000)]
MFC r336680
Update man page with support for 41000 Series adapters

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

5 years agoMFC r336438
davidcs [Thu, 9 Aug 2018 00:48:55 +0000 (00:48 +0000)]
MFC r336438

Fixes for  the following issues:
1. Fix taskqueues drain/free to fix panic seen when interface is being
   bought down and in parallel asynchronous link events happening.

2. Fix bxe_ifmedia_status()

Submitted by:Vaishali.Kulkarni@cavium.com and Anand.Khoje@cavium.com

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