Merge branch 'freebsd/current/main' into hardened/current/master

This commit is contained in:
HardenedBSD Sync Services 2024-10-07 18:01:31 -06:00
commit f3617ed722
No known key found for this signature in database
27 changed files with 196 additions and 45 deletions

View File

@ -154,7 +154,6 @@ will log interesting events and its actions to syslog with facility
.Em daemon
and identity
.Op zfsd .
.El
.Sh FILES
.Bl -tag -width a -compact
.It Pa /var/db/zfsd/cases

View File

@ -59,10 +59,9 @@ typedef unsigned long cap_ioctl_t;
// Too many links
#define E_TOO_MANY_LINKS EMLINK
// TODO(FreeBSD): uncomment if/when FreeBSD propagates rights on accept.
// FreeBSD does not generate a capability from accept(cap_fd,...).
// https://bugs.freebsd.org/201052
// #define CAP_FROM_ACCEPT
// As of commit 85b0f9de11c3 ("capsicum: propagate rights on accept(2)")
// FreeBSD generates a capability from accept(cap_fd,...).
#define CAP_FROM_ACCEPT
// TODO(FreeBSD): uncomment if/when FreeBSD propagates rights on sctp_peeloff.
// FreeBSD does not generate a capability from sctp_peeloff(cap_fd,...).
// https://bugs.freebsd.org/201052

View File

@ -1097,6 +1097,8 @@
..
du
..
env
..
factor
..
file

View File

@ -49,7 +49,6 @@
.Fn execlp "const char *file" "const char *arg" ... NULL
.Ft int
.Fn execle "const char *path" "const char *arg" ... NULL "char *const envp[]"
.Fc
.Ft int
.Fn exect "const char *path" "char *const argv[]" "char *const envp[]"
.Ft int

View File

@ -152,6 +152,7 @@ via
.Fn makecontext ;
portable applications should not rely on the implementation detail that
it may be possible to pass pointer arguments to functions.
.Ef
.Sh HISTORY
The
.Fn makecontext

View File

@ -63,6 +63,7 @@ to the corresponding value:
.Bl -tag -width Er
.It Bq Er EINVAL
Either first or second argument does not point to a valid ACL.
.El
.Sh SEE ALSO
.Xr acl 3 ,
.Xr posix1e 3

View File

@ -75,6 +75,7 @@ to the corresponding value:
.Bl -tag -width Er
.It Bq Er EACCES
Search permission is denied for a component of the path prefix.
.El
.Sh SEE ALSO
.Xr extattr_get_file 2 ,
.Xr posix1e 3

View File

@ -59,7 +59,7 @@
.Fn cap_getgrgid_r "cap_channel_t *chan" "gid_t gid" "struct group *grp" "char *buffer" "size_t bufsize" "struct group **result"
.Ft int
.Fn cap_setgroupent "cap_channel_t *chan" "int stayopen"
.Ft int
.Ft int
.Fn cap_setgrent "cap_channel_t *chan"
.Ft void
.Fn cap_endgrent "cap_channel_t *chan"

View File

@ -93,6 +93,7 @@ The
.Fa size
argument is greater than zero but smaller than the length of the pathname plus 1.
.El
.Sh SEE ALSO
.Xr rel2abs 3
.Sh AUTHORS

View File

@ -90,6 +90,7 @@ argument is zero.
The
.Fa size
argument is greater than zero but smaller than the length of the pathname plus 1
.El
.Sh SEE ALSO
.Xr abs2rel 3
.Sh AUTHORS

View File

@ -396,6 +396,7 @@ back to the default, so that the
.Pa /etc/rc
script is executed with the standard shell
.Pa /bin/sh .
.El
.Sh FILES
.Bl -tag -width /var/log/init.log -compact
.It Pa /dev/console

View File

@ -83,6 +83,7 @@ and 10.0.0.2:1234 as destination:
.Bd -literal -offset indent
# pflowctl -s pflow0 src 10.0.0.1 dst 10.0.0.2:1234
.Ed
.El
.Sh SEE ALSO
.Xr netintro 4 ,
.Xr pf 4 ,

View File

@ -155,7 +155,6 @@ units 0, 2, and 5. A value of 0x8a enables it for units 1, 3, and 7.
.Pp
Note that controllers can be dynamically configured through a device hint
documented below.
.El
.Ed
.Sh BOOT OPTIONS
The following options are switchable by setting values in

View File

@ -107,7 +107,6 @@ disconnection,
and the host adapter's
.Tn SCSI
ID.
.El
.Sh CONFIGURATION OPTIONS
To statically configure one or more controllers to assume the target role:
.Pp
@ -120,6 +119,7 @@ units 0, 2, and 5. A value of 0x8a enables it for units 1, 3, and 7.
Note that controllers can be dynamically configured through a device hint
documented below.
.Ed
.Sh BOOT OPTIONS
The following options are switchable by setting values in
.Pa /boot/device.hints .

View File

@ -127,7 +127,6 @@ Tx queue-specific allocation failures:
.It "Failed to alloc desc ring for tx ring %d"
.It "Failed to vmap fifo, qpl_id = %d"
.El
.El
.Pp
The following messages are recorded when the interface detach fails:
.Bl -diag
@ -200,7 +199,6 @@ does not support the transmission of VLAN-tagged packets.
All VLAN-tagged traffic is dropped.
.Sh SUPPORT
Please email gvnic-drivers@google.com with the specifics of the issue encountered.
.El
.Sh SEE ALSO
.Xr ifconfig 8 ,
.Xr netstat 8

View File

@ -46,10 +46,10 @@ driver.
.Bl -column -compact "Vendor" "Device" "Subv. " "Subd. " "Firmware-Prefix"
.It Ar Name
.It Ar Vendor Ta Ar Device Ta Ar Subv. Ta Ar Subd. Ta Ar Firmware-Prefix
.% ---------------------------------------------------------------------
.% This list is manually generated from a sysctl and post-processing.
.% Edits will be overwritten on next update.
.% ---------------------------------------------------------------------
.\" ---------------------------------------------------------------------
.\" This list is manually generated from a sysctl and post-processing.
.\" Edits will be overwritten on next update.
.\" ---------------------------------------------------------------------
.It ""
.It Intel(R) Dual Band Wireless AC 7260
.It 0x8086 Ta 0x08b1 Ta any Ta 0x4070 Ta iwlwifi-7260
@ -1340,7 +1340,7 @@ driver.
.It ""
.It Intel(R) TBD Sc device
.It 0x8086 Ta any Ta any Ta any Ta (null)
.% ---------------------------------------------------------------------
.\" ---------------------------------------------------------------------
.El
.Pp
.Em Note:

View File

@ -198,7 +198,6 @@ should be set to
to update an existing or establish a new range, or to
.Dv MEMRANGE_SET_REMOVE
to remove a range.
.El
.Ss Live Kernel Dumps
.Pp
The

View File

@ -253,6 +253,7 @@ and include the following lines:
.Bd -literal -offset indent
splash="/boot/images/freebsd-logo-rev.png"
boot_mute="YES"
.Ed
.\".Sh DIAGNOSTICS
.Sh SEE ALSO
.Xr vidcontrol 1 ,

View File

@ -5008,7 +5008,7 @@ variable is set to
.Dq Li YES ,
this particular service is started in a
service jail named
.Va svcj- Ns Ar name Ac .
.Va svcj- Ns Ar name .
The
.Va svcj_all_enable
@ -5039,7 +5039,6 @@ but can be enabled via setting
.Va sshd_svcj
to
.Dq Li YES .
.El
.Sh FILES
.Bl -tag -width "/etc/defaults/rc.conf" -compact
.It Pa /etc/defaults/rc.conf

View File

@ -456,14 +456,17 @@ FreeBSD 5.2 | | | |
| | | | | | | | |
| | FreeBSD | | NetBSD | | |
| | 13.3 | | 9.4 | | |
| | | | | | |
| | | *--NetBSD | | |
| | | | 10.0 | | |
| | | | | | |
| | | | | OpenBSD 7.5 |
| | | | NetBSD | |
| FreeBSD | | 8.3 | |
| 14.1 | | | |
| | | | | | | |
| | | | *--NetBSD | | |
| | | | | 10.0 | | |
| | | | | | | |
| | | | | | OpenBSD 7.5 |
| | | | | NetBSD | |
| | | | | 8.3 | |
| FreeBSD | | | | |
| 14.1 | | | | |
| FreeBSD | | | |
| 13.4 | | OpenBSD 7.6 |
| | | | |
FreeBSD 15 -current | NetBSD -current OpenBSD -current DragonFly -current
| | | | |
@ -899,6 +902,8 @@ OpenBSD 7.5 2024-04-05 [OBD]
NetBSD 9.4 2024-04-20 [NBD]
NetBSD 8.3 2024-05-04 [NBD]
FreeBSD 14.1 2024-06-04 [FBD]
FreeBSD 13.4 2024-09-17 [FBD]
OpenBSD 7.6 2024-10-08 [OBD]
Bibliography
------------------------

View File

@ -2097,7 +2097,7 @@ _vm_domain_allocate(struct vm_domain *vmd, int req_class, int npages)
* Attempt to reserve the pages. Fail if we're below the limit.
*/
limit += npages;
old = vmd->vmd_free_count;
old = atomic_load_int(&vmd->vmd_free_count);
do {
if (old < limit)
return (0);
@ -4239,7 +4239,7 @@ vm_page_wire_mapped(vm_page_t m)
{
u_int old;
old = m->ref_count;
old = atomic_load_int(&m->ref_count);
do {
KASSERT(old > 0,
("vm_page_wire_mapped: wiring unreferenced page %p", m));
@ -4273,12 +4273,15 @@ vm_page_unwire_managed(vm_page_t m, uint8_t nqueue, bool noreuse)
* Use a release store when updating the reference count to
* synchronize with vm_page_free_prep().
*/
old = m->ref_count;
old = atomic_load_int(&m->ref_count);
do {
u_int count;
KASSERT(VPRC_WIRE_COUNT(old) > 0,
("vm_page_unwire: wire count underflow for page %p", m));
if (old > VPRC_OBJREF + 1) {
count = old & ~VPRC_BLOCKED;
if (count > VPRC_OBJREF + 1) {
/*
* The page has at least one other wiring reference. An
* earlier iteration of this loop may have called
@ -4287,7 +4290,7 @@ vm_page_unwire_managed(vm_page_t m, uint8_t nqueue, bool noreuse)
*/
if ((vm_page_astate_load(m).flags & PGA_DEQUEUE) == 0)
vm_page_aflag_set(m, PGA_DEQUEUE);
} else if (old == VPRC_OBJREF + 1) {
} else if (count == VPRC_OBJREF + 1) {
/*
* This is the last wiring. Clear PGA_DEQUEUE and
* update the page's queue state to reflect the
@ -4296,7 +4299,7 @@ vm_page_unwire_managed(vm_page_t m, uint8_t nqueue, bool noreuse)
* clear leftover queue state.
*/
vm_page_release_toq(m, nqueue, noreuse);
} else if (old == 1) {
} else if (count == 1) {
vm_page_aflag_clear(m, PGA_DEQUEUE);
}
} while (!atomic_fcmpset_rel_int(&m->ref_count, &old, old - 1));
@ -4568,10 +4571,12 @@ vm_page_try_blocked_op(vm_page_t m, void (*op)(vm_page_t))
("vm_page_try_blocked_op: page %p is not busy", m));
VM_OBJECT_ASSERT_LOCKED(m->object);
old = m->ref_count;
old = atomic_load_int(&m->ref_count);
do {
KASSERT(old != 0,
("vm_page_try_blocked_op: page %p has no references", m));
KASSERT((old & VPRC_BLOCKED) == 0,
("vm_page_try_blocked_op: page %p blocks wirings", m));
if (VPRC_WIRE_COUNT(old) != 0)
return (false);
} while (!atomic_fcmpset_int(&m->ref_count, &old, old | VPRC_BLOCKED));

View File

@ -1,7 +1,12 @@
.include <src.opts.mk>
PACKAGE= runtime
PROG= env
SRCS= env.c envopts.c
LIBADD= util
HAS_TESTS=
SUBDIR.${MK_TESTS}= tests
.include <bsd.prog.mk>

28
usr.bin/env/env.1 vendored
View File

@ -28,7 +28,7 @@
.\" SUCH DAMAGE.
.\" From FreeBSD: src/usr.bin/printenv/printenv.1,v 1.17 2002/11/26 17:33:35 ru Exp
.\"
.Dd March 3, 2021
.Dd October 7, 2024
.Dt ENV 1
.Os
.Sh NAME
@ -171,6 +171,19 @@ Both
and
.Ar utility
may not be specified together.
.Pp
The
.Nm
utility does not handle values of
.Ar utility
which have an equals sign
.Pq Ql =
in their name, for obvious reasons.
This can easily be worked around by interposing the
.Xr command 1
utility, which simply executes its arguments; see
.Sx EXAMPLES
below.
.\"
.Ss Details of -S (split-string) processing
The processing of the
@ -469,6 +482,11 @@ and
options:
.Pp
.Dl "#!/usr/bin/env -S-P/usr/local/bin:/usr/bin:${PATH} perl"
.Pp
To execute a utility with an equal sign in its name:
.Bd -literal -offset indent
env name=value ... command foo=bar arg ...
.Ed
.Sh COMPATIBILITY
The
.Nm
@ -514,14 +532,6 @@ options were added in
.Sh BUGS
The
.Nm
utility does not handle values of
.Ar utility
which have an equals sign
.Pq Ql =
in their name, for obvious reasons.
.Pp
The
.Nm
utility does not take multibyte characters into account when
processing the
.Fl S

6
usr.bin/env/tests/Makefile vendored Normal file
View File

@ -0,0 +1,6 @@
PACKAGE= tests
ATF_TESTS_SH= env_test
BINDIR= ${TESTSDIR}
.include <bsd.test.mk>

120
usr.bin/env/tests/env_test.sh vendored Normal file
View File

@ -0,0 +1,120 @@
#
# Copyright (c) 2024 Klara, Inc.
#
# SPDX-License-Identifier: BSD-2-Clause
#
magic_words="Squeamish $$ Ossifrage"
atf_test_case basic
basic_head()
{
atf_set "descr" "Basic test case"
}
basic_body()
{
atf_check -o match:"^magic_words=${magic_words}\$" \
env magic_words="${magic_words}"
export MAGIC_WORDS="${magic_words}"
atf_check -o match:"^MAGIC_WORDS=${magic_words}\$" \
env
unset MAGIC_WORDS
}
atf_test_case unset
unset_head()
{
atf_set "descr" "Unset a variable"
}
unset_body()
{
export MAGIC_WORDS="${magic_words}"
atf_check -o not-match:"^MAGIC_WORDS=" \
env -u MAGIC_WORDS
unset MAGIC_WORDS
}
atf_test_case empty
empty_head()
{
atf_set "descr" "Empty environment"
}
empty_body()
{
atf_check env -i
}
atf_test_case true
true_head()
{
atf_set "descr" "Run true"
}
true_body()
{
atf_check env true
}
atf_test_case false
false_head()
{
atf_set "descr" "Run false"
}
false_body()
{
atf_check -s exit:1 env false
}
atf_test_case false
false_head()
{
atf_set "descr" "Run false"
}
false_body()
{
atf_check -s exit:1 env false
}
atf_test_case altpath
altpath_head()
{
atf_set "descr" "Use alternate path"
}
altpath_body()
{
echo "echo ${magic_words}" >magic_words
chmod 0755 magic_words
atf_check -s exit:127 -e match:"No such file" \
env magic_words
atf_check -o inline:"${magic_words}\n" \
env -P "${PWD}" magic_words
}
atf_test_case equal
equal_head()
{
atf_set "descr" "Command name contains equal sign"
}
equal_body()
{
echo "echo ${magic_words}" >"magic=words"
chmod 0755 "magic=words"
atf_check -o match:"^${PWD}/magic=words$" \
env "${PWD}/magic=words"
atf_check -o match:"^magic=words$" \
env -P "${PATH}:${PWD}" "magic=words"
atf_check -o inline:"${magic_words}\n" \
env command "${PWD}/magic=words"
atf_check -o inline:"${magic_words}\n" \
env PATH="${PATH}:${PWD}" command "magic=words"
}
atf_init_test_cases()
{
atf_add_test_case basic
atf_add_test_case unset
atf_add_test_case empty
atf_add_test_case true
atf_add_test_case false
atf_add_test_case altpath
atf_add_test_case equal
}

View File

@ -640,7 +640,6 @@ Emulate a TPM device. The argument
.Ar path
needs to point to a valid TPM device path, i.e.
.Pa /dev/tpm0 .
.El
.Pp
Supported options for
.Ar type :

View File

@ -62,7 +62,6 @@ by the MDS or reported to the MDS by a client.
.Pp
The pNFS service should continue to run normally so long as the number of
operational DSs is at least as many as the level of mirroring.
.El
.Sh SEE ALSO
.Xr nfsv4 4 ,
.Xr pnfs 4 ,