Commit Graph

279782 Commits

Author SHA1 Message Date
Ed Maste
42af87b83b man9: remove duplicate superio_find_dev link
PR:		244596
Fixes:		c812bea351 ("add superio.4 and superio.9 ...")
Sponsored by:	The FreeBSD Foundation
2022-11-16 19:30:23 -05:00
Ed Maste
227f47ce0c libcompat: avoid installing include files twice
Previously some headers were getting installed twice, once as expected
and then a second time as part of the compat32 library stage.

Makefile.libcompat sets -DLIBRARIES_ONLY for the install make invocation
which causes bsd.lib.mk to skip headers.  However some headers are
handled via bsd.prog.mk, which does not use LIBRARIES_ONLY.  Explicitly
set MK_INCLUDES=no.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37413
2022-11-16 19:15:20 -05:00
Martin Matuska
9198651515 zfs: unbreak 32-bit world build broken in dbd5678dc 2022-11-17 00:33:26 +01:00
Martin Matuska
dbd5678dca zfs: merge openzfs/zfs@2163cde45
Notable upstream pull request merges:
  #13680 Add options to zfs redundant_metadata property
  #13758 Allow mounting snapshots in .zfs/snapshot as a regular user
  #13838 quota: disable quota check for ZVOL
  #13839 quota: extend quota for dataset
  #13973 Fix memory leaks in dmu_send()/dmu_send_obj()
  #13977 Avoid unnecessary metaslab_check_free calling
  #13978 PAM: Fix unchecked return value from zfs_key_config_load()
  #13979 Handle possible null pointers from malloc/strdup/strndup()
  #13997 zstream: allow decompress to fix metadata for uncompressed
         records
  #13998 zvol_wait logic may terminate prematurely
  #14001 FreeBSD: Fix a pair of bugs in zfs_fhtovp()
  #14003 Stop ganging due to past vdev write errors
  #14039 Optimize microzaps
  #14050 Fix draid2+2s metadata error on simultaneous 2 drive failures
  #14062 zed: Avoid core dump if wholedisk property does not exist
  #14077 Propagate extent_bytes change to autotrim thread
  #14079 FreeBSD: vn_flush_cached_data: observe vnode locking contract
  #14093 Fix ARC target collapse when zfs_arc_meta_limit_percent=100
  #14106 Add ability to recompress send streams with new compression
         algorithm
  #14119 Deny receiving into encrypted datasets if the keys are not
         loaded
  #14120 Fix arc_p aggressive increase
  #14129 zed: Prevent special vdev to be replaced by hot spare
  #14133 Expose zfs_vdev_open_timeout_ms as a tunable
  #14135 FreeBSD: Fix out of bounds read in zfs_ioctl_ozfs_to_legacy()
  #14152 Adds the `-p` option to `zfs holds`
  #14161 Handle and detect #13709's unlock regression

Obtained from:	OpenZFS
OpenZFS commit:	2163cde450
2022-11-16 21:27:42 +01:00
Dapeng Gao
61b146ba43 Check alignment of fp in unwind_frame
A misaligned frame pointer is certainly not a valid frame pointer and
with strict alignment enabled (as on CHERI) can cause panics when it is
loaded from later in the code.

This is a recommit of 40e0fa10f5 with
is_aligned() corrected to __is_aligned().

Reviewed By:	jhb
Differential Revision: https://reviews.freebsd.org/D34646
2022-11-16 18:29:28 +00:00
Ed Maste
07853c6c9d regen src.conf.5 after MK_CXX and arm64 Hyper-V changes
Reported by:	matteo
2022-11-16 11:37:42 -05:00
Corvin Köhne
b922cf4fe3
bhyve: build DSDT table by basl
Building the DSDT table by basl will allow it to be loaded by qemu's
ACPI table loader.

Building the DSDT is complex and basl doesn't support it yet. For that
reason, it's still compiled by iasl. It's just a bit restructured.
Upcoming commits will restructure the builds of all other ACPI tables in
a similar way. So, this commit is done for consistency reasons. We're
starting with DSDT because it doesn't point to any other tables and it's
the last one in our current build list.

Reviewed by:		jhb, markj (older version)
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36993
2022-11-16 12:43:41 +01:00
Corvin Köhne
2fb0f352b9
bhyve: add basl support for common table header
Most ACPI tables are using the same header. Make it easy to create this
header by creating a function for it.

Reviewed by:		jhb, markj (older version)
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36992
2022-11-16 12:42:19 +01:00
Emmanuel Vadot
0860c27fe8 usb/dwc3: Use more () for macros variables
Suggested by:	andrew
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-11-16 11:58:32 +01:00
Emmanuel Vadot
67c76a1ba7 arm64/rockchip: Remove rk3328-dwc3 overlays
Not needed after
3c790abfba67 arm64/rk_dwc3: Remove RK3328 support
c45296f16f79 dwc3: Handle optional clocks

Differential Revision:	https://reviews.freebsd.org/D37395
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-11-16 11:58:32 +01:00
Emmanuel Vadot
d47f5f2886 usb/dwc3: Only force USB2 based on the PHY register and IP version
We shouldn't force USB2 only based on if we have an external PHY.
The internal PHY register tell us what link speed we can acheive
and we need to force USB2 only if it cannot do USB3.
This is only available after revision 0x290A of the dwc3 IP.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D37394
Fixed:	1331c0f44b ("Add support for RockChip RK356X to DWC3 driver.")
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-11-16 11:58:32 +01:00
Emmanuel Vadot
0e87f58bd7 usb/dwc3: Read the full IDs/version
We need to enable some quirks based on the version so read it.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D37393
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-11-16 11:58:31 +01:00
Emmanuel Vadot
dbd7bb7c89 arm64/rk_dwc3: Remove RK3328 support
The RK3328 dts doesn't have the glue node so we need the dwc3 driver
to attach directly.

Differential Revision:	https://reviews.freebsd.org/D37396
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-11-16 11:58:31 +01:00
Emmanuel Vadot
0a5f342aa5 dwc3: Handle optional clocks
Usually dwc3 needs a glue node that contain the SoC specific clocks/resets.
For some reason the RK3328 DTS doesn't have this glue node and the clocks
are specified in the dwc3 node directly.
The bindings says that it is allowed but doesn't specified some strict names
for them.
Add a specific case for RK3328 based on the compatible string.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D37392
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-11-16 11:58:31 +01:00
Michael Tuexen
bd4f986644 tcp: remove unused t_rttbest
No functional change intended.

Reviewed by:		rscheff@
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D37401
2022-11-16 11:22:13 +01:00
Xin LI
bbf0e6b900 Vendor import of xz-5.2.8 (trimmed). 2022-11-15 21:53:08 -08:00
John Baldwin
7ad9aa0b93 rs: Test actual output in the tests.
Previously the tests just verified if command line arguments raised an
error or not, they did not test how command line arguments affected
the output.  This adds some sample (if simple) input and output to
each flag test as well as adding a few additional trivial tests.

Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D36835
2022-11-15 21:20:18 -08:00
John Baldwin
afb4998dd4 rs: Use getopt() and strtol() instead of mannual parsing.
This uses the "::" extension to getopt() to handle options which take
an optional argument.

The updated flag tests were all wrong before and only passed because
the manual parser failed to raise errors when a required argument was
missing.  The invalid argument test now gets a better error message.

Reviewed by:	brooks, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D36834
2022-11-15 21:19:35 -08:00
John Baldwin
838a061417 depend-cleanup.sh: Handle rs(1) moving to C++.
To support changes in filenames for programs (and not just libraries),
update clean_dep() to check .depend.foo.o files as well as
.depend.foo.pico files.
2022-11-15 21:17:28 -08:00
John Baldwin
42d10b1b56 rs: Convert to C++ to convert elem to a std::vector<char *>.
This also updates various indices and counters from int to size_t to
pacify resulting -Wsign-compare warnings.

Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D36833
2022-11-15 21:03:12 -08:00
Kyle Evans
fc8b021e7a share: i18n: fix mismatch in BIG5 esdb generation
In the first loop, we setup Big5_$i_variable where $i are elements of
$PART with : replaced to @.  Do the same in the second loop when we're
trying to refer to the same variable.

No functional change, because none of the in-tree mappings have an @
in them.

Sponsored by:	Klara, Inc.
2022-11-15 22:09:22 -06:00
John Baldwin
f53dc31bb3 src.opts.mk: Disable all of LLVM if C++ support is disabled.
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D36891
2022-11-15 19:21:20 -08:00
John Baldwin
fd104a6ebc bhyve: Use XHCI_PORTREG_PTR in one place that open-coded it.
Reviewed by:	corvink, markj
Differential Revision:	https://reviews.freebsd.org/D36888
2022-11-15 19:19:35 -08:00
John Baldwin
57fbafb8de libfetch: Pass a zeroed digest to DigestCalcResponse.
GCC 12 warns that passing "" (a constant of char[1]) to a parameter of
type char[33] could potentially overread.  It is not clear from the
context that c->qops can never be "auth-int" (and if it can't, then
the "auth-int" handling in DigestCalcResponse is dead code that should
be removed since this is the only place the function is called).

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D36825
2022-11-15 19:18:58 -08:00
John Baldwin
6100374ccf diff: Don't (ab)use sprintf() as a kind of strcat().
Previously print_header() used sprintf() of a buffer to itself as a
kind of string builder but without checking for overflows.  This
raised -Wformat-truncation and -Wrestrict warnings in GCC.  Instead,
just conditionally print the new timestamp fields after the initial
strftime()-formatted string.  While here, use sizeof(buf) with
strftime() rather than a magic number.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D36814
2022-11-15 19:17:36 -08:00
John Baldwin
4e0771714d diff: Don't treat null characters like carriage returns in readhash().
The implicit fall-through in the !D_FORCEASCII case caused null
characters to be treated as carriage returns honoring the D_STRIPCR,
D_FOLDBLANKS, and D_IGNOREBLANKS flags.

Reported by:	GCC -Wimplicit-fallthrough
Reviewed by:	bapt
Fixes:	 	3cbf98e2be diff: read whole files to determine if they are ASCII text
Differential Revision:	https://reviews.freebsd.org/D36813
2022-11-15 19:16:50 -08:00
Bjoern A. Zeeb
325ba12055 LinuxKPI: in efi.h include queue.h
sys/linker.h needs sys/queue.h;  this gets another wireless driver
closer to compiling on main.

MFC after:	3 days
2022-11-15 23:08:05 +00:00
Rich Ercolani
2163cde450
Handle and detect #13709's unlock regression (#14161)
In #13709, as in #11294 before it, it turns out that 63a26454 still had
the same failure mode as when it was first landed as d1d47691, and
fails to unlock certain datasets that formerly worked.

Rather than reverting it again, let's add handling to just throw out
the accounting metadata that failed to unlock when that happens, as
well as a test with a pre-broken pool image to ensure that we never get
bitten by this again.

Fixes: #13709

Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
2022-11-15 14:44:12 -08:00
Dag-Erling Smørgrav
eb0292d929 tftpd: cleanup
Sponsored by:	Klara, Inc.
2022-11-15 23:37:54 +01:00
Ed Maste
714f6f9c14 ipfilter: replace defunct home page link with FAQ URL
ipfilter.org disappeared in mid 2004.  There is still a FAQ at
https://www.phildev.net/ipf so point to that.
2022-11-15 17:11:59 -05:00
Michael Tuexen
9a71437621 libalias: improve handling of invalid SCTP packets
In case of a paritial chunk only pretend the result is OK if
the packet is not the last fragment and there is a valid association.

PR:		267476
MFC after:	3 days
2022-11-15 21:05:02 +01:00
Rick Macklem
e471259313 rpc.tlsservd.8: Update man page for new -N/--numdaemons option
Commit 1e588a9ceb added a new command line option -N/numdaemons
that specifies how many daemons to run. This allows a server
to be configured with more than one rpc.tlsservd daemon, which
may be necessary to handle a reboot for an NFS server with
many NFS-over-TLS client mounts.

This patch updates the man page for this commit.

This is a content change.

Reviewed by:	karels, pauamma (man pages)
Differential Revision:	https://reviews.freebsd.org/D37382
2022-11-15 13:30:41 -08:00
Cy Schubert
ed549cb0c5 heimdal: Fix multiple security vulnerabilities
The following issues are patched:

 - CVE-2022-42898 PAC parse integer overflows
 - CVE-2022-3437 Overflows and non-constant time leaks in DES{,3} and arcfour
 - CVE-2021-44758 NULL dereference DoS in SPNEGO acceptors
 - CVE-2022-44640 Heimdal KDC: invalid free in ASN.1 codec

    Note that CVE-2022-44640 is a severe vulnerability, possibly a 10.0
    on the Common Vulnerability Scoring System (CVSS) v3, as we believe
    it should be possible to get an RCE on a KDC, which means that
    credentials can be compromised that can be used to impersonate
    anyone in a realm or forest of realms.

    Heimdal's ASN.1 compiler generates code that allows specially
    crafted DER encodings of CHOICEs to invoke the wrong free function
    on the decoded structure upon decode error.  This is known to impact
    the Heimdal KDC, leading to an invalid free() of an address partly
    or wholly under the control of the attacker, in turn leading to a
    potential remote code execution (RCE) vulnerability.

    This error affects the DER codec for all extensible CHOICE types
    used in Heimdal, though not all cases will be exploitable.  We have
    not completed a thorough analysis of all the Heimdal components
    affected, thus the Kerberos client, the X.509 library, and other
    parts, may be affected as well.

    This bug has been in Heimdal's ASN.1 compiler since 2005, but it may
    only affect Heimdal 1.6 and up.  It was first reported by Douglas
    Bagnall, though it had been found independently by the Heimdal
    maintainers via fuzzing a few weeks earlier.

    While no zero-day exploit is known, such an exploit will likely be
    available soon after public disclosure.

 - CVE-2019-14870: Validate client attributes in protocol-transition
 - CVE-2019-14870: Apply forwardable policy in protocol-transition
 - CVE-2019-14870: Always lookup impersonate client in DB

Sponsored by:	so (philip)
Obtained from:	so (philip)
Tested by:	philip, cy
MFC after:	immediately
2022-11-15 13:12:37 -08:00
Cy Schubert
1ffab636da ipfilter: Document count_mask_bits() arguments
Document arguments input to count_mask_bits().

MFC after:	3 days
2022-11-15 13:11:16 -08:00
John Baldwin
2ff447ee3b cxgbe: Enable TOE TLS RX when an RX key is provided via setsockopt().
Rather than requiring a socket to be created as a TLS socket from the
get go, switch a TOE socket from "plain" TOE to TLS mode when a
receive key is added to the socket.

The firmware is only able to switch a "plain" TOE connection to TLS
mode if the head of the pending socket data is the start of a TLS
record, so the connection is migrated to TLS mode as a multi-step
process.

When TOE TLS RX is enabled, the associated connection's receive side
is frozen via a flag in the TCB.  The state of the socket buffer is
then examined to determine if the pending data in the socket buffer
ends on a TLS record boundary.  If so, the connection is migrated to
TLS mode and unfrozen.  Otherwise, the connection is unfrozen
temporarily until more data arrives.  Once more data arrives, the
receive queue is frozen again and rechecked.  This continues until the
connection is paused at a record boundary.  Any records received
before TLS mode is enabled are decrypted as software records.

Note that this removes the 'rx_tls_ports' sysctl.  TOE TLS offload for
receive is now enabled automatically on existing TOE connections when
using a KTLS-aware SSL library just as it was previously enabled
automatically for TLS transmit.  This also enables TLS offload for TOE
connections which enable TLS after passing initial data in the clear
(e.g. STARTTLS with SMTP).

Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D37351
2022-11-15 12:08:51 -08:00
John Baldwin
21186bdb2d cxgbe: Various whitespace fixes.
Mostly trailing whitespace and spaces before tabs.

Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D37350
2022-11-15 12:03:57 -08:00
John Baldwin
65bd3adbed ktls: Add tests for receiving corrupted or invalid records.
These should all trigger errors when reading from the socket.

Tests include truncated records (socket closed early on the other
side), corrupted records (bits flipped in explicit IVs, ciphertext, or
MAC), invalid header fields, and various invalid record lengths.

Reviewed by:	markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D37373
2022-11-15 12:03:19 -08:00
John Baldwin
4e47414648 ktls_ocf: Reject encrypted TLS records using AEAD that are too small.
If a TLS record is too small to contain the required explicit IV,
record_type (TLS 1.3), and MAC, reject attempts to decrypt it with
EMSGSIZE without submitting it to OCF.  OCF drivers may not properly
detect that regions in the crypto request are outside the bounds of
the mbuf chain.  The caller isn't supposed to submit such requests.

Reviewed by:	markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D37372
2022-11-15 12:02:57 -08:00
John Baldwin
64811651aa ktls: Add tests for software AES-CBC decryption for TLS 1.1+.
Reviewed by:	markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D37371
2022-11-15 12:02:28 -08:00
John Baldwin
9a673b7158 ktls: Add software support for AES-CBC decryption for TLS 1.1+.
This is mainly intended to provide a fallback for TOE TLS which may
need to use software decryption for an initial record at the start
of a connection.

Reviewed by:	markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D37370
2022-11-15 12:02:03 -08:00
Emmanuel Vadot
b97ee269ea Import device-tree files from Linux 6.0
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2022-11-15 20:02:06 +01:00
Emmanuel Vadot
d5b0e70f7e Import device-tree files from Linux 5.19
Sponsored by:   Beckhoff Automation GmbH & Co. KG
2022-11-15 20:01:13 +01:00
Emmanuel Vadot
8bf583e1ce Import device-tree files from Linux 6.0 2022-11-15 19:51:46 +01:00
Emmanuel Vadot
0085f59d9e Import device-tree files from Linux 5.19 2022-11-15 19:50:16 +01:00
Andrew Turner
8a2adde1e4 Split out the arm64 EL2 exception vectors
These were originally in locore.S as they are only needed so we have
a valid value to put into the vbar_el2 register. As these will soon
be used by bhyve so move them to a new file as we already have with
the EL1 exception vectors in exception.S.

Obtained from:	https://github.com/FreeBSD-UPB/freebsd-src (earlier version)
Sponsored by:	Innovate UK
Sponsored by:	The FreeBSD Foundation
2022-11-15 17:26:52 +00:00
Andrew Turner
2468c61958 Add more arm64 hypervisor registers
These will be used by bhyve.

Sponsored by:	Innovate UK
Sponsored by:	The FreeBSD Foundation
2022-11-15 17:26:52 +00:00
Andrew Turner
ae43a817d3 Put the arm64 vttbr_el2 register into a state
Zero the vttbr_el2 register on each CPU so we can tell if we are
running the host or guest kernel from a hypervisor.

Obtained from:	https://github.com/FreeBSD-UPB/freebsd-src (earlier version)
Sponsored by:	Innovate UK
Sponsored by:	The FreeBSD Foundation
2022-11-15 17:26:52 +00:00
Andrew Turner
80ba994bfa Add the arch field to the arm64 MIDR macros
For completeness add accessors for the MIDR field. As the field is
always 0xf on arm64 it is unneeded in the current MICR handling, but
will be used in the vmm module for bhyve.

Obtained from:	https://github.com/FreeBSD-UPB/freebsd-src (earlier version)
Sponsored by:	The FreeBSD Foundation
2022-11-15 17:26:52 +00:00
Mateusz Guzik
60bae7ec04 mac_lomac: whack giant usage
It does not protect anything, the code looks dodgy regardless.
2022-11-15 14:31:41 +00:00
Mateusz Guzik
c3f1a13902 Retire broken GPROF support from the kernel
The option is not even recognized and with that patched it does not
compile. Even if it did work, it would be prohibitively expensive to
use.

Interested parties can use pmcstat or dtrace instead.
2022-11-15 14:17:10 +00:00