Commit Graph

289110 Commits

Author SHA1 Message Date
Olivier Certner
33d4ce5496
login.conf(5): Document priority's special value 'inherit'
Reviewed by:            emaste, yuripv (older version)
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40691
2024-01-29 22:58:09 +01:00
Olivier Certner
d162d7e2ad
setclasspriority(): New possible value 'inherit'
It indicates to the login.conf machinery (setusercontext() /
setclasscontext()) to leave priority alone, effectively inheriting it
from the parent process.

PR:                     271749
Reviewed by:            emaste, yuripv
Approved by:            emaste (mentor)
MFC after:              3 days
Relnotes:               yes
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40690
2024-01-29 22:58:09 +01:00
Olivier Certner
7b94ec550e
setusercontext(): Move priority setting in new setclasspriority()
In preparation for setting priorities from '~/.login_conf' and to ease
reading of setusercontext().

No functional change.

Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40350
2024-01-29 22:58:08 +01:00
Olivier Certner
aa96945e71
login.conf(5): Document priority's default and possible values
Priority is reset to 0 if not explicitly specified.

While here, be more explicit about what "Initial priority (nice) level"
means and document that it is possible to set real-time or idle class'
priorities with this capability.

Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40689
2024-01-29 22:58:08 +01:00
Olivier Certner
d988621b0c
setusercontext(): Better error messages when priority is not set correctly
Polish the syslog messages to contain readily useful information.

Behavior of capability 'priority' is inconsistent with what is done for
all other contexts: 'umask', 'cpumask', resource limits, etc., where an
absence of capability means to inherit the value.  It is currently
preserved for compatibility, but is subject to change on a future major
release.

Reviewed by:            emaste, kib (older version)
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40349
2024-01-29 22:58:07 +01:00
Olivier Certner
92b2c4358f
login.conf(5): Default values: Rename column, elaborate on absence of such
Column "Notes" in fact only contains default values for capabilities, so
make this clear by renaming it to "Default".

Add a small introductory text mentioning it, and what an absence of
default value means (inheritance).

PR:                     271748
Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40347
2024-01-29 22:58:07 +01:00
Olivier Certner
771d5c93ab
setlogincontext(): Comply to style(9)
Remove indentation by inverting the big 'if (lc)' and using 'return'.
Use explicit binary operators to produce booleans.

Reviewed by:            emaste, kib, dchagin
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40346
2024-01-29 22:58:07 +01:00
Olivier Certner
ea9bd44810
login.conf(5): Document umask's special value 'inherit'
Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40688
2024-01-29 22:58:06 +01:00
Olivier Certner
c328e6c6cc
setclassumask(): Accept 'inherit' as a value
'inherit' explicitly indicates that the umask should not be changed.

Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Relnotes:               yes
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40687
2024-01-29 22:58:06 +01:00
Olivier Certner
0dd1705f58
setusercontext(): Set umask in a separate function, setclassumask()
Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40686
2024-01-29 22:58:06 +01:00
Olivier Certner
97256feb7a
login_cap(3): Document login_getcapenum()
Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40685
2024-01-29 22:58:05 +01:00
Olivier Certner
90e914cd5a
New login_getcapenum(): Allows to read named enum values
Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40684
2024-01-29 22:58:05 +01:00
Olivier Certner
0d1fe948d9
login.conf(5): umask has no default value
The umask is simply left unchanged if no explicit value is specified in
the login class capabilities database.

PR:                     271747
Reviewed by:            emaste
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40345
2024-01-29 22:58:05 +01:00
Olivier Certner
e99c28e93b
setusercontext(): umask: Set it only once (in the common case)
Simplify the code and make it more coherent (umask was the only context
setting not modified by setlogincontext() directly).

Preserve the current behavior of not changing the umask if none is
specified in the login class capabilities database, but without the
superfluous umask() dance.  (The only exception to this is that
a special value no user is likely to input in the database now stands
for no specification.)

If some user has a 'umask' override in its '~/.login_conf', the umask
will still be set twice as before (as is the case for all other context
settings overriden in '~/.login_conf').

Log a warning in case of an invalid umask specification.

This change makes it apparent that the value of LOGIN_DEFUMASK doesn't
matter.  It will be removed in a subsequent commit.

PR:                     271747
Reviewed by:            emaste, kib (earlier version)
Approved by:            emaste
MFC after:              3 days
Sponsored by:           Kumacom SAS
Differential Revision:  https://reviews.freebsd.org/D40344
2024-01-29 22:57:58 +01:00
Konstantin Belousov
a570fe4d0d open(2): describe *at behavior for dirfd opened without O_SEARCH
and move the BUGS paragraph about dirfd permissions into STANDARDS
section, noting that we provide POSIX-mandated implementation.

Reviewed by:	emaste, kevans
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D43652
2024-01-29 23:38:48 +02:00
John Baldwin
c46860dbcb bhyve: Use NVMEF macro to construct fields
Reviewed by:	corvink, chuck (older version)
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43607
2024-01-29 11:02:07 -08:00
John Baldwin
c68ec278de nvmecontrol: Use NVMEF macro to construct fields
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43606
2024-01-29 11:01:46 -08:00
John Baldwin
5650bd3fe8 nvme: Use the NVMEF macro to construct fields
Reviewed by:	chuck, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43605
2024-01-29 11:01:13 -08:00
John Baldwin
3a477a9b70 nvme: Add NVMEF helper macro as the inverse of NVMEV
This macro accepts a field name and a value for the field and
constructs the shifted field value.

Reviewed by:	chuck
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43604
2024-01-29 11:00:57 -08:00
John Baldwin
c85b3903d1 bhyve: Use the NVMEM macro instead of expanded versions
Reviewed by:	corvink, chuck
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43603
2024-01-29 11:00:09 -08:00
John Baldwin
8488fc417f nvme: Use the NVMEM macro instead of expanded versions
A few of these omitted a shift of 0, but this is more consistent.

Reviewed by:	chuck
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43602
2024-01-29 10:59:37 -08:00
John Baldwin
1dade1f255 nvme: Rename NVMEB helper macro to NVMEM
The current macro always builds a full mask for a named field, so use
the M suffix for mask.

Reviewed by:	chuck, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43601
2024-01-29 10:58:28 -08:00
John Baldwin
c426923606 bhyve: Use NVMEV to read the ASQS field of AQA
This is not a functional change, but just being consistent instead of
omitting a shift by 0.

Reviewed by:	corvink, chuck, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43600
2024-01-29 10:51:07 -08:00
John Baldwin
c9d9315b74 camdd: Use the NVMEV macro instead of expanded versions
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43599
2024-01-29 10:50:41 -08:00
John Baldwin
94962f5a72 bhyve: Use the NVMEV macro instead of expanded versions
Reviewed by:	corvink, chuck (older version)
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43598
2024-01-29 10:49:49 -08:00
John Baldwin
fba73a4083 nvmecontrol: Use the NVMEV macro instead of expanded versions
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43597
2024-01-29 10:34:02 -08:00
John Baldwin
2cb78e7150 nda: Use the NVMEV macro instead of expanded versions
Reviewed by:	chuck
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43596
2024-01-29 10:33:39 -08:00
John Baldwin
479680f235 nvme: Use the NVMEV macro instead of expanded versions
Reviewed by:	chuck
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43595
2024-01-29 10:30:54 -08:00
Emmanuel Vadot
a5afd7920d pkgbase: Create a FreeBSD-dtb package
Before that dtbs where included in each kernel packages which prevents
us to install multiple kernels.

Differential Revision:	https://reviews.freebsd.org/D43632
Reviewed by:	bapt
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2024-01-29 19:24:25 +01:00
Emmanuel Vadot
a5ff900535 pkgbase: Create two new rules for creating repo
This adds two new rules named create-packages-kernel-repo and
create-packages-world-repo.
The goal of those rules is to create the {kernel,world} packages and
after that the repository.
It helps a lot for developing with pkgbase by adding the dev machine
repository created by those rules on top of the official pkgbase one.

Differential Revision:	https://reviews.freebsd.org/D43623
Reviewed by:	bapt, emaste
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2024-01-29 19:24:03 +01:00
Michael Tuexen
f30c7d5654 TCP LRO: convert TCP header fields to host byte order earlier
This is a preparation for adding dtrace hooks in a follow-up commit,
which are missing in the code path, where packets are directly queued
to the tcpcb. The dtrace hooks expect the fields to be in host byte
order. This only applies when TCP HPTS is used.
No functional change intended.

Reviewed by:		rscheff
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D43594
2024-01-29 18:52:17 +01:00
Lexi Winter
a84e01f02b service(8): direct user to rc(8) for a list of valid commands
New users may refer to service(8) to discover how to manage services,
but this manpage does not explain which commands are permitted besides
start/stop (for example, 'enable').  Add a paragraph that directs the
reader to rc(8) to discover this.

While here, add a few examples of common use-cases.

Reported by:	Mina Galić <freebsd@igalic.co>
Pull request:	https://github.com/freebsd/freebsd-src/pull/1057
2024-01-29 18:47:09 +01:00
Dimitry Andric
ee14a9725d Merge commit 4a39d0890894 from llvm-project (by Mark Johnston):
[libc++] Fix filesystem::remove_all() on FreeBSD (#79540)

  remove_all_impl() opens the target path with O_NOFOLLOW, which fails if
  the target is a symbolic link. On FreeBSD, rather than returning ELOOP,
  openat() returns EMLINK. This is unlikely to change for compatibility
  reasons, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214633 .

  Thus, check for EMLINK as well.

Reported by:	markj
PR:		276632
MFC after:	3 days
2024-01-29 18:26:48 +01:00
Mark Johnston
8d5353de74 libc: Annotate a couple of local functions as such
No functional change intended.

MFC after:	1 week
2024-01-29 11:44:36 -05:00
Ed Maste
7e77089dcc linuxkpi: remove invalid KASSERT from hash_add_rcu
hash_add_rcu asserted that the node's prev pointer was NULL in an
attempt to detect addition of a node already on a list, but the caller
is not required to provide a zeroed node.

Reported in https://github.com/freebsd/drm-kmod/issues/282

Reviewed by:	bz, manu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43645
2024-01-29 11:40:17 -05:00
R. Christian McDonald
5086b6ec32
libbe: handle destroying/renaming temporary/bootonce boot environments
When a temporary/bootonce boot environment is renamed, we need to also
update the bootenv nvlist on-disk to reflect the new name. Additionally,
when a temporary/bootonce boot environment is destroyed, we also need to
clear out the on-disk state.

Reviewed by:	kevans
Approved by:	kp
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D43591
2024-01-29 10:07:49 -05:00
Kristof Provost
31828075e4 pf: bind route-to states to their route-to interface
When we route-to the state should be bound to the route-to interface,
not the default route interface. However, we should only do so for
outbound traffic, because inbound traffic should bind on the arriving
interface, not the one we eventually transmit on.

Explicitly check for this in BOUND_IFACE().

We must also extend pf_find_state(), because subsequent packets within
the established state will attempt to match the original interface, not
the route-to interface.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D43589
2024-01-29 14:10:26 +01:00
Kristof Provost
ffeab76b68 pfil: PFIL_PASS never frees the mbuf
pfil hooks (i.e. firewalls) may pass, modify or free the mbuf passed
to them. (E.g. when rejecting a packet, or when gathering up packets
for reassembly).

If the hook returns PFIL_PASS the mbuf must still be present. Assert
this in pfil_mem_common() and ensure that ipfilter follows this
convention. pf and ipfw already did.
Similarly, if the hook returns PFIL_DROPPED or PFIL_CONSUMED the mbuf
must have been freed (or now be owned by the firewall for further
processing, like packet scheduling or reassembly).

This allows us to remove a few extraneous NULL checks.

Suggested by:	tuexen
Reviewed by:	tuexen, zlei
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D43617
2024-01-29 14:10:19 +01:00
Richard Scheffenegger
0b3f9e435f tcp: move cc_post_recovery past snd_una update
The RFC6675 pipe calculation (sack.revised, enabled
by default since D28702), uses outdated information,
while the previous default calculated it correctly
with up-to-date information from the incoming ACK.

This difference can become as large as the receive
window (not the congestion window previously),
potentially triggering a massive burst of new packets.

MFC after:             1 week
Reviewed By:           tuexen, #transport
Sponsored by:          NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D43520
2024-01-28 00:18:51 +01:00
Colin Percival
7b707e797b Revert "release.sh: Add -jN to make release"
The release-building code is not fully parallel-safe yet.

This reverts commit 9c1bad2da5.

Reported by:	jrtc27
2024-01-28 21:43:56 -08:00
Warner Losh
3be59adbb5 vtnet: Adjust for ethernet alignment.
If the header that we add to the packet's size is 0 % 4 and we're
strictly aligning, then we need to adjust where we store the header so
the packet that follows will have it's struct ip header properly
aligned.  We do this on allocation (and when we check the length of the
mbufs in the lro_nomrg case). We can't just adjust the clustersz in the
softc, because it's also used to allocate the mbufs and it needs to be
the proper size for that. Since we otherwise use the size of the mbuf
(or sometimes the smaller size of the received packet) to compute how
much we can buffer, this ensures no overflows. The 2 byte adjustment
also does not affect how many packets we can receive in the lro_nomrg
case.

PR:			271288
Sponsored by:		Netflix
Reviewed by:		bryanv
Differential Revision:	https://reviews.freebsd.org/D43224
2024-01-28 22:08:55 -07:00
Warner Losh
2b92b754f1 kldxref: Be more conservative about what we reject.
kldxref anything whose name doesn't end in .ko or that has no dots (eg
the kernel).

Sponsored by:		Netflix
Reviewed by:		jrtc27, jhb
Differential Revision:	https://reviews.freebsd.org/D43507
2024-01-28 21:45:23 -07:00
Warner Losh
34f0a01b6b mpi3mr: Fix confusion over | and &
Use sc->mpi3mr_debug & MPI3MR_IOT over the | version to test if a bit is
set.

CID: 1529718
Sponsored by:		Netflix
2024-01-28 21:43:56 -07:00
Colin Percival
9c1bad2da5 release.sh: Add -jN to make release
The `make release` command now creates VM and cloudware images (if
enabled) in addition to disk images; this results in a very large
number of 'make installworld' commands running sequentially.  Adding
-jN should speed this up significantly.

MFC after:	1 month
X-MFC-to:	stable/14
2024-01-28 18:08:23 -08:00
Florian Walpen
fb87726303 snd_hdspe(4): Per device sysctl for period.
Let the user choose a period (interrupt cadence in samples), in the
official RME drivers this setting is available as "Buffer Size".
Override the period propagated through blocksize by pcm channel latency
settings (see sound(4)), since these are unreliable and differ between
playback and recording channels.

Differential Revision: https://reviews.freebsd.org/D43527
2024-01-28 20:20:26 +00:00
Warner Losh
8f7327dcee kboot: update copyright on these files.
host_syscalls.c: I've written, so put Netflix copyright on. It's
possible in the confusion that Nathan wrote the host_gettimeofday
implementation.

syscall_nr: These files likely can't enjoy copyright protection since
they are just facts (the per-arch Linux system calls), so add a note
they are in the public domain.

Sponsored by:		Netflix
2024-01-28 13:04:32 -07:00
Warner Losh
2b7918f13c kboot: Assert copyright here
According to git blame I've 95%+ rewritten this file. Update copyright to
reflect that, but give nod to Nathan for the original I started with.

Sponsored by:		Netflix
2024-01-28 13:04:32 -07:00
Warner Losh
36ef238cb6 kboot: Move termios to libkboot
Sponsored by:		Netflix
2024-01-28 13:04:31 -07:00
Warner Losh
2e3f49888e kboot: Move system calls to libkboot
Sponsored by:		Netflix
2024-01-28 13:04:31 -07:00
Warner Losh
099335814d kboot: Move syscall stubs to libkboot
Sponsored by:		Netflix
2024-01-28 13:04:31 -07:00