Commit Graph

196840 Commits

Author SHA1 Message Date
Andrew Rybchenko
6f7399cf02 MFC r340805
sfxge(4): define a handle to denote default RSS context

Make the existing filter-specific define more general.
This is the same as MC_CMD_RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID_INVALID.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18075
2018-12-26 09:43:38 +00:00
Andrew Rybchenko
4c7f2e8c36 MFC r340804
sfxge(4): insert filters for encapsulated packets

On Medford, with full-featured firmware running, encapsulated
packets may not be delivered unless filters are inserted for
them, as ordinary filters are not applied to encapsulated
packets. So filters for encapsulated packets need to be
inserted for each class of encapsulated packet. For simplicity,
catch-all filters are always inserted. These may match more
packets than the OS has asked for, but trying to insert more
precise filters increases complexity for little gain.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18074
2018-12-26 09:42:40 +00:00
Andrew Rybchenko
638e23108e MFC r340803
sfxge(4): support filters for encapsulated packets

This supports filters which match all unicast or multicast
inner frames in VXLAN, GENEVE, or NVGRE packets.
(Additional fields to match on can be added easily.)

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18073
2018-12-26 09:41:04 +00:00
Andrew Rybchenko
ddb451f436 MFC r340802
sfxge(4): use proper MCDI command for encap filters

MC_CMD_FILTER_OP_IN_EXT is needed to set filters for encapsulated
packets.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18072
2018-12-26 09:40:13 +00:00
Andrew Rybchenko
6e353a3094 MFC r340801
sfxge(4): provide information about supported tunnels

VXLAN/NVGRE (and Geneve) support is available on SFN8xxx with
full-feature firmware variant running.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18071
2018-12-26 09:38:50 +00:00
Andrew Rybchenko
a477aaa2ea MFC r340800
sfxge(4): let caller know that queue is already flushed

Tx/Rx queue may be already flushed due to Tx/Rx error on the queue or
MC reboot. Caller needs to know that the queue is already flushed to
avoid waiting for flush done event.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18070
2018-12-26 09:37:30 +00:00
Andrew Rybchenko
7e03e9bab8 MFC r340799
sfxge(4): fix error code usage

MCDI results returned in req.emr_rc have already been translated
from MC_CMD_ERR_* to errno names, so using an MC_CMD_ERR_* value
is incorrect.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18069
2018-12-26 09:36:42 +00:00
Andrew Rybchenko
2d35145a6a MFC r340798
sfxge(4): fix out of bounds read in VIs allocation

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18068
2018-12-26 09:34:26 +00:00
Andrew Rybchenko
5c594e3d4b MFC r340767
sfxge(4): limit max TXQ size on Medford to 2048

Queues with 4096 descriptors are not supported as the top bit is used
for vfifo stuffing.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D8948
2018-12-26 09:33:26 +00:00
Andrew Rybchenko
72e45f14ce MFC r312885
sfxge(4): compact the first hot part of RxQ control

buf_base_id is used on RxQ control operations only and not used on
datapath.

Sponsored by:   Solarflare Communications, Inc.
2018-12-26 09:32:30 +00:00
Andrew Rybchenko
267438dc71 MFC r312884
sfxge(4): fix RxQ structure layout vs usage on datapath

Recent changes in the pseudo header accessor prototypes start to
use common code RxQ handle on datapath. The handle was located
at the end of the structure with members not used on datapath.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D9359
2018-12-26 09:31:36 +00:00
Andrew Rybchenko
e43467b116 MFC r312883
sfxge(4): fix invalid VLAN tagging after stop/start

TxQ is destroyed on stop and last used tag should be reset to default 0
on the next start.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D9358
2018-12-26 09:30:53 +00:00
Andrew Rybchenko
d4a3959fde MFC r312868
sfxge(4): cleanup: remove unused soft context struct member rxq_cache

Sponsored by:   Solarflare Communications, Inc.
2018-12-26 09:30:06 +00:00
Andrew Rybchenko
11a7d788cd MFC r312867
sfxge(4): cleanup: remvoe trailing tab

Sponsored by:   Solarflare Communications, Inc.
2018-12-26 09:29:26 +00:00
Andrew Rybchenko
380b45e923 MFC r312866
sfxge(4): cleanup: remove unused txq_index TxQ control structure member

Sponsored by:   Solarflare Communications, Inc.
2018-12-26 09:28:40 +00:00
Andriy Voskoboinyk
cce13dd81d MFC r342211:
net80211: fix out-of-bounds read in ieee80211_amrr(9)
2018-12-25 14:06:52 +00:00
Martin Matuska
90e1fc4d10 MFC r339746,339751,339794,340866,340939,342042:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1013: Add missing h_base offset when performing absolute seeks in
            xar decompression
  PR #1023: Support extracting extattrs as non-root on non-user-writeable
            files
  PR #1061: Add support for extraction of RAR v5 archives
  PR #1066: Fix out of bounds read on empty string filename for gnutar, pax
            and v7tar
  PR #1067: Fix temporary file path buffer overflow in tests
  IS #1068: Correctly process and verify integer arguments passed to
            bsdcpio and bsdtar
  PR #1070: Don't default XAR entry atime/mtime to the current time
  PR #1080: Spelling fixes
  PR #1084: RAR5 reader bugfixes
  PR #1091: fix use-after-free in delayed newc link processing
  PR #1092: Fix a few obvious resource leaks and strcpy() misuses
  IS #1096: Support extracting ACLs with in-entry comments (GNU tar)
  PR #1102: RAR5 reader - fix big-endian problems
  PR #1105: Fix various crash, memory corruption and infinite loop conditions

  RAR5 reader: FreeBSD build platform fixes for powerpc(64), mips(64),
               sparc64 and riscv64
  RAR5 reader: more maybe-uninitialized size_t fixes for riscv64
               FreeBSD build
2018-12-21 23:33:28 +00:00
Eugene Grosbein
0b8dca6c4c MFC r342071: ng_bpf.4: fix EXAMPLES: do not activate promiscuous mode
PR:	102719
2018-12-17 07:03:36 +00:00
Hans Petter Selasky
bc6049b1b7 MFC r334648:
Add support for SIMCom SIM7600E.

PR:		226066
Sponsored by:	MSI/FUNTORO
2018-12-13 10:34:26 +00:00
Cy Schubert
a4ad88bfb5 MFC r341650:
Remove an ugly Ultrix hack. Ultrix has been AWOL since the last ice
age, more to come.
2018-12-13 03:12:15 +00:00
Hans Petter Selasky
d76c98baef MFC r341585:
mlx5en: Improve configuration of HW LRO.

In order to enable HW LRO, both the "hw_lro" sysctl in the mlx5en(4) config
space must be set, and the ifconfig(8) LRO capability must be set. Any other
settings will disable HW LRO.

Sponsored by:   Mellanox Technologies
2018-12-12 13:14:41 +00:00
Cy Schubert
642c97df2a As part of the general cleanup of the ipfilter code, special cases
are committed separately to document fixing them separately from
the general cleanup. In this case we don't want to hide the utter
brokenness of what is being fixed.

Clean up a discombobulated block of #if's, with one block unreachable.
ip_fil.c is used in ipftest which is used to dry-run test ipfilter
rules in userspace without loading them in the kernel. The call to
(*ifp->if_output) matches that in the FreeBSD kernel.

Further testing and work will be required to make ipftest fully
functional.
2018-12-11 01:49:06 +00:00
Cy Schubert
2d5eded5cf MFC r341377, r341388 (fixup):
Restore handling of PMTU discovery, removed through an unifdef(1)
following the MFV of r254219 into r255332. In addition the 'FreeBSD'
macro was never defined in ipfilter 5.1.2 thus it never would have
been enabled in the first place.

This work is prompted by a general cleanup of the IP Filter code
prompted by working to resolve a PR. More to follow.
2018-12-08 17:50:00 +00:00
Cy Schubert
eb5a9c91ba MFC r341384:
Remove IFF_DRVRLOCK as it is used in IRIX only (and we all know IRIX
is dead). This includes collaterally removing code shared by HP/UX,
SGI, and Linux, where IP Filter will in all likelihood for various
reasons never run again.
2018-12-08 17:28:52 +00:00
Cy Schubert
3eee430b0f MFC r341280:
Clean up a rather useless conditional structure member definition.
2018-12-07 21:42:41 +00:00
Andriy Gapon
1b11836f52 MFC r336641: fix incorrect operator in the AUDITPIPE_SET_QLIMIT bounds check
PR:		229983
2018-12-06 13:32:51 +00:00
Cy Schubert
c2d78c98c3 MFC r341265:
Remove an old comment/code and replace with a comment that
directly references a NetBSD commit.
2018-12-06 04:28:39 +00:00
Ed Maste
960ea6fb46 MFC r341484: Always treat firmware request and response sizes as unsigned.
This fixes an incomplete bounds check on the guest-supplied request
size where a very large request size could be interpreted as a negative
value and not be caught by the bounds check.

Submitted by:	jhb
Reported by:	Reno Robert
Security:	CVE-2018-17160
2018-12-05 21:51:39 +00:00
Ed Maste
c4a517beda MFC r298454 (araujo): Use MIN()/MAX() macros from sys/param.h. 2018-12-05 21:49:39 +00:00
Ed Maste
f3a85c82dc MFC r323010: hv_vss.4: Fix spelling of 'responsibility'
PR:		221300
Submitted by:	Fabian Keil
Obtained from:	ElectroBSD
2018-12-04 14:07:45 +00:00
Ed Maste
8e0d96988e MFC r340095: Remove apparently unused 0-byte files that cause grief on Windows
r235274 added a sort regression test (it operates by comparing output
against GNU sort).  The commit included a number of 0-byte files, one
of which ends in a trailing . which reportedly breaks svn/git checkouts
on Windows.

It appears these were added accidentally, so just remove them.

PR:		232479
2018-12-03 02:38:15 +00:00
Cy Schubert
0cd3cb2936 MFC r340868:
An OSF/1 ifdef makes absolutley no sense in a FreeBSD specific source
file.
2018-12-01 18:17:51 +00:00
Cy Schubert
35b92eedc7 MFC r340909:
Combine two lines into one following unifdef for r255332.
2018-12-01 18:09:17 +00:00
Andrew Rybchenko
a9119a2df0 MFC r340765
sfxge(4): cleanup: move into right place

Due to incorrect merge the piece of code was put in incorrect
place and diverge from libefx in other locations.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18024
2018-11-30 10:00:09 +00:00
Cy Schubert
e4276ae970 This is a direct commit to the stable/10 branch. This would have been
MFC r340754 except that etc/rc.d has been moved in HEAD which would
have resulted in a tree conflict if merged.

Allow forced start of ipmon in special cases where testing is desired
(or other special cases) and when ipfilter is disabled in rc.conf but
started by other means.
2018-11-30 06:47:01 +00:00
Ed Maste
ce76f9b658 MFC r340260: Avoid buffer underwrite in icmp_error
icmp_error allocates either an mbuf (with pkthdr) or a cluster depending
on the size of data to be quoted in the ICMP reply, but the calculation
failed to account for the additional padding that m_align may apply.

Include the ip header in the size passed to m_align.  On 64-bit archs
this will have the net effect of moving everything 4 bytes later in the
mbuf or cluster.  This will result in slightly pessimal alignment for
the ICMP data copy.

Also add an assertion that we do not move m_data before the beginning of
the mbuf or cluster.

Reported by:	A reddit user
Security:	CVE-2018-17156
Sponsored by:	The FreeBSD Foundation
2018-11-29 20:14:09 +00:00
Eugene Grosbein
6dc2319ebe MFC r339818: rcorder(8):
Add support for /etc/rc.resume, so it calls
  "rcorder -k resume" and runs scripts containing "KEYWORD: resume"
  with single "resume" argument.

  Working example is the port sysutils/cpupdate that defines
  extra_commands="resume" to reload CPU microcode cleared
  by suspend/resume sequence.

  This change does nothing for a system having no scripts with
  KEYWORD: resume.

PR:			227866
Differential Revision:	https://reviews.freebsd.org/D15247
2018-11-26 13:36:30 +00:00
Eugene Grosbein
205f3d28db makewhatis: do not try to operate on read-only mounted
directories just to fail later. This is direct commit to stable/10
instead of MFC r339817 due to makewhatis.local being moved
in recent branches.
2018-11-26 13:08:34 +00:00
Eugene Grosbein
40789e9c2b Prevent ip_input() from panicing due to unprotected access
to INADDR_HASH. This is direct commit to stable/10 instead of MFC r339808
due to significant differences in code base.

PR:			220078
Differential Revision:	https://reviews.freebsd.org/D12457
Tested-by:		Cassiano Peixoto and others
2018-11-26 12:47:12 +00:00
Eugene Grosbein
3140654d68 Prevent stf(4) from panicing due to unprotected access
to INADDR_HASH. This is direct commit to stable/10
instead of MFC r339806 due to significant differences
in code base.

PR:			220078
Differential Revision:	https://reviews.freebsd.org/D12457
Tested-by:		Cassiano Peixoto and others
2018-11-26 12:19:30 +00:00
Eugene Grosbein
6b44451479 Prevent multicast code from panicing due to unprotected access
to INADDR_HASH. This is direct commit to stable/10 instead of MFC r339807
due to significant difference in code base.

PR:                   		220078
Tested-by:			Cassiano Peixoto and others
2018-11-26 11:51:44 +00:00
Eugene Grosbein
a84cc28ddd MFC r339816: mount_msdosfs
mount_msdosfs: do not fail mounts requiring locale name conversion table
  that is already present in a kernel statically.

  For example, the command "mount_msdosfs -L ru_RU.KOI8-R" fails with error
  "mount_msdosfs: msdosfs_iconv: File exists" for a kernel having
  options LIBICONV and MSDOSFS_ICONV. After this change, it mounts
  successfully.

MFC after:		1 month
Differential Revision:	https://reviews.freebsd.org/D16951
2018-11-26 11:23:01 +00:00
Marius Strobl
650755a803 MFC: r339007, r340543, r340654
- Add ACPI identifier for AMD eMMC 5.0 controller [1]
- Add a quirk handling for AMDI0040 controllers allowing them to do HS400. [2]

Submitted by:	Rajesh Kumar [1], Shreyank Amartya (original version) [2]
2018-11-22 13:18:58 +00:00
Marius Strobl
34451c1412 MFC: r340495
- Restore setting the clock for devices which support the default/legacy
  transfer mode only (lost with r321385). [1]
- Similarly, don't try to set the power class on MMC devices that comply
  to version 4.0 of the system specification but are operated in default/
  legacy transfer or 1-bit bus mode as no power class is specified for
  these cases. Trying to set a power class nevertheless resulted in an -
  albeit harmless - error message.

PR:	231713 [1]
2018-11-21 18:54:38 +00:00
Eugene Grosbein
1f8960de4d Unbreak build after r340671. This is direct commit to stable/10. 2018-11-20 11:19:02 +00:00
Eugene Grosbein
0378a5ee13 MFC r339558: New sysctl: net.inet.icmp.error_keeptags
Currently, icmp_error() function copies FIB number from original packet
  into generated ICMP response but not mbuf_tags(9) chain.
  This prevents us from easily matching ICMP responses corresponding
  to tagged original packets by means of packet filter such as ipfw(8).
  For example, ICMP "time-exceeded in-transit" packets usually generated
  in response to traceroute probes lose tags attached to original packets.

  This change adds new sysctl net.inet.icmp.error_keeptags
  that defaults to 0 to avoid extra overhead when this feature not needed.

  Set net.inet.icmp.error_keeptags=1 to make icmp_error() copy mbuf_tags
  from original packet to generated ICMP response.

PR:		215874
2018-11-20 10:45:46 +00:00
Hans Petter Selasky
a8d10cfe8c MFC r340254:
Put a size limit on the opensm.log and use bzip2(1).

Discussed with:		markj@
Sponsored by:		Mellanox Technologies
2018-11-19 09:50:06 +00:00
Eugene Grosbein
f6a7609e51 MFC r339472: rc.initdiskless: fix commentary grammar after r339465 2018-11-19 06:52:20 +00:00
Eugene Grosbein
58838efb7f 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
2018-11-19 06:39:00 +00:00
Rick Macklem
6fb9ebbcde 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
2018-11-18 23:48:15 +00:00