Commit Graph

253954 Commits

Author SHA1 Message Date
Edward Tomasz Napierala
c0d07d326f Slightly tweak linux ptrace(2) debug message; no functional changes.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26815
2020-10-18 15:56:47 +00:00
Alexander V. Chernikov
fa8b3fcb4c Simplify NET_EPOCH_EXIT in inp_join_group().
Suggested by:	kib
2020-10-18 12:03:36 +00:00
Hans Petter Selasky
22ab212ff8 Add new USB quirk.
PR:			250422
Submitted by:		vidwer+fbsdbugs@gmail.com
MFC after:		1 week
Sponsored by:		Mellanox Technologies // NVIDIA Networking
2020-10-18 08:58:14 +00:00
Greg Lehey
bce7d45450 Correct location and date of the Boston Shoemakers' organization,
which significantly predated the USA.

Reference: http://www.famousdaily.com/history/boston-shoemakers-form-first-us-labor-organization.html
2020-10-18 03:01:26 +00:00
Bjoern A. Zeeb
04e7bb08a5 net80211: update for (more) VHT160 support
Implement two macros IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_IS_160MHZ()
and its 80+80 counter part to check in vhtcaps for appropriate
levels of support and use the macros throughout the code.

Add vht160_chan_ranges/is_vht160_valid_freq and handle analogue
to vht80 in various parts of the code.

Add ieee80211_add_channel_cbw() which also takes the CBW flag
fields and make the former ieee80211_add_channel() a wrapper to it.
With the CBW flags we can add HT/VHT channels passing them to
getflags() for the 2/5ghz functions.

In ifconfig(8) add the regdomain_addchans() support for VHT160
and VHT80P80.

With this (+ regdoain.xml updates) VHT160 channels can be
configured, listed, and pass regdomain where appropriate.

Tested with:	iwlwifi
Reviewed by:	adrian
MFC after:	10 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26712
2020-10-18 00:27:20 +00:00
Bjoern A. Zeeb
3d8a0ab61d clk: fix indentation
Just fix indentation of an if() clause.
No functional changes intended.

MFC after:	3 days
2020-10-17 23:42:33 +00:00
Bjoern A. Zeeb
f7a0bb0dec ddb: add show sysinit command
Add a show sysinit command to ddb (similar to show vnet_sysinit) which
proved to be helpful to debug some ordering issues on early-mid kernel
start panics.
2020-10-17 22:47:08 +00:00
Mateusz Guzik
4c4aa84848 cache: shorten names of debug stats 2020-10-17 21:30:46 +00:00
Mateusz Guzik
676557143f cache: don't automatically evict negative entries if usage is low
The previous scheme only looked at negative entry count in relation to the
total count, leading to tons of spurious evictions if the cache is not
significantly populated.

Instead, only try the above if negative entry count goes beyond namecache
capacity.
2020-10-17 21:22:40 +00:00
Alexander V. Chernikov
337418adf1 Fix sleepq_add panic happening with too wide net epoch in mcast control.
PR:		250413
Reported by:	Christopher Hall <hsw at bitmark.com>
Reviewed by:	ae
Differential Revision:	https://reviews.freebsd.org/D26827
2020-10-17 20:33:09 +00:00
Mitchell Horne
02a37049b4 riscv: zero reserved PTE bits for L2 PTEs
As was done for L3 PTEs in r362853, mask out the reserved bits when
extracting the physical address from an L2 PTE. Future versions of the
spec or custom implementations may make use of these reserved bits, in
which case the resulting physical address could be incorrect.

Submitted by:	Nathaniel Filardo <nwf20@cl.cam.ac.uk>
Reviewed by:	kp, mhorne
Differential Revision:	https://reviews.freebsd.org/D26607
2020-10-17 17:31:06 +00:00
Mateusz Guzik
e98c3bc667 cache: erwork sysctl vfs.cache tree
Split everything into neg, debug, param and stat categories.

The legacy nchstats sysctl (queried e.g., by systat) remains untouched.

While here rename some vars to be easier on the eye.
2020-10-17 13:06:29 +00:00
Mateusz Guzik
fa7c73d30c cache: factor negative lookup out of cache_fplookup_next 2020-10-17 13:04:46 +00:00
Mateusz Guzik
41e6b18422 cache: avoid smr in cache_neg_evict in favoro of the already held bucket lock 2020-10-17 13:04:25 +00:00
Mateusz Guzik
c38d8e1eb2 cache: rework parts of negative entry management
- declutter sysctl vfs.cache by moving relevant entries into
vfs.cache.neg
- add a little more parallelism to eviction by replacing the
global lock with an atomically modified counter
- track more statistics

The code needs further effort.
2020-10-17 08:48:58 +00:00
Mateusz Guzik
b31b5e9cfd cache: remove entries before trying to add new ones, not after
Should allow positive entries to replace negative ones in case
the cache is full.
2020-10-17 08:48:32 +00:00
Mateusz Guzik
ad89066af4 vfs: annotate mountlist_mtx with __exclusive_cache_line 2020-10-17 08:47:08 +00:00
Xin LI
5853735d5d Bump __FreeBSD_version after ptsname_r addition. 2020-10-17 04:14:46 +00:00
Xin LI
3e7224dffe Implement ptsname_r.
MFC after:	2 weeks
PR:		250062
Reviewed by:	jilles, 0mp, Ray <i maskray me>
Differential Revision:	https://reviews.freebsd.org/D26647
2020-10-17 04:14:38 +00:00
Matt Macy
180f822596 Update OpenZFS to 2.0.0-rc3-gfc5966
- fix panic due to tqid overflow
- Improve libzfs_error_init messages
- Expose zfetch_max_idistance tunable
- Make dbufstat work on FreeBSD
- Fix EIO after resuming receive of new dataset over an existing one
2020-10-17 01:06:04 +00:00
Philip Paeps
e7e2d659af Import tzdata 2020c
Changes: https://github.com/eggert/tz/blob/2020c/NEWS

MFC after:	1 day
2020-10-17 00:44:04 +00:00
Philip Paeps
3421f52711 Import tzdata 2020c 2020-10-17 00:41:14 +00:00
Mateusz Guzik
d6eee35004 cache: add a probe reporting addition of duplicate entries 2020-10-17 00:27:26 +00:00
Matt Macy
0be360124f Update OpenZFS to 2.0.0-rc3-gbd565f 2020-10-17 00:05:34 +00:00
Alexander V. Chernikov
a3525bd166 Try to enable multipath routing in flowid tests. 2020-10-16 21:51:17 +00:00
Ryan Moeller
60dc6bee1f bhyve: Update TX descriptor base address and host mapping on change
bhyve sometimes segfaults when using an e1000 NIC with a Windows guest.

We are only updating our tdba and cached host mapping when the low address
register is written and when tx is set enabled, but not when the high address
or length registers are written. It is observed that Windows 10 is occasionally
enabling tx first then writing the registers in the order low, high, len. This
leaves us with a bogus base address and mapping, which causes a segfault later
when we try to copy from a descriptor that has unpredictable garbage in a
pointer.

Updating the address and mapping when any of those registers change seems to fix
that particular issue.

Reviewed by:	mav, grehan (bhyve)
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D26798
2020-10-16 20:27:20 +00:00
Kyle Evans
6d55b98d52 libc: typo fix (s/involes/involves)
Reported by:	Masahiko Sawada via twitter
MFC after:	3 days
2020-10-16 17:51:09 +00:00
Kyle Evans
bf9580a118 MFC r366760: lua: update to 5.3.6
This release contains some minor bugfixes; notably:
- 2x minor Makefile fixes (not used in base)
- Long brackets with a huge number of '=' overflow some internal buffer
  arithmetic.
- Joining an upvalue with itself can cause a use-after-free crash.

See here for examples: http://www.lua.org/bugs.html#5.3.5

MFC after:	2 weeks
2020-10-16 17:03:27 +00:00
Konstantin Belousov
546df7a45d amd64 pmap.h: explicitly provide constants values instead of relying
on some more advanced C features.

This fixes gcc-toolchain build of exception.S.

Reported and tested by:	kevans
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2020-10-16 16:22:32 +00:00
Xin LI
fa42a0bfa4 Update arcmsr(4) to 1.50.00.00:
Add support for ARC-1886, NVMe/SAS/SATA controller.

Many thanks to Areca for continuing to support FreeBSD.

Submitted by:   黃清隆 <ching2048 areca com tw>
MFC after:      2 weeks
2020-10-16 15:55:06 +00:00
Kyle Evans
5f2aaba453 Makefile: add a small blurb about building with gcc xtoolchain
The key details are to install the appropriate flavor of devel/freebsd-gcc9
and pass CROSS_TOOLCHAIN while building.

Suggested by:	kib
2020-10-16 15:16:23 +00:00
Adrian Chadd
d00afbaea9 This fixes some fun type size truncation that shows up giving errors like
" changes value from '287948901175001088' to '0' "

.. which turns out is a known issue with later gcc's.

eg - https://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00154.html

It was fixed up upstream corelib/gnulib in commit hash
252b52457da7887667c036d18cc5169777615bb0
(eg in 252b52457d)

TEST PLAN
  - compiled/run for gcc-6.4 on amd64

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D26804
2020-10-16 14:28:13 +00:00
Mitchell Horne
3c2af8a31f arm64: export a few more HWCAPs
These were missed in the previous pass. The extensions (partially)
supported by this change are:
 - ARMv8.2-FHM, Floating-point multiplication variant
 - ARMv8.4-LSE, Large System Extensions
 - ARMv8.4-DIT, Data Independent Timing instructions

Reviewed by:	andrew, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26707
2020-10-16 13:37:58 +00:00
Mitchell Horne
0387f2aacb Update the ID_AA64MMFR2_EL1 register definitions
This brings these definitions in sync with the ARMv8.6 version of the
architecture reference manual.

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26706
2020-10-16 13:35:29 +00:00
Kyle Evans
2a40e13a7a lua: update to 5.3.6
This release contains some minor bugfixes; notably:
- 2x minor Makefile fixes (not used in base)
- Long brackets with a huge number of '=' overflow some internal buffer
  arithmetic.
- Joining an upvalue with itself can cause a use-after-free crash.

See here for examples: http://www.lua.org/bugs.html#5.3.5
2020-10-16 13:04:28 +00:00
Marcin Wojtas
ac152c14e0 Trigger soft lifetime expiration on sequence number
This patch adds 80% of UINT32_MAX limit on sequence number.
When sequence number reaches limit kernel sends SADB_EXPIRE message to
IKE daemon which is responsible to perform rekeying.

Submitted by:           Patryk Duda <pdk@semihalf.com>
Reviewed by:            ae
Differential revision:  https://reviews.freebsd.org/D22370
Obtained from:          Semihalf
Sponsored by:           Stormshield
2020-10-16 11:27:01 +00:00
Marcin Wojtas
4d36d1fd59 Add support for IPsec ESN and pass relevant information to crypto layer
Implement support for including IPsec ESN (Extended Sequence Number) to
both encrypt and authenticate mode (eg. AES-CBC and SHA256) and combined
mode (eg. AES-GCM). Both ESP and AH protocols are updated. Additionally
pass relevant information about ESN to crypto layer.

For the ETA mode the ESN is stored in separate crp_esn buffer because
the high-order 32 bits of the sequence number are appended after the
Next Header (RFC 4303).

For the AEAD modes the high-order 32 bits of the sequence number
[e.g.  RFC 4106, Chapter 5 AAD Construction] are included as part of
crp_aad (SPI + ESN (32 high order bits) + Seq nr (32 low order bits)).

Submitted by:           Grzegorz Jaszczyk <jaz@semihalf.com>
                        Patryk Duda <pdk@semihalf.com>
Reviewed by:            jhb, gnn
Differential revision:  https://reviews.freebsd.org/D22369
Obtained from:          Semihalf
Sponsored by:           Stormshield
2020-10-16 11:25:45 +00:00
Marcin Wojtas
8b7f39947c Implement anti-replay algorithm with ESN support
As RFC 4304 describes there is anti-replay algorithm responsibility
to provide appropriate value of Extended Sequence Number.

This patch introduces anti-replay algorithm with ESN support based on
RFC 4304, however to avoid performance regressions window implementation
was based on RFC 6479, which was already implemented in FreeBSD.

To keep things clean and improve code readability, implementation of window
is kept in seperate functions.

Submitted by:           Grzegorz Jaszczyk <jaz@semihalf.com>
                        Patryk Duda <pdk@semihalf.com>
Reviewed by:            jhb
Differential revision:  https://reviews.freebsd.org/D22367
Obtained from:          Semihalf
Sponsored by:           Stormshield
2020-10-16 11:24:12 +00:00
Edward Tomasz Napierala
1c34dcb532 Set default stack size for Linux apps to 8MB. This matches Linux'
defaults, makes core files smaller, and fixes applications which use
pthread_join(3) in a wrong way, namely Steam.

This is based on a patch submitted by Jason Yang, which I've reworked
to set the limit instead of only changing the value reported (which
is enough to fix the bug for Linux pthreads, but could be confusing).

PR:		248225
Submitted by:	Jason_YH_Yang at wistron.com (earlier version)
Analyzed by:	Alex S <iwtcex@gmail.com>
Reviewed by:	emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26778
2020-10-16 11:23:30 +00:00
Marcin Wojtas
1148702e43 Add SADB_SAFLAGS_ESN flag
This flag is going to be used by IKE daemon to signal if
Extended Sequence Number feature is going to be used.

Value for this flag was taken from OpenBSD source code
6b4cbaf181

Submitted by:           Patryk Duda <pdk@semihalf.com>
Reviewed by:            ae
Differential revision:  https://reviews.freebsd.org/D22366
Obtained from:          Semihalf
Sponsored by:           Stormshield
2020-10-16 11:22:29 +00:00
Marcin Wojtas
efac54cb2f Add support for ESN in AES-NI crypto driver
This patch adds support for IPsec ESN (Extended Sequence Numbers) in
encrypt and authenticate mode (eg. AES-CBC and SHA256) and combined mode
(eg. AES-GCM).

For the encrypt and authenticate mode the ESN is stored in separate
crp_esn buffer because the high-order 32 bits of the sequence number are
appended after the Next Header (RFC 4303).

For the combined modes the high-order 32 bits of the sequence number
[e.g.  RFC 4106, Chapter 5 AAD Construction] are part of crp_aad
(prepared by netipsec layer in case of ESN support enabled), therefore
non visible diff around combined modes.

Submitted by:           Grzegorz Jaszczyk <jaz@semihalf.com>
                        Patryk Duda <pdk@semihalf.com>
Reviewed by:            jhb
Differential revision:  https://reviews.freebsd.org/D22365
Obtained from:          Semihalf
Sponsored by:           Stormshield
2020-10-16 11:21:56 +00:00
Marcin Wojtas
6038018ab1 Add support for ESN in cryptosoft
This patch adds support for IPsec ESN (Extended Sequence Numbers) in
encrypt and authenticate mode (eg. AES-CBC and SHA256) and combined mode
(eg. AES-GCM).

For encrypt and authenticate mode the ESN is stored in separate crp_esn
buffer because the high-order 32 bits of the sequence number are
appended after the Next Header (RFC 4303).

For combined modes the high-order 32 bits of the sequence number [e.g.
RFC 4106, Chapter 5 AAD Construction] are part of crp_aad (prepared by
netipsec layer in case of ESN support enabled), therefore non visible
diff around combined modes.

Submitted by:           Grzegorz Jaszczyk <jaz@semihalf.com>
                        Patryk Duda <pdk@semihalf.com>
Reviewed by:            jhb
Differential revision:  https://reviews.freebsd.org/D22364
Obtained from:          Semihalf
Sponsored by:           Stormshield
2020-10-16 11:18:13 +00:00
Marcin Wojtas
7e89ae49db Prepare crypto framework for IPsec ESN support
This permits requests (netipsec ESP and AH protocol) to provide the
IPsec ESN (Extended Sequence Numbers) in a separate buffer.

As with separate output buffer and separate AAD buffer not all drivers
support this feature. Consumer must request use of this feature via new
session flag.

Submitted by:           Grzegorz Jaszczyk <jaz@semihalf.com>
                        Patryk Duda <pdk@semihalf.com>
Reviewed by:            jhb
Differential revision:  https://reviews.freebsd.org/D24838
Obtained from:          Semihalf
Sponsored by:           Stormshield
2020-10-16 11:06:33 +00:00
Hans Petter Selasky
e23ee5b884 Remove ifdefs around IS_ALIGNED() definition in the LinuxKPI.
Discussed with:		manu@
MFC after:		1 week
Sponsored by:		Mellanox Technologies // NVIDIA Networking
2020-10-16 11:01:21 +00:00
Michael Tuexen
a92d501617 Improve the handling of cookie life times.
The staleness reported in an error cause is in us, not ms.
Enforce limits on the life time via sysct; and socket options
consistently. Update the description of the sysctl variable to
use the right unit. Also do some minor cleanups.
This also fixes an interger overflow issue if the peer can
modify the cookie. This was reported by Felix Weinrank by fuzz testing
the userland stack and in
https://oss-fuzz.com/testcase-detail/4800394024452096

MFC after:		3 days
2020-10-16 10:44:48 +00:00
Edward Tomasz Napierala
139c09788b Make linux getrlimit(2) and prlimit(2) return something reasonable
for linux-specific limits.  Fixes prlimit (util-linux-2.31.1-0.4ubuntu3.7).

Reviewed by:	emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26777
2020-10-16 10:10:09 +00:00
Edward Tomasz Napierala
ce764cbd1c Bump pseudofs size limit from 128kB to 1MB. The old limit could result
in process' memory maps being truncated.

PR:		237883
Submitted by:	dchagin
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D20575
2020-10-16 09:58:10 +00:00
Mateusz Guzik
a59b0ac3aa cache: flip inverted condition in previous
It happened to not affect correctness in that the fallback code would
simply neglect to promote the entry.
2020-10-16 02:19:33 +00:00
Mateusz Guzik
e7602e04c7 cache: support negative entry promotion in slowpath smr 2020-10-16 00:56:13 +00:00
Mateusz Guzik
571bc3d1af cache: elide vhold/vdrop around promoting negative entry 2020-10-16 00:55:57 +00:00