Commit Graph

277654 Commits

Author SHA1 Message Date
Warner Losh
ef8b872301 stand: Flesh out the zfs image creation
Move the mbr non-geli zfs cases to no-priv creation with makefs / mkimg.
Add comments about the weird thing we do for MBR + ZFS + Legacy.  Add
comments about other architectures. Still need to think through how to
leverage a completed universe to do all the architectures...

Sponsored by:		Netflix
2022-08-17 11:39:53 -06:00
Jens Schweikhardt
f7473c7e77 Indicate which port gpg.1 comes from. 2022-08-17 19:23:57 +02:00
Jens Schweikhardt
3c405c7e83 Indicate which port gdb.1 and kgdb.1 come from. 2022-08-17 19:13:22 +02:00
John Baldwin
fa46f3704b bhyve e1000: Skip packets with a small header.
Certain operations such as checksum insertion and VLAN insertion
require the device model to rewrite the packet header.  The first step
in rewriting the packet header is to copy the existing packet header
from the source packet.  This copy is done by copying data from an
iovec array that corresponds to the S/G entries described by transmit
descriptors.  However, if the total packet length is smaller than the
headers that need to be copied as the initial template, this copy can
overflow the iovec array and use garbage values as the source pointer
to memcpy.  The PR used a single descriptor with a length of 0 in its
PoC.

To fix, track the total packet length and drop requests to transmit
packets whose payload is smaller than the required header length.

While here, fix another issue where the final descriptor could have an
invalid length (too short) that could underflow 'len' when stripping
the checksum.  Skip those requests instead, too.

PR:		264372
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	grehan, markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36182
2022-08-17 10:01:16 -07:00
John Baldwin
e7439f6aeb bhyve xhci: Cache the value of MaxPStreams when initializing an endpoint.
This avoids type confusion where a malicious guest could rewrite the
MaxPStreams field in an endpoint context after the endpoint was
initialized causing the device model to interpret a guest provided
address (stored in ep_ringaddr of the "software" endpoint state) as a
bhyve host process address (ep_sctx_trbs).  It also prevents a malicious
guest from triggering overflows of ep_sctx_trbs[] by increasing the
number of streams after the endpoint has been initialized.

Rather than re-reading the MaxPStreams value out of the endpoint context
in guest memory on subsequent operations, cache the value in the software
endpoint state.  Possibly the device model should raise errors if the
value of MaxPStreams changes while an endpoint is running.  This approach
simply ignores any such changes by the guest.

PR:		264294, 264347
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36181
2022-08-17 10:00:36 -07:00
John Baldwin
bcab868a65 bhyve: Style fix for read/write_config. 2022-08-17 10:00:09 -07:00
Mateusz Guzik
1b89d40fbf Revert "vm: use atomic fetchadd in vm_page_sunbusy"
This reverts commit f6ffed44a8.

fetchadd will fail the waiters flag, which can cause other
code to wait when it should not with nothing clear it

Revert until I sort this out.

Reported by:	markj
2022-08-17 16:24:14 +00:00
Bjoern A. Zeeb
e674ddec0b iwlwifi: add FreeBSD specific debugging
"Invalid TXQ id" and "Queue <n> is stuck <x> <y>" are two errors seen
more commonly by FreeBSD users.  Try to gather some extra data the
"easy way" adding more error logging for these situations in the hope
to find a clue or at least do more targetd debugging in the future.
Note that for one of the errors the Linux Intel driver has a TODO to
print register data.  If that will show up in future versions of the
driver this may also help.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-08-17 16:11:47 +00:00
Gleb Smirnoff
489482e276 ipsec: isolate knowledge about protocols that are last header
Retire PR_LASTHDR protosw flag.

Reviewed by:		ae
Differential revision:	https://reviews.freebsd.org/D36155
2022-08-17 08:24:28 -07:00
Gleb Smirnoff
05b9737f10 ipfw: make it possible to specify MTU for "unreach needfrag" action
Reviewed by:		ae, pauamma
Differential revision:	https://reviews.freebsd.org/D36140
2022-08-17 08:24:11 -07:00
Kristof Provost
e7abb89701 ixgbe: fix software vlan handling
If hardware vlan tagging is disabled (after a vlan has been added) we
receive double-tagged packets, even if the packet on the wire only has a

single VLAN tag.  That looks like this:

	17:29:30.370787 00:51:82:11:22:02 > 90:ec:77:1f:8a:5f, ethertype 802.1Q (0x8100), length 64: vlan 0, p 0, ethertype 802.1Q, vlan 1001, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.101.0.12 is-at 00:51:82:11:22:02, length 42

This happens because the ixgbe driver does not clear the vlan flags in
the hardware (such as IXGBE_RXDCTL_VME) if IFCAP_VLAN_HWTAGGING is
cleared.

Add code to do so, which fixes this issue.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36139
2022-08-17 16:39:18 +02:00
Mateusz Guzik
9ac6eda6c6 pipe: try to skip locking the pipe if a non-blocking fd is used
Reviewed by:	markj (previous version)
Differential Revision:	https://reviews.freebsd.org/D36082
2022-08-17 14:23:34 +00:00
Mateusz Guzik
60dae3b83b mac: cheaper check for mac_pipe_check_read
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D36082
2022-08-17 14:21:25 +00:00
Mateusz Guzik
4c2ef8c1d7 pipe: change pipemapping cnt/pos to u_int
This matches the case using regular buffers and avoids an ifdef later.

Suggested by:	markj
2022-08-17 14:20:09 +00:00
Mateusz Guzik
f6ffed44a8 vm: use atomic fetchadd in vm_page_sunbusy
This also fixes a bug where not-last unbusy failed to post a release
fence.

Reviewed by:	markj (previous version), kib (previous version)
Differential Revision:	https://reviews.freebsd.org/D36084
2022-08-17 10:36:11 +00:00
Antoine Brodin
f741319724 ObsoleteFiles.inc: fix path of a few manual pages 2022-08-17 08:01:54 +00:00
Chuck Tuffli
6391be3089 bhyve nvme: Switch to POSIX standard functions
Switch bzero to memset and bcopy to memcpy

Reviewed by:	imp, jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36215
2022-08-16 17:23:27 -07:00
Li-Wen Hsu
beeeb40bca
basic_signal test: really skip trap_signal_test on i386
PR:		265889
Fixes:		c04721e35f
Sponsored by:	The FreeBSD Foundation
2022-08-17 08:15:10 +08:00
Kirk McKusick
128b0398a1 Update date in tunefs(8) manual page.
Requested by: Li-Wen Hsu
PR:           261944
Sponsored by: The FreeBSD Foundation
2022-08-16 16:46:59 -07:00
Li-Wen Hsu
c04721e35f
basic_signal test: temporarily skip trap_signal_test on i386
This case crashes a bhyve VM.

PR:		265889
Sponsored by:	The FreeBSD Foundation
2022-08-17 06:03:37 +08:00
Warner Losh
3d3f2fb069 stand: Make makeroot.sh use makefs for ZFS
Start to use makefs for ZFS. This covers the gpt nogeli variants.  ZFS
MBR booting is tricky and complicated, so will need some additional
tweaks that makefs/mkimg isn't able to do at the moment. This means that
all gpt nogeli amd64 combinations can be built w/o root.

In addition, tweak the generated qemu.sh files to use stdio for the
console. We grep the output for SUCCESS and report each of the booting
types. Create a all.sh that will run these automatically. These all can
also run w/o root.

In the future, I'll add support for a make univers followed by this
script to create other architectures' tests and/or generate stand tests
for /usr/tests...

Sponsored by: Netflix
2022-08-16 15:36:55 -06:00
Brad Davis
17f4ded551 bsdinstall: add variables to allow skipping over some phases of the install
Reviewed by:	allanjude, dteske
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D35357
2022-08-16 15:11:44 -06:00
Ed Maste
fbafa98a94 Disallow invalid PT_GNU_STACK
Stack must be at least readable and writable.

PR:		242570
Reviewed by:	kib, markj
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35867
2022-08-16 15:52:21 -04:00
Gleb Smirnoff
c93db4abf4 udp: call UDP methods from UDP over IPv6 directly
Both UDP and UDP Lite use same methods on sockets.  Both UDP over IPv4
and over IPv6 use same methods.  Don't pretend that methods can switch
and remove this unneeded complexity.

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D36154
2022-08-16 12:40:36 -07:00
Sebastian Huber
ede6c6c043 buf.h: Fix declaration of unmapped_buf
For architectures with a small-data area, the __read_mostly section must
present at the object declaration.

(emaste note: This does not appear to have an affect within FreeBSD, but
may be needed by downstream projects that handle __read_mostly /
__section(".data.read_mostly") differently.)

Pull Request:	https://github.com/freebsd/freebsd-src/pull/608
2022-08-16 15:39:03 -04:00
Gleb Smirnoff
01f11ee1c5 sdp: garbage collect sdp_ctlinput
The pr_ctlinput method was a feature of IPv4/IPv6 with exception of
pfctlinput(), which broadcasted a call to pr_ctlinput on all protocols
ever registered statically or with pf_proto_register().  Now that
this broadcast call is gone, the only protocols that get their
pr_ctlinput ever called are those that have registered itselves with
ipproto_register() or ip6proto_register().

It is entirely possible that code deleted now was dead code from very
beginning. Just a copy-paste from TCP.

Reviewed by:		rstone
Differential revision:	https://reviews.freebsd.org/D36208
2022-08-16 12:38:15 -07:00
Emmanuel Vadot
0c6b2a9179 pkgbase: Put accounting utilities in the acct package 2022-08-16 21:15:19 +02:00
Emmanuel Vadot
15d781b532 lib: Gate libfigpar under MK_DIALOG
libfigpar is only used by dpv and dpv isn't built if WITHOUT_DIALOG
is set.
2022-08-16 21:15:12 +02:00
Emmanuel Vadot
4efb514b70 pkgbase: Put mount_nfs in the FreeBSD-nfs package 2022-08-16 21:15:04 +02:00
Emmanuel Vadot
1a104a3bf3 pkgbase: mtree: Correctly tag /var/db entries 2022-08-16 21:14:56 +02:00
Emmanuel Vadot
d2888f5ccf pkgbase: mtree: Correctly tag /var/run entries 2022-08-16 21:14:49 +02:00
Jens Schweikhardt
1f5e2d569d Oops, wlan(4) is not the removed an(4). Restore that paragraph. 2022-08-16 21:08:17 +02:00
Jens Schweikhardt
1b9ad57f7f The wi(4) and an(4) drivers have been removed. Delete dead xrefs. 2022-08-16 21:05:01 +02:00
Jens Schweikhardt
e1ae2a285a Indicate the port where the referenced man pages come from. 2022-08-16 20:57:30 +02:00
Mark Johnston
d06bf11c06 bhyve: Sprinkle const qualifiers where appropriate
No functional change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-08-16 14:21:44 -04:00
Mark Johnston
37045dfa89 bhyve: Mark variables and functions as static where appropriate
Mark them const as well when it makes sense to do so.  No functional
change intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-08-16 14:21:44 -04:00
Mark Johnston
75ce327a2c bhyve: Use "void" instead of empty parameter lists
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-08-16 14:21:44 -04:00
Mark Johnston
c4d26f027b makefs: Style
Reported by:	rpokala
Fixes:		187084dddd ("makefs: Align the block buffer used in ZFS mode")
Sponsored by:	The FreeBSD Foundation
2022-08-16 14:21:44 -04:00
Ed Maste
8ddb146abc Import bionic's x86_64 optimized string routines
Add 'contrib/bionic-x86_64-string/' from commit 'd77520609f5240f5fad18fa1fd2275ac1de7cbb5'

git-subtree-dir: contrib/bionic-x86_64-string
git-subtree-mainline: 715f82e4f5
git-subtree-split: d77520609f

Requested by:	mjg
Sponsored by:	The FreeBSD Foundation
2022-08-16 13:27:11 -04:00
Ed Maste
d77520609f Import bionic's x86_64 string routines to vendor
Obtained from https://android.googlesource.com/platform/bionic
libc/arch-x86_64/string/ at commit
919fb7f2e0e0c877dd5e9bbaa71d4c4a73e50ad3

Requested by:	mjg
Sponsored by:	The FreeBSD Foundation
2022-08-16 13:24:08 -04:00
Chuck Tuffli
715f82e4f5 bhyve nvme: Support minimal Controller list
Controllers must support the Identify Controller list if they support
Namespace Management. But the UNH NVMe tests use this command regardless
of whether the device under test supports Namespace Management.

This implementation returns an empty Controller list (i.e., Number of
Identifiers is zero).

Fixes UNH Test 1.1.2

Reviewed by:	jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36193
2022-08-16 09:15:53 -07:00
Chuck Tuffli
ec0efe34dd bhyve nvme: Fix reported SANICAP value
The NVMe specification only allows Controllers compliant with the
revision 1.3 and earlier specification to report a value of 0x0 in the
No-Deallocate Modifies Media After Sanitize (NODMMAS) field.

For our revision 1.4 Controller, report that media is not modified after
Sanitize as the implementation does not implement Sanitize.

Fixes UNH Test 1.1.2

Reviewed by:	jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D36192
2022-08-16 09:14:43 -07:00
Mark Johnston
0726cde8ea makefs tests: Re-enable the ZFS snapshot test
This reverts commit 35b587464a.

PR:		265849
Sponsored by:	The FreeBSD Foundation
2022-08-16 11:02:52 -04:00
Mark Johnston
4f816f5b11 makefs: Fix space accounting for the root DSL directory
Space used by the MOS is summed after all on-disk data structures are
finalized, so the MOS DSL directory represents a special case when
counting bytes used for each directory.  The DSL layer failed to update
the MOS DSL directory's parent, the root directory, accordingly, so the
root directory reported less space used than was used in reality.  Be
careful to update the root directory after the MOS is finalized.

PR:		265849
Sponsored by:	The FreeBSD Foundation
2022-08-16 11:02:51 -04:00
Mark Johnston
187084dddd makefs: Align the block buffer used in ZFS mode
For some dnode types, particularly ZAPs, we want the buffer to have
uint64_t alignment.

Sponsored by:	The FreeBSD Foundation
2022-08-16 11:02:51 -04:00
Andrew Turner
e3917bb256 Disable promotion on pcpu memory on arm64
We need to be careful to not promote or demote the memory containing
the per-CPU structures as the exception handlers will dereference it
so any time it's invalid may cause recursive exceptions.

Add a new pmap function to set a flag in the pte marking memory that
cannot be promoted or demoted and use it to mark pcpu memory.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35434
2022-08-16 15:41:24 +01:00
Mateusz Piotrowski
f9572577cf exports.5: Clean up EXAMPLES and STANDARDS
There was a missing sentence in the description of the second mount
entry in the example. Fix that and some other bits in the EXAMPLES
section.

Also, make the STANDARDS section a bit more readable.

MFC after:	1 week
Sponsored by:	Klara Inc.
2022-08-16 15:04:44 +02:00
Søren Schmidt
1331c0f44b Add support for RockChip RK356X to DWC3 driver.
For RK356x platform, we can set bit 26 of DWC3_GUCTL1 register
for usb 2.0 device.

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D36211
2022-08-16 12:24:44 +00:00
Mateusz Guzik
84a0be4a23 vfs: plug a dead store in kern_linkat_vp
Reported by:	clang --analyze
2022-08-16 10:46:29 +00:00
Mateusz Guzik
eb9a1f9c68 vfs: plug dead store in vn_io_fault1
Reported by:	clang --analyze
2022-08-16 10:46:20 +00:00