Commit graph

288641 commits

Author SHA1 Message Date
Ed Maste 20010b86fe netlink: Add sysctl descriptions for net.netlink tree
Reviewed by:	markj, melifaro
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43368
2024-01-08 14:31:31 -05:00
Richard Scheffenegger 429f14f83a tcp: clean PRR state after ECN congestion recovery.
PRR state was not properly reset on subsequent ECN CE
events. Clean up after local transmission failures too.

Reviewed by:           tuexen, cc, #transport
MFC after:             3 days
Sponsored by:          NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D43170
2024-01-08 10:53:04 +01:00
Richard Scheffenegger f4574e2dc5 tcp: prevent spurious empty segments and fix uncommon panic
Only try sending more data on pure ACKs when there is
more data available in the send buffer.

In the case of a retransmitted SYN not being sent due to
an internal error, the snd_una/snd_nxt accounting could
be off, leading to a panic. Pulling snd_nxt up to snd_una
prevents this from happening.

Reported by:           fengdreamer@126.com
Reviewed by:           cc, tuexen, #transport
MFC after:             1 week
Sponsored by:          NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D43343
2024-01-08 10:52:49 +01:00
Kyle Evans a4a838a31a bhyveload: make error printing consistent
Previously we used a mix of perror(3) + exit(3) and err(3); standardize
on the latter instead.  This does remove one free() in an error path,
because we're decidedly leaking a lot more than just the loader name
there (loader handle, vcpu, vmctx...) anyways.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43331
2024-01-08 11:49:40 -06:00
Tom Hukins ba719a0fec Fix "version introduced" in numerous manual pages
MFC after:	1 week
Pull request:	https://github.com/freebsd/freebsd-src/pull/853
2024-01-08 11:35:16 -05:00
Wolfram Schneider 1e82d882ed fix using man(1) with multiple pages
PR: 275978
Reported by: Mohamed Akram
Fixes: 789480702e
MFC after: 1 week
2024-01-08 16:05:50 +00:00
Bjoern A. Zeeb c8e7f78a3d ath10k/rtw89: make compile again after LinuxKPI changes
Both drivers are not yet attached to the build so this change is
for people currently trying them out.

In 96ab16ebab the sys/rman.h include
was removed.  In various wireless drivers we prefer to directly use
bus_dma functions rather than io* LinuxKPI once.  In order to cast
the pointer we need sys/rman.h back for our native 'struct resource'
in their pci.c implementations.
Long-term we should consider providing some lkpi_-FreeBSD-specific
wrapper functions to avoid this problem.

MFC after:	3 days
2024-01-08 15:38:22 +00:00
Bjoern A. Zeeb 118d0ff54d rtw89: improve debugging and fix a sleep issue
Improve log messages to be more helpful in error cases.
Change one LinuxKPI sleep function as we cannot call the original
one from a context we cannot sleep.
Both cases were hit during testing.

MFC after:	3 days
2024-01-08 15:38:22 +00:00
Jan Beich 58cf91d3b7 resolv: Add a required include to resolv.h
Add a required include to resolv.h for sockaddr_in.  This should reduce
patching required when porting code written with Linux or NetBSD in mind.

PR:		182466
MFC after:	1 week
2024-01-08 20:52:08 +09:00
Jiahao LI 9a62278724 mii: Fix memory leak in micphy.
PR:		270040
MFC after:	1 week
2024-01-08 16:39:56 +09:00
Teerayut Hiruntaraporn 5704277ae5 puc: Add support for Exar XR17V354 Quad PCI Express UART.
PR:		257207
MFC after:	1 week
2024-01-08 15:31:19 +09:00
Konstantin Belousov 8a4577423e ffs/ffs_rawread.c: clean up includes
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-01-08 07:41:15 +02:00
Warner Losh 4748db6ffd checkstyle9.pl: Don't use $root if not defined
$root is only defined when given on the command line. Don't try to use
its value when it's not defined.

Sponsored by:		Netflix
2024-01-07 09:51:49 -07:00
Warner Losh 1e81724578 checkstyle9: Remove irrelevant stuff from qemu
Remove some qemu project specific things we don't care about

o Remove python interpreter check
o Remove linux header check
o Remove trace file specail treatment
o Add $FreeBSD$ tag additions
o Remove some experiemntal code we won't need
o Remove commented out initializer code that we don't explicitly have a
  rule for.

Sponsored by:		Netflix
2024-01-07 09:51:49 -07:00
Mark Johnston 7d35b38972 dtrace/profile: Set t_dtrace_trapframe for profile probes
profile provider probes fire in the context of a timer interrupt.  Thus,
the "regs" action can make use of the interrupt trap frame to get
register values when the interrupt happened in kernel mode.  Make that
trap frame available when possible so that "regs" works more or less as
it already does with the fbt and kinst providers.

MFC after:	1 week
2024-01-07 11:46:13 -05:00
Warner Losh e5b33e6eef style.yml: Don't run this on branch pushes
We don't need to run this on branch pushes, just pull requests. It's
designed to be a gross filter for incoming commits, not something
perfect we need to keep green. It also doesn't work quite right for
branch pushes anyway and needs adjustment.

Also remove some debugging information. We don't need it anymore.

Noticed by:	jrtc27
Sponsored by:	Netflix
2024-01-06 20:46:42 -07:00
Warner Losh dbee52c9d6 Connect my checkstyle9.pl script to a action.
Connect the checkstyle9.pl script to a github action. This will provide
feedback to people submitting changes when the style is grossly wrong. And
can provide other automated feedback for the commit message in the future.
It already catches the github noreply author.

It pulls the full repo to do this. Optimizations welcome. After messing
with that for a few hours, I decided to punt and commit the slow, working
version and let someone else optimize from here.

Sponsored by:		Netflix
2024-01-06 16:23:14 -07:00
Michael Tuexen e179d9739b tcpsso: support TIME_WAIT state
TCP endpoints in TIME_WAIT are not handled in a special way anymore.
Therefore, they can be handled now by tcpsso.

Reviewed by:		rscheff
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D43351
2024-01-06 21:31:46 +01:00
Richard Scheffenegger 30409ecdb6 tcp: do not purge SACK scoreboard on first RTO
Keeping the SACK scoreboard intact after the first RTO
and retransmitting all data anew only on subsequent RTOs
allows a more timely and efficient loss recovery under
many adverse cirumstances.

Reviewed By:           tuexen, #transport
MFC after:             10 weeks
Sponsored by:          NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D42906
2024-01-06 20:25:38 +01:00
Richard Scheffenegger 893ed42eca tcp: Make use of enum for sack_changed
No functional change.

Reviewed By:           tuexen, #transport
MFC after:             3 days
Sponsored by:          NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D43346
2024-01-06 20:23:52 +01:00
Lexi Winter fbbdfa2b8a nfsv4(4): mention the nfsv4_server_only setting
Add note about configuring the NFSv4-only option.

It is already mentioned in rc.conf(5), but documenting it here makes it
more likely that people see it when they need it.

MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1008
2024-01-06 19:21:25 +01:00
Michael Tuexen f402e08737 tcpsso: fix typos in man page
Reviewed by:		manpages (bcr)
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D43342
2024-01-06 19:17:04 +01:00
Michael Tuexen aa1223ac3a tcp: limit visibility of symbols
Put most symbols under __BSD_VISIBLE and limit the namespace of
tcp_[gs]et_flags.

Reviewed by:		kib, karels, rscheff
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D43245
2024-01-06 12:00:38 +01:00
David E. O'Brien 6f55a4e24c timingsafe_bcmp(3) was MFC'ed to 11.1 2024-01-05 20:54:13 -08:00
Mike Karels 4347ef6050 arm64/RPI: enable powerd by default on arm64-aarch64-RPI images
Most 64-bit Raspberry Pi models have a variable processor clock
speed that defaults to a slow speed (e.g. 600 MHz for a nominal
1.5 GHz clock).  This results in everything running slowly unless
or until powerd is started, and FreeBSD is then thought to be slow.
Enable powerd by default in /etc/rc.conf on the arm64-aarch64-RPI
images.  Tested on Raspberry Pi 3B+ and 4B so far.

PR:		256836
MFC after:	1 month
Reviewed by:	rgrimes
Differential Revision:	https://reviews.freebsd.org/D43296
2024-01-05 13:41:24 -06:00
Kyle Evans a68d5a6625 Revert "kern: console: make /dev/console backing console more predictable"
This accidentally snuck into a different branch, and has not been
reviewed for sanity yet..

This reverts commit 8ec6d7be2e.
2024-01-05 10:13:06 -06:00
Kyle Evans f9b17005bf bhyveload: fix comment style
Reported by:	jrtc27
Fixes: c067be72e8 ("bhyveload: limit rights on the dirfds we create")
2024-01-05 09:54:46 -06:00
Kyle Evans 8ec6d7be2e kern: console: make /dev/console backing console more predictable
Specifically, altering the console list with conscontrol has some weird
behavior:

1. If you remove the first configured console, /dev/console will become
  unconfigured
2. Any console added becomes the /dev/console

In a multicons situation, #1 is clearly a bug and #2 is perhaps slightly
less clear.  If we have ttyu0, ttyv0, then it seems obvious that one
would want ttyv0 to take over the console if ttyu0 is removed.  If we
add ttyu0 back in, then it's debatable whether it should take over the
console or not.

Fix it now to make the /dev/console selection more FIFO-ish, with
respect to how conscontrol affects it.  A `primary` verb for
conscontrol(8) might be a good addition.
2024-01-05 09:52:29 -06:00
Baptiste Daroussin 9fd978680d jail: add security.jail.mlock_allowed
when the parameter allow.mlock was added a way for jails to check
if the parameter was set or now has not been added, this change
covers it.

MFC After:	3 days
Reviewed by:	jamie@
Differential Revision:	https://reviews.freebsd.org/D43314
2024-01-05 13:53:57 +01:00
Kyle Evans 24cd5c26fe bhyveload: support guest rebooting from the loader
userboot has a EXIT_REBOOT code that it uses when the 'reboot' loader
command is executed.  Use that and longjmp back to reinit the VM
entirely with a reboot request.  This fixes the 'reboot' option in the
loader menu to actually reboot rather than shutdown the VM.

The JMP_* constants are introduced to keep track of why we're doing a
longjmp, though they aren't currently used.  We'll notably still do a
complete reload of the interpreter to give the rebooted VM that new
loader smell.  It just seemed forward thinking to just keep track of the
different setjmp points.

While we're here, we don't actually need to keep the fd we passed to
fdlopen(3), so let's avoid leaking it.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43300
2024-01-05 00:21:15 -06:00
Kyle Evans c067be72e8 bhyveload: limit rights on the dirfds we create
In neither case do we need write access to the directories we're working
with; userboot doesn't support fo_write on the host device, and the
bootfd is only ever needed for loader loading.

This improves on 8bf0882e18 ("bhyveload: enter capability mode [...]")
so that arbitrary code in the loader can't open writable fds to either
of the directories we need to maintain access to.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43315
2024-01-05 00:21:14 -06:00
Konstantin Belousov 70dc6b2ce3 nfsclient: limit situations when we do unlocked read-ahead by nfsiod
If there were or are writeable mappings, read-ahead might overwrite the
dirty pages data that is not yet reflected as a delayed write in the
matching buffer state.

Noted by:	rmacklem
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-01-05 06:58:58 +02:00
Konstantin Belousov 2d33ad48bd vtruncbuf: improve the check for meta buffer
Revision e99215a614 reorganized the code in vtruncbuf(), and moved
the logic to flush meta buffers into a dedicated loop. While doing it,
the condition was changed from bp->b_lblkno < 0 (to handle) into
bp->b_lblkno > 0 (to skip), which causes buffer at lblkno to needlessly
flush.

Reviewed by:	chs, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43261
2024-01-05 06:58:50 +02:00
Konstantin Belousov 4c41d10f15 vtruncbuf: add a comment explaining the purpose of the loop
Reviewed by:	chs, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43261
2024-01-05 06:58:42 +02:00
Konstantin Belousov 656d2e83d9 nfsclient: eliminate ncl_writebp()
Use plain bufwrite() instead.  ncl_writebp() evolved to mostly repeat
bufwrite() code with some ommisions, most notably runningbufspace
accounting.

Reviewed by:	imp, markj, rmacklem
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43249
2024-01-05 06:58:18 +02:00
Konstantin Belousov 47ec00d9d6 nfsclient: flush dirty pages of the vnode
before ncl_flush() when done to ensure that the server sees our cached
data, because it potentially changes the server response.  This is
relevant for copy_file_range(), seek(), and allocate().

Convert LK_SHARED invp lock into LK_EXCLUSIVE if needed to properly call
vm_object_page_clean().

Reported by:	asomers
PR:	276002
Noted and reviewed by:	rmacklem
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43250
2024-01-05 06:56:30 +02:00
Konstantin Belousov 7dae1467d7 nfsclient copy_file_range(): flush dst vnode data
Otherwise server-side copy makes the client cache inconsistent with the
server data.

Reported by:	asomers
PR:	276002
Reviewed by:	rmacklem
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43250
2024-01-05 06:56:17 +02:00
Konstantin Belousov 987446fa39 mlx5(4): only detach IOV children if iov was successfully initialized
Reported by:	jwd
Sponsored by:	NVidia networking
MFC after:	1 week
2024-01-05 06:52:39 +02:00
Ed Maste 069ac18495 ssh: Update to OpenSSH 9.6p1
From the release notes,

> This release contains a number of security fixes, some small features
> and bugfixes.

The most significant change in 9.6p1 is a set of fixes for a newly-
discovered weakness in the SSH transport protocol.  The fix was already
merged into FreeBSD and released as FreeBSD-SA-23:19.openssh.

Full release notes at https://www.openssh.com/txt/release-9.6

Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2024-01-04 22:16:30 -05:00
Lexi Winter 6c951b3717 mail: add volatile in grabh()
setjmp() requires that any stack variables modified between the setjmp
call and the longjmp() must be volatile.  This means that 'saveint' in
grabh() must be volatile, since it's modified after the setjmp().
Otherwise, the signal handler is not properly restored, resulting in a
crash (SIGBUS) if ^C is typed twice while composing.

PR:		276119
Reported by:	Christopher Davidson <christopher.davidson@gmail.com>
MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/993
2024-01-04 21:40:53 -05:00
Kristof Provost 324fd7ec40 libpfctl: introduce a handle-enabled variant of pfctl_add_rule()
Introduce pfctl_add_rule_h(), which takes a pfctl_handle rather than a
file descriptor (which it didn't use). This means that library users can
open the handle while they're running as root, but later drop privileges
and still add rules to pf.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-01-04 23:10:44 +01:00
Kristof Provost 66cacc141d libpfctl: introduce pfctl_handle
Consumers of libpfctl can (and in future, should) open a handle. This
handle is an opaque object which contains the /dev/pf file descriptor
and a netlink handle. This means that libpfctl users can open the handle
as root, then drop privileges and still access pf.

Already add the handle to pfctl_startstop() and pfctl_get_creatorids()
as these are new in main, and not present on stable branches. Other
calls will have handle-enabled alternatives implemented in subsequent
commits.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-01-04 23:10:24 +01:00
Kristof Provost 32df0124f4 pf tests: ensure that pflog shows malformed packets as blocked, not passed
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-01-04 23:08:08 +01:00
Kristof Provost 948e8413ab pflog: pass the action to pflog directly
If a packet is malformed, it is dropped by pf(4).  The rule referenced
in pflog(4) is the default rule.  As the default rule is a pass
rule, tcpdump printed "pass" although the packet was actually
dropped. Use the actual action, rather than the rule's action, or an
attempt at guessing the correct action.

Inspired by OpenBSD's 'pflog(4) logs packet dropped by default rule with block.' commit.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-01-04 23:08:08 +01:00
Kristof Provost 5f840a1758 pf: don't clobber log flag
If we decide to discard a packet due to unexpected IP options or
unsupported headers we set pd.act.log. However, this can later get
overwritten when we copy the state's saved actions over.

Merge the two log fields to ensure we log as expected.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-01-04 23:08:08 +01:00
Navdeep Parhar b1e82d3319 cxgbe(4): Update firmwares to 1.27.5.0
Version : 1.27.5.0
Date    : 10/10/2023
=====================
Fixes
-----

BASE:
- Fixed handling the Remote Fault with AN, causing the link failure.
=====================

Obtained from:	Chelsio Communications
MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2024-01-04 12:37:27 -08:00
Jens Schweikhardt 53d908d6eb Correct three typos in manuals. 2024-01-04 21:35:25 +01:00
Mark Johnston 1809089a96 rc.d: Process autobridge_* in vnet jails
Reviewed by:	kp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D43316
2024-01-04 13:57:05 -05:00
Cy Schubert fc55c20355 heimdal: Fix man page and documentation typos
Reported by:	Jens Schweikhardt <schweikh@schweikhardt.net>
MFC:		1 week
2024-01-04 10:35:59 -08:00
Jens Schweikhardt 359fc7eb32 Typos corrected; dependant, addres. 2024-01-04 19:17:24 +01:00