Commit Graph

286860 Commits

Author SHA1 Message Date
Benedict Reuschling
a3b3e89ff1 bhyve(8): Fix style warnings emitted by mandoc, no content changes 2023-10-09 16:43:35 +00:00
Felix Johnson
8120190f80 bhyve(8): Expand the -p option text with additional text and an example
PR:	249981
2023-10-09 16:32:33 +00:00
Felix Johnson
3523f0677e fdc.4: document fdc sysctls
PR:		105608
MFC-after:	1 week
2023-10-09 18:48:52 +07:00
Emmanuel Vadot
fee14577d5 mtree: Fix entry
Fixes:	af5e348c61 ("mtree: Add missing sound entry for /usr/examples")
2023-10-09 12:56:19 +02:00
Richard Scheffenegger
e2c6a6d29b tcp: include RFC6675 IsLost() in pipe calculation
Add more accounting while processing SACK data, to
keep track of when a packet is deemed lost using
the RFC6675 guidance.

Together with PRR (RFC6972) this allows a sender to
retransmit presumed lost packets faster, and loss
recovery to complete earlier.

Reviewed By: cc, rrs, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D39299
2023-10-09 12:37:20 +02:00
Zhenlei Huang
35b3be81f1 proc: Add sysctl flag CTLFLAG_TUN to loader tunable
The sysctl variable 'kern.kstack_pages' is actually a loader tunable.
Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it
correctly.

No functional change intended.

Note that on arm64 the thread0 stack size can not be controlled with it,
kib@ suggested that arm64 maintainers can fix it eventually so let's
enable it also on arm64 right now.

Reviewed by:	kib, imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42113
2023-10-09 18:30:22 +08:00
Zhenlei Huang
31b9406530 buf: Add sysctl flag CTLFLAG_TUN to loader tunable
The sysctl variable 'vfs.unmapped_buf_allowed' is actually a loader
tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will
report it correctly.

No functional change intended.

Reviewed by:	kib, imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42113
2023-10-09 18:30:22 +08:00
Zhenlei Huang
978be1ee5d sockets: Add sysctl flag CTLFLAG_TUN to loader tunable
The sysctl variable 'kern.ipc.maxsockets' is actually a loader tunable.
Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it
correctly.

No functional change intended.

Reviewed by:	kib, imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42113
2023-10-09 18:30:22 +08:00
Zhenlei Huang
6a88498e53 mbuf: Add sysctl flag CTLFLAG_TUN to loader tunables
The following sysctl variables are actually loader tunables. Add sysctl
flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.

 1. kern.ipc.mb_use_ext_pgs
 2. kern.ipc.nmbclusters
 3. kern.ipc.nmbjumbop
 4. kern.ipc.nmbjumbo9
 5. kern.ipc.nmbjumbo16
 6. kern.ipc.nmbufs

No functional change intended.

Reviewed by:	kib, imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42113
2023-10-09 18:30:22 +08:00
Zhenlei Huang
2af5ce5b5e fd: Add sysctl flag CTLFLAG_TUN to loader tunables
The following sysctl variables are actually loader tunables. Add sysctl
flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.

 1. kern.maxfiles
 2. kern.maxfilesperproc

No functional change intended.

Reviewed by:	kib, imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42113
2023-10-09 18:30:21 +08:00
Zhenlei Huang
149b9c234b x86: Add sysctl flag CTLFLAG_TUN to loader tunables
The following sysctl variables are actually loader tunables. Add sysctl
flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.

 1. machdep.idle
 2. machdep.idle_apl31

No functional change intended.

Reviewed by:	kib, imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42113
2023-10-09 18:30:21 +08:00
Zhenlei Huang
95c01e9b32 nfscl: Add sysctl flag CTLFLAG_TUN to loader tunable
The sysctl variable 'vfs.nfs.iodmin' is actually a loader tunable. Add
sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it
correctly.

No functional change intended.

Reviewed by:	kib, imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42113
2023-10-09 18:30:21 +08:00
Zhenlei Huang
0eb2e19789 ddb: Add sysctl flag CTLFLAG_TUN to loader tunable
The sysctl variable 'debug.ddb.capture.bufsize' is actually a loader
tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will
report it correctly.

No functional change intended.

Reviewed by:	kib, imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42113
2023-10-09 18:30:21 +08:00
Zhenlei Huang
e2ad7ce37b cam/scsi: Add sysctl flag CTLFLAG_TUN to loader tunable
The sysctl variable 'kern.cam.scsi_delay' is actually a loader tunable.
Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will report it
correctly.

No functional change intended.

Reviewed by:	kib, imp (for #cam)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D42113
2023-10-09 18:30:21 +08:00
Emmanuel Vadot
af5e348c61 mtree: Add missing sound entry for /usr/examples
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-10-09 11:22:27 +02:00
Jose Luis Duran
3347078000 (upstream) PR/386: Add newlines for consitency 2
Obtained from:	https://github.com/file/file/pull/134/
2023-10-08 21:52:53 -07:00
Jose Luis Duran
0d3a87569f file_test: Fix file test
Trimming of the line feed is no longer necessary after
d993c6b0db

Currently the tests:

  - bcachefs2
  - gpkg-1-zst
  - multiple

are failing, but a fix will be committed upstream.

This also reverts c5e957ad4 "file: fix test case for gpkg by removing the extra \n."

MFC after:	3 days
2023-10-08 21:44:14 -07:00
Zhenlei Huang
dac91eb766 sctp: Various fixes for loader tunables
The following sysctl variables are actually loader tunables. Add sysctl
flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.

 1. net.inet.sctp.tcbhashsize
 2. net.inet.sctp.pcbhashsize
 3. net.inet.sctp.chunkscale

The loader tunable 'net.inet.sctp.tcbhashsize' and 'net.inet.sctp.chunkscale'
are only used during vnet initializing, thus it make no senses to make them
writable tunable.

Validate the values of loader tunables on vnet initialize, reset them to
theirs defaults if invalid to prevent potential kernel panics.

Reviewed by:	tuexen, #transport, #network
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42007
2023-10-09 12:36:48 +08:00
Bojan Novković
808f5ac3c6 arm64: Add a leaf PTP when pmap_enter(psind=1) creates a wired mapping
Let pmap_enter_l2() create wired mappings.  In particular, allocate a
leaf PTP for use during demotion.  This is a step towards reverting
commit 64087fd7f3.

Reviewed by:	alc, markj
Sponsored by:	Google, Inc. (GSoC 2023)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D41634
2023-10-08 20:40:44 -04:00
Bojan Novković
6c1d6d4c7f i386: Add a leaf PTP when pmap_enter(psind=1) creates a wired mapping
Let pmap_enter_pde() create wired mappings.  In particular, allocate a
leaf PTP for use during demotion.  This is a step towards reverting
commit 64087fd7f3.

Reviewed by:	alc, kib, markj
Sponsored by:	Google, Inc. (GSoC 2023)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D41635
2023-10-08 20:40:44 -04:00
Benedict Reuschling
3ddd961db1 mount_nfs(8): Indicate that the -t option is deprecated
In mount_nfs.c the -t option is deprecated and advises to use
timeout=<N> instead. However, since that refers to NFS over UDP, which
is not used nowadays, mark this option as deprecated in the man page.

PR:		260611
Suggested by:	rmacklem
2023-10-08 13:57:47 +00:00
Mateusz Guzik
4b9aa38ef0 teken: fix up unused func warnings
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-10-08 13:54:11 +00:00
Zhenlei Huang
38ecc80b2a tcp: Simplify the initialization of loader tunable 'net.inet.tcp.tcbhashsize'
No functional change intended.

Reviewed by:	cc, rscheff, #transport
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D41998
2023-10-08 18:03:59 +08:00
Martin Matuska
9aa71bad21 zfs: update zfs_config.h and zfs_gitrev.h missing in b2526e8bfe 2023-10-08 09:55:29 +02:00
Martin Matuska
b2526e8bfe zfs: merge openzfs/zfs@66b81b349
Notable upstream pull request merges:
 #15290 54b1b1d89 import: require force when cachefile hostid doesn't
                  match on-disk
 #15319 342357cd9 Reduce number of metaslab preload taskq threads
 #15340 2a6c62109 ARC: Remove b_cv from struct l1arc_buf_hdr
 #15347 75a2eb7fa ARC: Drop different size headers for crypto
 #15350 96b9cf42e ARC: Remove b_bufcnt/b_ebufcnt from ARC headers
 #15353 66b81b349 ZIL: Reduce maximum size of WR_COPIED to 7.5K
 #15362 5b8688e62 zfsconcepts: add description of block cloning

Obtained from:	OpenZFS
OpenZFS commit:	66b81b3497
2023-10-08 09:43:15 +02:00
Dag-Erling Smørgrav
2821a7498f libfetch, fetch: Stop recommending the use of ca_root_nss.
MFC after:	3 days
Reviewed by:	kevans, emaste
Differential Revision:	https://reviews.freebsd.org/D42119
2023-10-08 06:35:15 +02:00
Danilo G. Baio
04c8bfc176 jexec.8: Add examples section
MFC after:	3 days
Reviewed by:	gbe, 0mp, danfe, pauamma_gundo.com
Differential Revision: https://reviews.freebsd.org/D40831
2023-10-07 19:44:44 -03:00
Christos Margiolis
6d3296f16a teken: use __bitcount() instead of bitcount()
The use of bitcount() triggered a build error because it couldn't be
located. __bitcount() on the other hand is defined in sys/types.h, which
is included in teken/teken.h.

MFC after:	2 weeks
2023-10-08 00:36:59 +03:00
Bojan Novković
9e589b0938 tty: fix improper backspace behaviour for UTF8 characters when in canonical mode
This patch adds additional logic in ttydisc_rubchar() to properly handle
backspace behaviour for UTF-8 characters.

Currently, typing in a backspace after a UTF8 character will delete only
one byte from the byte sequence, leaving garbled output in the tty's
output queue. With this change all of the character's bytes are deleted.
This change is only active when the IUTF8 flag is set (see
19054eb6053189144aa962b2ecc1bf5087758a3e "(s)tty: add support for IUTF8
input flag")

The code uses the teken_wcwidth() function to properly handle character
column widths for different code points, and adds the
teken_utf8_bytes_to_codepoint() function that converts a UTF-8 byte
sequence to a codepoint, as specified in RFC3629.

Reported by:    christos
Reviewed by:    christos, imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D42067
2023-10-07 21:00:11 +03:00
Bojan Novković
128f63cedc (s)tty: add support for IUTF8 input flag
This patch adds the necessary kernel and stty code to support setting
the IUTF8 flag for ttys. It is the first of two patches that fix
backspace behaviour for UTF-8 encoded characters when in canonical mode.

Reported by:	christos
Reviewed by:	christos, imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D42066
2023-10-07 20:59:57 +03:00
Alan Somers
662ec2f781 fusefs: sanitize FUSE_READLINK results for embedded NULs
If VOP_READLINK returns a path that contains a NUL, it will trigger an
assertion in vfs_lookup.  Sanitize such paths in fusefs, rejecting any
and warning the user about the misbehaving server.

PR:		274268
MFC after:	1 week
Sponsored by:	Axcient
Reviewed by:	mjg, markj
Differential Revision: https://reviews.freebsd.org/D42081
2023-10-07 08:22:03 -06:00
Michael Tuexen
abca3ae773 udp: fix sending of IPv4-mapped addresses
The inp_vflags field must be adjusted during the call of
in_pcbbind_setup(). This is consistent with the other places in the
code, but not elegant at all.

PR:			274009
Reported by:		syzbot+81ccc423a2737ed031ac@syzkaller.appspotmail.com
Reported by:		syzbot+c8e3dac881bba85bc029@syzkaller.appspotmail.com
Reviewed by:		markj, rrs, rscheff
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D42031
2023-10-07 15:56:00 +02:00
Ed Maste
f7a2eeaa75 src.conf(5): regen after 166a655fcf (bsdinstall/libdialog)
Sponsored by:	The FreeBSD Foundation
2023-10-06 21:16:18 -04:00
Mark Johnston
4640df1b0a mrsas: Fix callout locking in mrsas_complete_cmd()
callout_stop() requires the associated lock to be held.

This is a bit hacky, but I believe it's safe since the subsequent
mrsas_cmd_done() call will also acquire the SIM lock to stop a different
callout.

PR:		265484
Reviewed by:	imp
Tested by:	Jérémie Jourdin <jeremie.jourdin@advens.fr>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39559
2023-10-06 20:31:03 -04:00
Alan Somers
8399d764c9 Fix intermittency in the sys.fs.fusefs.symlink.main test
This change is identical to 86885b1868 but for symlink instead of
mknod.  The kernel sends a FUSE_FORGET asynchronously with the final
syscall.  The lack of an expectation caused this test to occasionally
fail.

Also, remove a sleep that accidentally snuck into a different test.

MFC after:	2 weeks
MFC with:	86885b1868
Sponsored by:	Axcient
2023-10-06 15:08:03 -06:00
Ed Maste
a2b289608d mitigations.7: briefly explain RELRO
Reviewed by:	bcr (earlier), kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42107
2023-10-06 16:44:07 -04:00
Alan Somers
86885b1868 Fix intermittency in the sys.fs.fusefs.mknod.main test
In the Mknod.parent_inode test case, the kernel sends an extra
FUSE_FORGET message.  But because it gets sent asynchronously with the
failing syscall, it doesn't always get received before the test ends.
So we never setup an expectation for it.  And 90+% of the time the test
would exit successfully.

Fix the intermittency by always waiting to receive the FUSE_FORGET
message.

MFC after:	2 weeks
Sponsored by:	Axcient
2023-10-06 13:57:38 -06:00
Emmanuel Vadot
03205a8cd5 i2c: rtc: Add module for hym8563 driver
It's used in the nanopi-r5s
2023-10-06 21:29:38 +02:00
Alexander Motin
66b81b3497
ZIL: Reduce maximum size of WR_COPIED to 7.5K
Benchmarks show that at certain write sizes range lock/unlock take
not so much time as extra memory copy.  The exact threshold is not
obvious due to other overheads, but it is definitely lower than
~63KB used before.  Make it configurable, defaulting at 7.5KB,
that is 8KB of nearest malloc() size minus itx and lr structs.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #15353
2023-10-06 10:09:27 -07:00
Emmanuel Vadot
38cbdae33b dwc: Rewrite barrier part
We only need a barrier after writing the OWN bit so everything is
coherent for the DMA engine.
2023-10-06 19:05:45 +02:00
Emmanuel Vadot
cf037a17c7 dwc: rockchip: Properly calculate mii clock based on pclk_mac 2023-10-06 19:05:43 +02:00
Emmanuel Vadot
7854d0f658 dwc: Get the mii clock after calling IF_DWC_INIT
We need to calculate it based on the clocks and they aren't started
before IF_DWC_INIT.
2023-10-06 19:05:40 +02:00
Emmanuel Vadot
7786911ffd dwc: Rewrite part of the descriptors setup functions
- Add a txdesc_clear which clears the tx desc instead of doing that in
   dwc_setup_txdesc based on arguments.
 - Remove dwc_set_owner, in the end we always set the owner of the desc
   as we do it for id > 0 and then for the first one.
 - Remove dwc_ prefix

No functional changes intended.
2023-10-06 19:05:37 +02:00
siv0
74ed1ae08a
rpm: Fix make rpm on Debian/Ubuntu
The recent patch to change the bash completion install location based
on the Distribution, ignored that it should still be possible to
create RPMs on Debian derived systems. Additionally `make deb` itself
creates RPMs and converts them via `alien`.

This patch adds the bashcompletiondir variable to the rpm defines and
uses this for the location, where to get the bash completion file.

It still changes the location on Debian/Ubuntu systems in the final
packages from /etc/bash_completion.d to
/usr/share/bash-completion/completions

Fixes: e69ade32e1

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes #15355
Closes #15365
2023-10-06 09:53:23 -07:00
Dag-Erling Smørgrav
cec8e6ba64 daemon: Disable stdio buffering.
The daemon utility already does its own buffering and retransmits its
child's output line by line.  There's no need for stdio to add its own
buffering on top of this.

MFC after:	1 week
Sponsored by:	Modirum MDPay
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D42111
2023-10-06 18:44:52 +02:00
Dag-Erling Smørgrav
c5e5722220 tests: Use ifconfig -j instead of jexec ifconfig.
Reviewed by:	kp, asomers
Differential Revision:	https://reviews.freebsd.org/D42110
2023-10-06 18:40:07 +02:00
Dag-Erling Smørgrav
aad8fb3e2b tests: Add a test case for arp host lookups.
Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D42108
2023-10-06 18:39:59 +02:00
Rob Norris
54b1b1d893 import: require force when cachefile hostid doesn't match on-disk
Previously, if a cachefile is passed to zpool import, the cached config
is mostly offered as-is to ZFS_IOC_POOL_TRYIMPORT->spa_tryimport(), and
the results are taken as the canonical pool config and handed back to
ZFS_IOC_POOL_IMPORT.

In the course of its operation, spa_load() will inspect the pool and
build a new config from what it finds on disk. However, it then
regenerates a new config ready to import, and so rightly sets the hostid
and hostname for the local host in the config it returns.

Because of this, the "require force" checks always decide the pool is
exported and last touched by the local host, even if this is not true,
which is possible in a HA environment when MMP is not enabled. The pool
may be imported on another head, but the import checks still pass here,
so the pool ends up imported on both.

(This doesn't happen when a cachefile isn't used, because the pool
config is discovered in userspace in zpool_find_import(), and that does
find the on-disk hostid and hostname correctly).

Since the systemd zfs-import-cache.service unit uses cachefile imports,
this can lead to a system returning after a crash with a "valid"
cachefile on disk and automatically, quietly, importing a pool that has
already been taken up by a secondary head.

This commit causes the on-disk hostid and hostname to be included in the
ZPOOL_CONFIG_LOAD_INFO item in the returned config, and then changes the
"force" checks for zpool import to use them if present.

This method should give no change in behaviour for old userspace on new
kernels (they won't know to look for the new config items) and for new
userspace on old kernels (the won't find the new config items).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Closes #15290
2023-10-06 09:24:44 -07:00
Rob Norris
8f5aa8cb00 tests: add tests for zpool import behaviour when hostid changes
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Closes #15290
2023-10-06 09:23:39 -07:00
Kristof Provost
7ce98cf2f8 pfctl: fix incorrect mask on dynamic address
A PF rule using an IPv4 address followed by an IPv6 address and then a
dynamic address, e.g. "pass from {192.0.2.1 2001:db8::1} to (pppoe0)",
will have an incorrect /32 mask applied to the dynamic address.

MFC after:	3 weeks
Obtained from:	OpenBSD
See also:	https://ftp.openbsd.org/pub/OpenBSD/patches/5.6/common/007_pfctl.patch.sig
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Event:		Oslo Hackathon at Modirum
2023-10-06 18:11:28 +02:00