Commit Graph

273307 Commits

Author SHA1 Message Date
Navdeep Parhar
13a0d225be cxgbe(4): Enable the hardware TCP Offload Module (t4_tom) on aarch64.
MFC after:	3 days
Sponsored by:	Chelsio Communications
2022-03-02 15:13:21 -08:00
Brett Gutstein
edafb5b859 hwpmc_arm64_md.c: Correct architecture name in assertions.
Obtained from:	CheriBSD
2022-03-02 14:57:40 -08:00
Eric van Gyzen
ac69e5d471 MFV d1b143ee9a: libbsdxml (expat) 2.4.6
Update contrib/expat from 2.4.3 to 2.4.6 to fix multiple vulnerabilities.

Reviewed by:	delphij
MFC after:	2 weeks
Relnotes:	yes
Security:	yes; see contrib/expat/Changes since 2.4.3
Sponsored by:	Dell EMC Isilon
2022-03-02 16:40:47 -06:00
Eric van Gyzen
d1b143ee9a Vendor import of expat 2.4.6
Sponsored by:	Dell EMC Isilon
2022-03-02 14:00:38 -06:00
Navdeep Parhar
17f564a784 cxgbe(4): Dump some more debug registers in cim_dump_regs.
MFC after:	3 days
Sponsored by:	Chelsio Communications
2022-03-02 11:11:08 -08:00
Brian Behlendorf
29a0ffe795
ZTS: Fix import_devices_missing.ksh
Related to commit 90b77a036.  Retry the `zpool export` if the pool
is "busy" indicating there is a process accessing the mount point.
This can happen after an import, allowing it to be retried will
avoid spurious test failures.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13169
2022-03-02 11:03:53 -08:00
Kristof Provost
e5349a2909 pfctl tests: Ethernet rule parsing tests
A few basic test cases for Ethernet rule parsing.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-03-02 17:00:08 +01:00
Kristof Provost
c32cd18055 pfctl: print ethernet rules when called with '-n'
Just as pfctl already does for other rules we print the ethernet rules
we would have loaded if '-n' is specified.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-03-02 17:00:08 +01:00
Kristof Provost
0d88926740 pf tests: extend ether test to verify mac address masks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-03-02 17:00:08 +01:00
Kristof Provost
b590f17a11 pf: support masking mac addresses
When filtering Ethernet packets allow rules to specify a mac address
with a mask. This indicates which bits of the specified address are
significant. This allows users to do things like filter based on device
manufacturer.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-03-02 17:00:08 +01:00
Kristof Provost
fdadb00682 pf tests: Ensure 'pfctl -F ethernet' works
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-03-02 17:00:07 +01:00
Kristof Provost
6ea1c3cfc8 pfctl: support flushing ethernet rules
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-03-02 17:00:07 +01:00
Kristof Provost
93b64cdc59 pf tests: slightly more complect captive portal setup
Combine anchor, dummynet and rdr to produce a more complex captive
portal setup.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32484
2022-03-02 17:00:07 +01:00
Kristof Provost
d1702bd1c3 pf tests: basic test for ether anchors
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32483
2022-03-02 17:00:07 +01:00
Kristof Provost
c5131afee3 pf: add anchor support for ether rules
Support anchors in ether rules.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32482
2022-03-02 17:00:07 +01:00
Kristof Provost
87a89d6e14 pfctl: support lists of mac addresses
Teach the 'ether' rules to accept { mac1, mac2, ... } lists, similar to
the lists of interfaces or IP addresses we already supported for layer 3
filtering.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32481
2022-03-02 17:00:07 +01:00
Kristof Provost
ab1868a7d1 pf tests: test match keyword and dummynet
Ensure that the 'match' keyword works with dummynet

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32480
2022-03-02 17:00:06 +01:00
Kristof Provost
0faafc2185 pf tests: test dummynet for ether traffic
Test that we can set dummynet information on L2, which is processed by
L3 later (assuming it's not overruled by L3 rules, of course).

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32223
2022-03-02 17:00:06 +01:00
Kristof Provost
fb330f3931 pf: support dummynet on L2 rules
Allow packets to be tagged with dummynet information. Note that we do
not apply dummynet shaping on the L2 traffic, but instead mark it for
dummynet processing in the L3 code. This is the same approach as we take
for ALTQ.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32222
2022-03-02 17:00:06 +01:00
Kristof Provost
ab2886f088 pfctl: Document ethernet rule configuration
Document how 'ether' rules can be set, and what options they support.

Reviewed by:	bcr
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31751
2022-03-02 17:00:06 +01:00
Kristof Provost
77207b6022 pfctl: Document displaying Ethernet rules
Document the new 'pfctl -s ether' functionality.

Reviewed by:	bcr
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31750
2022-03-02 17:00:06 +01:00
Kristof Provost
c696d5c72f pfctl: Don't print (ether) to / from if they're not set
If we're not filtering on a specific MAC address don't print it at all,
rather than showing an all-zero address.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31749
2022-03-02 17:00:05 +01:00
Kristof Provost
30087aa2e0 pf: Support clearing ether counters
Allow the evaluations/packets/bytes counters on Ethernet rules to be
cleared.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31748
2022-03-02 17:00:05 +01:00
Kristof Provost
feefb5625b pf tests: Test ether direction
Test that we correctly match inbound ('in') or outbound ('out') Ethernet
packets.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31747
2022-03-02 17:00:05 +01:00
Kristof Provost
792d7a5630 pf tests: Basic captive portal like test
Use the ether rules to selectively (i.e. per MAC address) redirect
certain connections. Test that tags carry over to the layer-3 pf code.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31746
2022-03-02 17:00:05 +01:00
Kristof Provost
4ffb7d1300 pf tests: Test EtherType filtering
Test filtering packets by their EtherType (i.e. ARP/IPv4/IPv6/...).

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31745
2022-03-02 17:00:05 +01:00
Kristof Provost
3a04f1d1ed pf tests: Test MAC address negation
Test that we can express 'ether block from ! 00:01:02:03:04:05'.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31744
2022-03-02 17:00:04 +01:00
Kristof Provost
d6fc3ee2e7 pf tests: MAC address filtering test
Test the MAC address filtering capability in the new 'ether' feature in
pf.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31743
2022-03-02 17:00:04 +01:00
Kristof Provost
6b7c268003 pf: Only hook the Ethernet pfil hook when we have rules
Avoid the overhead of the Ethernet pfil hooks if we don't have any
Ethernet rules.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31742
2022-03-02 17:00:04 +01:00
Kristof Provost
5c75dfdf60 pf: SDTs for ether rule matching
Add static DTrace probe points to allow debugging of ether rule
matching.

Reviewed by:	mjg
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31741
2022-03-02 17:00:04 +01:00
Kristof Provost
20c4899a8e pf: Do not hold PF_RULES_RLOCK while processing Ethernet rules
Avoid the overhead of acquiring a (read) RULES lock when processing the
Ethernet rules.
We can get away with that because when rules are modified they're staged
in V_pf_keth_inactive. We take care to ensure the swap to V_pf_keth is
atomic, so that pf_test_eth_rule() always sees either the old rules, or
the new ruleset.

We need to take care not to delete the old ruleset until we're sure no
pf_test_eth_rule() is still running with those. We accomplish that by
using NET_EPOCH_CALL() to actually free the old rules.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31739
2022-03-02 17:00:03 +01:00
Kristof Provost
2b29ceb86f pfctl: Print Ethernet rules
Extent pfctl to be able to read configured Ethernet filtering rules from
the kernel and print them.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31738
2022-03-02 17:00:03 +01:00
Kristof Provost
e732e742b3 pf: Initial Ethernet level filtering code
This is the kernel side of stateless Ethernel level filtering for pf.

The primary use case for this is to enable captive portal functionality
to allow/deny access by MAC address, rather than per IP address.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31737
2022-03-02 17:00:03 +01:00
Ed Maste
731a929ac9 vt_vga: Correct "plane" spelling
I suspect the variable names and comments were accidentally French.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-03-02 10:56:40 -05:00
Ed Maste
92ef98b8fa ssh: use standalone config file for security key support
An upcoming OpenSSH update has multiple config.h settings that change
depending on whether builtin security key support is enabled.  Prepare
for this by moving ENABLE_SK_INTERNAL to a new sk_config.h header
(similar to the approach used for optional krb5 support) and optionally
including that, instead of defining the macro directly from CFLAGS.

Reviewed by:	kevans
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34407
2022-03-02 09:35:12 -05:00
Hans Petter Selasky
d94d94e2c0 libusb(3): Ignore SIGPIPE when initializing the LibUSB v1.0 API.
The LibUSB v1.0 emulation layer uses pipes internally to signal between
threads. When USB devices are reset, as part of loading firmware, SIGPIPE
may happen, and that is expected and should be ignored.

PR:		261891
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-03-02 12:33:40 +01:00
Warner Losh
369216b039 ath: fix older clang build.
Define NO_WUNUSED_BUT_SET_VARIABLE for newer clang, and use it in ATH_C
to account for different clang versions. Use it in Makefiles as well.

Sponsored by:		Netflix
Reviewed by:		kevans, jhb
Differential Revision:	https://reviews.freebsd.org/D34408
2022-03-01 22:55:34 -07:00
Warner Losh
3b17e19f02 bootstrap: bump minimum supported version
Bump the minimum supported version to build -current from to 11.3R in
preparation of removing support for older systems.  11.4R was selected
as the most recent version to go out of support.

Sponsored by:		Netflix
Reviewed by:		delphij, emaste
Differential Revision:	https://reviews.freebsd.org/D32444
2022-03-01 22:55:28 -07:00
Warner Losh
33550b4739 bootstrap: No need for kbdcontrol bootstrap anymore
We only need kbdcontrol when bootstrapping from FreeBSD 10 or
pre-FreeBSD 11.0 current. Since we can no longer build from these
versions of FreeBSD, remove the support for bootstrapping them.

Sponsored by:		Netflix
2022-03-01 22:55:24 -07:00
Warner Losh
d0e3860f70 heir: Document SYSROOT conventions
Define a place for sysroot trees to live. This assumes they come from
the base in some way, though there's not yet a build/install/etc sysroot
target. Include the FreeBSD version so multiple verrsions can be
installed on one system (it also includes the whole uname version, so
one could, in theory, install variants like CheriBSD or whatever on the
same system as FreeBSD). Use MACHINE.MACHINE_ARCH to be consistent with
the release practices, /usr/obj and other naming conventions.

Sponsored by:		Netflix
Reviewed by:		brooks
Differential Revision:	https://reviews.freebsd.org/D33754
2022-03-01 17:00:40 -07:00
Alfonso S. Siciliano
912df915c2
wlanconfig: allow to enter WiFi details if no networks found
Improve the installer: wlanconfig allows user to enter WiFi details
if no networks found, useful to connect to a hidden SSID.

PR:			246192
Reported by:		emaste
Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34149
2022-03-02 00:04:57 +01:00
Rich Ercolani
fe2ea67ddd Re-apply 6ba2e72b, silence lint
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #12978
2022-03-01 13:56:00 -08:00
Rich Ercolani
e220635995 Re-apply a78f19d3
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #12978
2022-03-01 13:55:51 -08:00
Rich Ercolani
234e9605c1 Explode zstd 1.4.5 into separate upstream files
It's much nicer to import from upstream this way, and compiles
faster too.

Everything in lib/ is unmodified 1.4.5.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #12978
2022-03-01 13:55:12 -08:00
Li-Wen Hsu
adce4585ca
Revert "Temporarily skip usr.bin.diff.diff_test.functionname in CI"
This reverts commit 85eeb6ea62.

The issue has been fixed by 4be7d087c2.

PR:		262086
2022-03-02 05:37:25 +08:00
Warner Losh
7dda139e6d ath: missed a chance to use ${ATH_C}
Fixes:		8881d206f4 (reviewed by scottl, markj in D34401)
Noticed by:	markj
Sponsored by:	Netflix
2022-03-01 14:00:14 -07:00
Mark Johnston
879b0604a8 proc: Remove assertion that P_WEXIT is not set in proc_rwmem()
exit1() sets P_WEXIT before waiting for holding threads to finish,
rather than after, so this assertion is racy.

Fixes:	12fb39ec3e ("proc: Relax proc_rwmem()'s assertion on the process hold count")
Reported by:	Jenkins
2022-03-01 15:09:45 -05:00
Mateusz Guzik
6882d53b7f zstd: build with C11
This enables thread-aware timers which in turn fixes benchmark result
reports.

Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D34238
2022-03-01 20:07:44 +00:00
Aleksa Sarai
669683c4cb
ZTS: switch to rsync for directory diffs
While "diff -r" is the most straightforward way of comparing directory
trees for differences, it has two major issues:

 * File metadata is not compared, which means that subtle bugs may be
   missed even if a test is written that exercises the buggy behaviour.
 * diff(1) doesn't know how to compare special files -- it assumes they
   are always different, which means that a test using diff(1) on
   special files will always fail (resulting in such tests not being
   added).

rsync can be used in a very similar manner to diff (with the -ni flags),
but has the additional benefit of being able to detect and resolve many
more differences between directory trees. In addition, rsync has a
standard set of features and flags while diffs feature set depends on
whether you're using GNU or BSD binutils.

Note that for several of the test cases we expect that file timestamps
will not match. For example, the ctime for a file creation or modify
event is stored in the intent log but not the mtime. Thus when replaying
the log the correct ctime is set but the current mtime is used. This is
the expected behavior, so to prevent these tests from failing, there's a
replay_directory_diff function which ignores those kinds of changes.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Closes #12588
2022-03-01 10:05:32 -08:00
Mark Johnston
3a56cfedbc fasttrap: Avoid creating WX mappings
fasttrap instruments certain instructions by overwriting them and
copying the original instruction to some per-thread scratch space which
is executed after the probe fires.  This trampoline jumps back to the
tracepoint after executing the original instruction.

The created mapping has both write and execute permissions, and so this
mechanism doesn't work when allow_wx is disabled.  Work around the
restriction by using proc_rwmem() to write to the trampoline.

Reviewed by:	vangyzen
Tested by:	Amit <akamit91@hotmail.com>
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34304
2022-03-01 12:40:35 -05:00