Kristof Provost [Fri, 12 Jan 2024 10:54:18 +0000 (11:54 +0100)]
pf: implement addrule via netlink
Sponsored by: Rubicon Communications, LLC ("Netgate")
Kristof Provost [Thu, 1 Feb 2024 17:59:36 +0000 (18:59 +0100)]
pf: ensure dummynet gets the correct direction after route-to
If we apply a route-to to an inbound packet pf_route() may hand that
packet over to dummynet. Dummynet may then delay the packet, and later
re-inject it. This re-injection (in dummynet_send()) needs to know
if the packet was inbound or outbound, to call the correct path for
continued processing.
That's done based on the pf_pdesc we pass along (through
pf_dummynet_route() and pf_pdesc_to_dnflow()). In the case of pf_route()
on inbound packets that may be wrong, because we're called in the input
path, and didn't update pf_pdesc->dir.
This can manifest in issues with fragmented packets. For example, a
fragmented packet will be re-fragmented in pf_route(), and if dummynet
makes different decisions for some of the fragments (that is, it delays
some and allows others to pass through directly) this will break.
The packets that pass through dummynet without delay will be transmitted
correctly (through the ifp->if_output() call in pf_route()), but
the delayed packets will be re-injected in the input path (and not
the output path, as they should be). These packets will pass through
pf_test(PF_IN) as they're tagged PF_MTAG_FLAG_DUMMYNET. However,
this tag is then removed and the packet will be routed and enter
pf_test(PF_OUT) where pf_reassemble() will hold them indefinitely
(as some fragments have been transmitted directly, and will never hit
pf_test(PF_OUT)).
The fix is simple: we must update pf_pfdesc->dir to PF_OUT before we
pass the packet to dummynet.
See also: https://redmine.pfsense.org/issues/15156
Reviewed by: rcm
Sponsored by: Rubicon Communications, LLC ("Netgate")
Lexi Winter [Fri, 2 Feb 2024 16:17:19 +0000 (09:17 -0700)]
.gitignore: add sys/*/compile
Files in sys/*/compile are created when compiling the kernel with
config(8). They are never source files and should never be committed to
source control, so list this entire directory in .gitignore. While not
the official way to build the kernel, it's often useful to debug
sys/conf/files* changes when adding new drivers, etc.
Reviewed by: imp, meena <me igalic co>
Pull Request: https://github.com/freebsd/freebsd-src/pull/1082
Mina Galić [Fri, 2 Feb 2024 15:35:46 +0000 (08:35 -0700)]
kldxref: Fix maketempfile function's way of finding the root dir
Rather than assuming that the "root" is passed as directory and will be
marked by a trailing slash, we just assume that the directory, which has
been checked previously to be a directory, is a directory.
This fixes an inconsistency between `kldxref /boot/modules`, which tries
to create the temp file in `/boot/`, and `kldxref /boot/modules/`, which
tries to create it in `/boot/modules/` itself.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1093
Mark Johnston [Fri, 2 Feb 2024 14:23:53 +0000 (09:23 -0500)]
libthr: Force the thr_wake() symbol to be resolved during initialization
Otherwise the lock upgrade performed by rtld's load_filtees() can result
in infinite recursion, wherein:
1. _rtld_bind() acquires the bind read lock,
2. the source DSO's filtees haven't been loaded yet, so the lock upgrade
in load_filtees() cause rtld to jump to _rtld_bind() and release the
bind lock,
3. _thr_rtld_lock_release() calls _thr_ast(), which calls thr_wake(),
which hasn't been resolved yet,
4. _rtld_bind() acquires the bind read lock in order to resolve
thr_wake(),
5. ...
See the linked pull request for an instance of this problem arising with
libsys. That particular instance is also worked around by commit
e7951d0b04e6.
Reported by: brooks
Reviewed by: kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/908
MFC after: 1 week
Sponsored by: Innovate UK
Lexi Winter [Fri, 2 Feb 2024 15:29:01 +0000 (08:29 -0700)]
share/examples/IPv6/USAGE: remove
This document dates from the KAME days and, among other things,
references the 'prefix' command which has not existed for a long time.
Since IPv6 configuration is now documented in the Handbook, remove this
obsolete file.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1094
Graham Perrin [Fri, 2 Feb 2024 15:25:41 +0000 (08:25 -0700)]
freebsd-tips: freebsd-update fetch, then install
In end of life (EOL) warning cases: freebsd-update fetch install (the
two commands, combined) may fetch and patch, but not install.
Instead: run the two consecutively. Consistent with installation
information in /releases/ areas and with accepted
https://reviews.freebsd.org/D42722
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1096
Mark Johnston [Thu, 1 Feb 2024 22:43:05 +0000 (17:43 -0500)]
rtld-elf: Avoid unnecessary lock_restart_for_upgrade() calls
In order to atomically upgrade the rtld bind lock, load_filtees() may
trigger a longjmp back to _rtld_bind() so that the binding can be done
with the write lock held. However, the write lock is only needed when
filtee objects haven't already been loaded, so move the
lock_restart_for_upgrade() call to avoid unnecessary lock upgrades when
a filtee is defined.
Reviewed by: kib
Tested by: brooks
MFC after: 1 week
Sponsored by: Innovate UK
Emmanuel Vadot [Fri, 2 Feb 2024 10:39:51 +0000 (11:39 +0100)]
Revert "pkgbase: Create a FreeBSD-dtb package"
Somehow this doesn't work iwth make packages due to some kind of a race.
The package is first created correctly but later in the process it is
overwritten by a badly created empty package.
Revert in the mean time so we can have working pkgbase on arm/arm64
This reverts commit
a5afd7920d50ff23f91bdbabb1f0fd7ba028ba9e.
Warner Losh [Fri, 2 Feb 2024 07:23:43 +0000 (00:23 -0700)]
checkstyle9.pl: Differentiate errors and warnings
Use ::error and ::warning as appropriate to give better meaning to the
messages.
Sponsored by: Netflix
Warner Losh [Fri, 2 Feb 2024 06:26:38 +0000 (23:26 -0700)]
checkstyle9.pl: Another correction to github workflow
Remove extra space...
Sponsored by: Netflix
Warner Losh [Fri, 2 Feb 2024 06:15:13 +0000 (23:15 -0700)]
checkstyle9.pl: Correct github output
Change the : between file and line to a ,. This should fix this...
Sponsored by: Netflix
Warner Losh [Fri, 2 Feb 2024 05:53:58 +0000 (22:53 -0700)]
github: Enable github workflow output from checkstyle9.pl
Let's see if we can get the style issues flagged inline.
Sponsored by: Netflix
Warner Losh [Fri, 2 Feb 2024 05:50:19 +0000 (22:50 -0700)]
checkstyle9.pl: Add --github to output for github workflows
If you add "::error file=foo/bar.c:line=123:" before the error message,
it will appear inline.
Sponsored by: Netflix
Philip Paeps [Fri, 2 Feb 2024 02:01:39 +0000 (10:01 +0800)]
contrib/tzdata: import tzdata 2024a
Changes: https://github.com/eggert/tz/blob/2024a/NEWS
MFC after: 3 days
Philip Paeps [Fri, 2 Feb 2024 01:53:59 +0000 (09:53 +0800)]
Import tzdata 2024a
Ed Maste [Thu, 1 Feb 2024 21:22:11 +0000 (16:22 -0500)]
pflowctl: add missing break to case 's'
CID: 1534009
Reported by: Coverity Scan
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D43704
Gleb Smirnoff [Thu, 1 Feb 2024 21:37:26 +0000 (13:37 -0800)]
tests/netinet: add a demo of TCP implied connect
The TCP implied connect is an artifact left after T/TCP. To my surprise
it still works, hence the existence of this test. Please read this email
first:
https://lists.freebsd.org/pipermail/freebsd-net/2010-August/026311.html
An interesting fact that this test takes 220 - 240 milliseconds to
execute on my Threadripper PRO. Flipping the '#if 0' to '#if 1' in the
test, thus bringing it back to normal connect(2), would speed the test up
a hundred times and I guess all this time is fork+exec of the test.
Gleb Smirnoff [Thu, 1 Feb 2024 21:37:26 +0000 (13:37 -0800)]
socket tests: improve error message
Gleb Smirnoff [Thu, 1 Feb 2024 21:37:26 +0000 (13:37 -0800)]
unix/dgram: don't clear so_error in case of MSG_PEEK
Brooks Davis [Thu, 1 Feb 2024 17:13:19 +0000 (17:13 +0000)]
syscalls.master: Remove stray blank lines
No functional change.
Dag-Erling Smørgrav [Thu, 1 Feb 2024 13:10:45 +0000 (14:10 +0100)]
bintrans: Remove unused variable.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D43559
Dag-Erling Smørgrav [Thu, 1 Feb 2024 13:10:41 +0000 (14:10 +0100)]
bintrans: Add base64 to name list in manual page.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: 0mp, pstef
Differential Revision: https://reviews.freebsd.org/D43558
Dag-Erling Smørgrav [Thu, 1 Feb 2024 13:10:37 +0000 (14:10 +0100)]
bintrans: Fix uninitialized variable.
`prev` may be used uninitialized if `body` starts with a newline.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: bapt, emaste
Differential Revision: https://reviews.freebsd.org/D43534
Dag-Erling Smørgrav [Thu, 1 Feb 2024 13:10:31 +0000 (14:10 +0100)]
bintrans: Error out if writing to the output failed.
- Cover all code paths.
- When decoding, check all output files, not just the last one.
- A simple `ferror()` check is not enough as an error may later occur
while flushing whatever remains in the output buffer.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D43532
Baptiste Daroussin [Thu, 1 Feb 2024 07:44:04 +0000 (08:44 +0100)]
kbdmap: fix typo preventing kbdmap to work under vt
Baptiste Daroussin [Thu, 1 Feb 2024 07:40:00 +0000 (08:40 +0100)]
kbdmap: remove debug
Robert Wing [Thu, 1 Feb 2024 02:33:05 +0000 (17:33 -0900)]
mpr: endianess fix for set/get dpm page0
Reviewed by: oshogbo, imp
Sponsored by: Klara, Inc.
Sponsored by: Datazap
Differential Revision: https://reviews.freebsd.org/D43505
Gregory Neil Shapiro [Thu, 1 Feb 2024 00:27:37 +0000 (00:27 +0000)]
Minor change to update these files so new freebsd*.cf files are
generated
Gregory Neil Shapiro [Thu, 1 Feb 2024 00:21:15 +0000 (00:21 +0000)]
Add a note about sendmail 8.18.1's stricter SMTP protocol enforcement
Gregory Neil Shapiro [Thu, 1 Feb 2024 00:13:58 +0000 (00:13 +0000)]
New sendmail 8.18.1 cf file
Gregory Neil Shapiro [Thu, 1 Feb 2024 00:04:53 +0000 (00:04 +0000)]
Add new source file for sendmail 8.18.1
Gregory Neil Shapiro [Wed, 31 Jan 2024 23:53:48 +0000 (23:53 +0000)]
Merge commit '
850ef5ae11d69ea3381bd310f564f025fc8caea3'
Merge vendor sendmail 8.18.1 into HEAD
Gregory Neil Shapiro [Wed, 31 Jan 2024 23:37:30 +0000 (23:37 +0000)]
Import sendmail 8.18.1
John Baldwin [Wed, 31 Jan 2024 22:48:26 +0000 (14:48 -0800)]
pmap: Convert boolean_t to bool.
Reviewed by: kib (older version)
Differential Revision: https://reviews.freebsd.org/D39921
Brad Davis [Fri, 26 Jan 2024 17:46:46 +0000 (10:46 -0700)]
bsdinstall: separate out dist selection in prep for pkgbase support
No functional change intended.
Approved by: asiciliano
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D43621
Enji Cooper [Wed, 31 Jan 2024 20:45:32 +0000 (12:45 -0800)]
periodic: fix a typo in a comment
No functional change.
Ed Maste [Fri, 12 Jan 2024 15:01:49 +0000 (10:01 -0500)]
csu: add crtbrand.o dependency on sys/param.h
__FreeBSD_version is recorded in *crt1.o and crti.o via crtbrand.o. Add
an explicit dependency to pick up __FreeBSD_version bumps.
Additional changes are required to fully plumb *crt1.o dependencies
through the build.
Reported by: bapt
Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43417
Jessica Clarke [Wed, 31 Jan 2024 19:45:59 +0000 (19:45 +0000)]
tools/build/make.py: Avoid Python 3.7+ subprocess.run capture_output
This is just a convenient alias for setting stdout and stderr to PIPE,
so substitute it for that to be compatible with Python 3.6.
Fixes:
69cfdc81ea7b ("tools/build/make.py: Keep bootstrapped bmake binary up-to-date")
Jung-uk Kim [Wed, 31 Jan 2024 18:41:29 +0000 (13:41 -0500)]
acpica: Fix build with ACPICA
20230331 and later
ACPICA is using flexible arrays since
20230331 and it broke aarch64
build.
--- acpi_iort.o ---
/usr/src/sys/arm64/acpica/acpi_iort.c:103:4: error: field 'data' with
variable sized type 'union (unnamed union at
/usr/src/sys/arm64/acpica/acpi_iort.c:98:2)' not at the end of a struct
or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
103 | } data;
| ^
Reported by: bapt
Tested by: bapt
Graham Perrin [Sun, 6 Aug 2023 17:34:03 +0000 (18:34 +0100)]
intro.9: minor changes
A correction: 'and' -> 'an'. Plus, several tweaks for brevity or
clarity.
Reviewed by: mhorne
MFC after: 3 days
Pull Request: https://github.com/freebsd/freebsd-src/pull/813
John Baldwin [Wed, 31 Jan 2024 17:15:58 +0000 (09:15 -0800)]
timerfd: Move kern_timerfd_* prototypes to <sys/syscallsubr.h>
Bryan Venteicher [Wed, 31 Jan 2024 05:02:59 +0000 (23:02 -0600)]
virtio: Add more device IDs from the specification
Jung-uk Kim [Tue, 30 Jan 2024 21:49:20 +0000 (16:49 -0500)]
acpica: Import ACPICA
20230628
(cherry picked from commit
ef3ba9d625927fd4592a8c071698a562821485bd)
Jung-uk Kim [Tue, 30 Jan 2024 21:43:45 +0000 (16:43 -0500)]
acpica: Import ACPICA
20230331
(cherry picked from commit
8e013e1e3b81740266738226667431cf5c28b17a)
John Baldwin [Wed, 31 Jan 2024 00:41:43 +0000 (16:41 -0800)]
cxgbe tom: Enable ULP_MODE_TCPDDP on demand
Most ULP modes in cxgbe's TOE are enabled on the fly when a protocol
is needed (e.g. ULP_MODE_ISCSI is enabled by cxgbei when offloading a
connection using iSCSI, and ULP_MODE_TLS is enabled when RX TLS keys
are programmed for a TOE connection). The one exception to this is
ULP_MODE_TCPDDP.
Currently the cxgbe driver enables ULP_MODE_TCPDDP when a TOE
connection is first created. However, since DDP connections cannot be
converted to other connection types, this requires some special
handling in the driver. For example, iSCSI daemons use the SO_NO_DDP
socket option to ensure TOE connections use ULP_MODE_NONE so they can
be converted to ULP_MODE_ISCSI. Similarly, using TLS receive offload
(ULP_MODE_TLS) requires disabling TCP DDP for new connections by
default.
This commit changes cxgbe to instead switch a connection from
ULP_MODE_NONE to ULP_MODE_TCPDDP when a connection first attempts to
use TCP DDP via aio_read(2). This permits connections to always start
as ULP_MODE_NONE and switch to a protocol-specific mode as needed.
Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43670
John Baldwin [Wed, 31 Jan 2024 00:41:23 +0000 (16:41 -0800)]
cxgbe tom: Limit TOE connections to 2 reassembly islands always
Previously this was only limited on T6 cards to support switching from
ULP_MODE_NONE to ULP_MODE_TLS. To support switching to
ULP_MODE_TCPDDP, enable this for all adapters.
Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43669
John Baldwin [Wed, 31 Jan 2024 00:40:31 +0000 (16:40 -0800)]
cxgbe: Add counters for POSIX async I/O requests handled by the driver
Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43668
John Baldwin [Wed, 31 Jan 2024 00:38:29 +0000 (16:38 -0800)]
syscallsubr.h: Sort kern_membarrier prototype alphabetically
Martin Matuska [Tue, 30 Jan 2024 22:52:29 +0000 (23:52 +0100)]
zfs: merge openzfs/zfs@
2e6b3c4d9
Notable upstream pull request merges:
#15793
401c3563d libzfs: use zfs_strerror() in place of strerror()
#15793
692f0daba libzfs: make userquota_propname_decode threadsafe
#15798
0cbf13529 libnvpair.c: replace strstr() with strchr() for a single
character
#15812
78e8c1f84 Remove list_size struct member from list implementation
#15816
aeb33776f Update vdev devid and physpath if changed between imports
#15818
8161b7327 Don't assert mg_initialized due to device addition race
#15823
c3fd7a521 Update man pages to time(1) from time(2)
#15825
884a48d99 zpool wait: print timestamp before the header
Obtained from: OpenZFS
OpenZFS commit:
2e6b3c4d9453360a351af6148386360a3a7209b3
Konstantin Belousov [Tue, 30 Jan 2024 22:14:25 +0000 (00:14 +0200)]
sys/mount.h: use __inline
instead of plain inline, for C89
Reported by: antoine
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Jessica Clarke [Tue, 30 Jan 2024 22:17:34 +0000 (22:17 +0000)]
share/man: Add mandoc.db files to METALOG
Otherwise these are omitted for -DNO_ROOT builds, whether for disk
images or dist tarballs.
Reviewed by: brooks, emaste
Differential Revision: https://reviews.freebsd.org/D43676
Jessica Clarke [Tue, 30 Jan 2024 22:17:28 +0000 (22:17 +0000)]
etc: Set DISTBASE during distribute for sub-makes
This is normally done by bsd.subdir.mk in its default distribute target,
but since etc overrides it we don't get that behaviour. Currently it's
not needed, but share/man's makedb (recursed into by etc's afterinstall)
will need it in the following commit. Technically this is only needed
for install, but do this for distribution too for completeness and
consistency.
Reviewed by: brooks, emaste
Differential Revision: https://reviews.freebsd.org/D43675
Igor Ostapenko [Tue, 30 Jan 2024 21:04:57 +0000 (22:04 +0100)]
pf: uncomment counter asserts after mem leak fix
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D43657
Jessica Clarke [Tue, 30 Jan 2024 20:33:30 +0000 (20:33 +0000)]
riscv: Remove the unused riscv64_cpu driver
This is a repeat of
63bf2d735ca3 ("Remove the unused arm64_cpu driver.")
for RISC-V, which copied the defunct code from arm64 with no changes
beyond substituting riscv64 for arm64, and made no use of it elsewhere.
It has thus always been entirely superfluous.
Reviewed by: mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43672
Konstantin Belousov [Tue, 30 Jan 2024 18:07:59 +0000 (20:07 +0200)]
chflags(1): obey siginfo request on chflagsat(2) failure
Note that the error diagnostic can now be printed both to stderr due to
the absence of the -f flag and to stdout due to SIGINFO simultaneously.
Noted and reviewed by: jrtc27
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Mike Karels [Tue, 30 Jan 2024 20:16:51 +0000 (14:16 -0600)]
RELNOTES: document powerd enable on RPI images
Note that powerd(8) is enabled in /etc/rc.conf.
Gleb Smirnoff [Tue, 30 Jan 2024 18:09:48 +0000 (10:09 -0800)]
sockets: garbage collect SS_ISCONFIRMING
Fixes:
8df32b19dee92b5eaa4b488ae78dca6accfcb38e
Ricardo Branco [Mon, 29 Jan 2024 22:17:47 +0000 (23:17 +0100)]
chflags(1): Fix -f option
As stated in the man page, -f must not emit warning on error, and must
not set the utility exit code.
PR: 276723
Github PR: https://github.com/freebsd/freebsd-src/pull/1088
Reviewed by: imp, kib
MFC after: 1 week
Florian Walpen [Tue, 30 Jan 2024 15:07:57 +0000 (15:07 +0000)]
snd_hdspe(4): Per device sysctl for sample rate.
Some hardware setups require a specific sample rate due to devices being
connected to digital ports (AES, S/PDIF, ADAT). Add a per device sysctl
"sample_rate" to let the user override sample rate requests from the pcm
infrastructure, when needed.
Differential Revision: https://reviews.freebsd.org/D43659
Mark Johnston [Sun, 21 Jan 2024 15:19:42 +0000 (10:19 -0500)]
scsi_cd: Remove commented-out code
This is left over from before the implementation of asynchronous media
probing, which was committed in
dd78f43259ef
("scsi_cd: make the media check asynchronous") quite a while ago now.
No functional change intended.
MFC after: 1 week
Reviewed by: imp, avg
Differential Revision: https://reviews.freebsd.org/D43650
Mark Johnston [Tue, 30 Jan 2024 01:01:12 +0000 (20:01 -0500)]
scsi_cd: Maintain a periph reference during media checks
Otherwise nothing prevents the asynchronous media check state machine
from running after the periph has been destroyed, which can result in a
double free. Acquire the reference even when performing a synchronous
check, since that doesn't hurt and keeps things simpler.
PR: 276251
Reviewed by: imp
Fixes:
dd78f43259ef ("scsi_cd: make the media check asynchronous")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43525
Mark Johnston [Tue, 30 Jan 2024 01:00:13 +0000 (20:00 -0500)]
scsi_cd: Use a bool for the second parameter of cdcheckmedia()
No functional change intended.
Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43525
Zsolt Udvari [Sat, 27 Jan 2024 18:53:51 +0000 (19:53 +0100)]
Add uzsolt@ to committers
Committer's Guide, steps for new committers, step 5.
Approved by: bofh (mentor), diizzy (mentor)
Differential Revision: https://reviews.freebsd.org/D43630
Andriy Gapon [Tue, 30 Jan 2024 06:45:01 +0000 (08:45 +0200)]
rdmsr_safe/wrmsr_safe: handle pcb_onfault nesting
rdmsr_safe and wrmsr_safe can be called while pcb_onfault is already
set, so the functions are modified to preserve the handler rather than
resetting it before returning.
One case where that happens is when AMD microcode update routine
is executed on a stack where copyin / copyout was already active.
Here is a sample panic message from a crash caused by resetting the
handler:
<118>Updating CPU Microcode...
Fatal trap 12: page fault while in kernel mode
cpuid = 3; apic id = 03
fault virtual address = 0x11ed0de6000
fault code = supervisor write data, page not present
instruction pointer = 0x20:0xffffffff80c2df03
stack pointer = 0x28:0xfffffe01ce4a4c70
frame pointer = 0x28:0xfffffe01ce4a4c70
code segment = base 0x0, limit 0xfffff, type 0x1b
= DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags = interrupt enabled, resume, IOPL = 0
current process = 117 (logger)
trap number = 12
panic: page fault
cpuid = 3
time =
1681462027
KDB: stack backtrace:
db_trace_self_wrapper() at 0xffffffff80615deb = db_trace_self_wrapper+0x2b/frame 0xfffffe01ce4a4830
kdb_backtrace() at 0xffffffff80943c77 = kdb_backtrace+0x37/frame 0xfffffe01ce4a48e0
vpanic() at 0xffffffff808f5fe5 = vpanic+0x185/frame 0xfffffe01ce4a4940
panic() at 0xffffffff808f5da3 = panic+0x43/frame 0xfffffe01ce4a49a0
trap_fatal() at 0xffffffff80c31849 = trap_fatal+0x379/frame 0xfffffe01ce4a4a00
trap_pfault() at 0xffffffff80c318b5 = trap_pfault+0x65/frame 0xfffffe01ce4a4a60
trap() at 0xffffffff80c30f5f = trap+0x29f/frame 0xfffffe01ce4a4b80
trap_check() at 0xffffffff80c31c29 = trap_check+0x29/frame 0xfffffe01ce4a4ba0
calltrap() at 0xffffffff80c07fd8 = calltrap+0x8/frame 0xfffffe01ce4a4ba0
--- trap 0xc, rip = 0xffffffff80c2df03, rsp = 0xfffffe01ce4a4c70, rbp = 0xfffffe01ce4a4c70 ---
copyout_nosmap_std() at 0xffffffff80c2df03 = copyout_nosmap_std+0x63/frame 0xfffffe01ce4a4c70
uiomove_faultflag() at 0xffffffff8095f0d5 = uiomove_faultflag+0xe5/frame 0xfffffe01ce4a4cb0
uiomove() at 0xffffffff8095efeb = uiomove+0xb/frame 0xfffffe01ce4a4cc0
pipe_read() at 0xffffffff80968860 = pipe_read+0x230/frame 0xfffffe01ce4a4d30
dofileread() at 0xffffffff809653cb = dofileread+0x8b/frame 0xfffffe01ce4a4d80
sys_read() at 0xffffffff80964fa0 = sys_read+0xc0/frame 0xfffffe01ce4a4df0
amd64_syscall() at 0xffffffff80c3221a = amd64_syscall+0x18a/frame 0xfffffe01ce4a4f30
fast_syscall_common() at 0xffffffff80c088eb = fast_syscall_common+0xf8/frame 0xfffffe01ce4a4f30
--- syscall (3, FreeBSD ELF64, read), rip = 0x11ece41cfaa, rsp = 0x11ecbec4908, rbp = 0x11ecbec4920 ---
Uptime: 41s
And another one:
Fatal trap 12: page fault while in kernel mode
cpuid = 4; apic id = 04
fault virtual address = 0x800a22000
fault code = supervisor write data, page not present
instruction pointer = 0x20:0xffffffff80b2c7ca
stack pointer = 0x28:0xfffffe01c55b5480
frame pointer = 0x28:0xfffffe01c55b5480
code segment = base 0x0, limit 0xfffff, type 0x1b
= DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags = interrupt enabled, resume, IOPL = 0
current process = 68418 (pfctl)
trap number = 12
panic: page fault
cpuid = 4
time =
1625184463
KDB: stack backtrace:
db_trace_self_wrapper() at 0xffffffff805c1e8b = db_trace_self_wrapper+0x2b/frame 0xfffffe01c55b5040
kdb_backtrace() at 0xffffffff808874b7 = kdb_backtrace+0x37/frame 0xfffffe01c55b50f0
vpanic() at 0xffffffff808449d8 = vpanic+0x188/frame 0xfffffe01c55b5150
panic() at 0xffffffff808445f3 = panic+0x43/frame 0xfffffe01c55b51b0
trap_fatal() at 0xffffffff80b300a5 = trap_fatal+0x375/frame 0xfffffe01c55b5210
trap_pfault() at 0xffffffff80b30180 = trap_pfault+0x80/frame 0xfffffe01c55b5280
trap() at 0xffffffff80b2f729 = trap+0x289/frame 0xfffffe01c55b5390
trap_check() at 0xffffffff80b304d9 = trap_check+0x29/frame 0xfffffe01c55b53b0
calltrap() at 0xffffffff80b0bb28 = calltrap+0x8/frame 0xfffffe01c55b53b0
--- trap 0xc, rip = 0xffffffff80b2c7ca, rsp = 0xfffffe01c55b5480, rbp = 0xfffffe01c55b5480 ---
copyout_nosmap_std() at 0xffffffff80b2c7ca = copyout_nosmap_std+0x15a/frame 0xfffffe01c55b5480
pfioctl() at 0xffffffff85539358 = pfioctl+0x4d28/frame 0xfffffe01c55b5940
devfs_ioctl() at 0xffffffff807176cf = devfs_ioctl+0xcf/frame 0xfffffe01c55b59a0
VOP_IOCTL_APV() at 0xffffffff80bb26e2 = VOP_IOCTL_APV+0x92/frame 0xfffffe01c55b59c0
VOP_IOCTL() at 0xffffffff80928014 = VOP_IOCTL+0x34/frame 0xfffffe01c55b5a10
vn_ioctl() at 0xffffffff80923330 = vn_ioctl+0xc0/frame 0xfffffe01c55b5b00
devfs_ioctl_f() at 0xffffffff80717bbe = devfs_ioctl_f+0x1e/frame 0xfffffe01c55b5b20
fo_ioctl() at 0xffffffff808abc6b = fo_ioctl+0xb/frame 0xfffffe01c55b5b30
kern_ioctl() at 0xffffffff808abc01 = kern_ioctl+0x1d1/frame 0xfffffe01c55b5b80
sys_ioctl() at 0xffffffff808ab982 = sys_ioctl+0x132/frame 0xfffffe01c55b5c50
syscallenter() at 0xffffffff80b30cc9 = syscallenter+0x159/frame 0xfffffe01c55b5ca0
amd64_syscall() at 0xffffffff80b309a5 = amd64_syscall+0x15/frame 0xfffffe01c55b5d30
fast_syscall_common() at 0xffffffff80b0c44e = fast_syscall_common+0xf8/frame 0xfffffe01c55b5d30
PR: 276426
Reviewed by: kib, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43639
Lin Lee [Wed, 17 Jan 2024 04:30:29 +0000 (12:30 +0800)]
hostname(1): Add test cases
Sponsored by: The FreeBSD Foundation
Pull Request: https://github.com/freebsd/freebsd-src/pull/1069
Warner Losh [Mon, 29 Jan 2024 23:57:19 +0000 (16:57 -0700)]
style(9): Note larger divergence than implied
Times have changed, and we've diverged somewhat from the original style
guide, while still keeping much of the flavor and flair of its spirit as
the C language has evolved over the last 30 years since 4.4 was
released.
Sponsored by: Netflix
Minsoo Choo [Mon, 29 Jan 2024 23:53:31 +0000 (16:53 -0700)]
style(9): Remove $FreeBSD$ recommendation.
Now that stable/12 is now EOL, there's no reason to do this. They've
been proactively removed from the tree.
Reviewed by: imp, lwhsu
Differential Revision: https://reviews.freebsd.org/D43641
Olivier Certner [Thu, 25 Jan 2024 22:25:10 +0000 (23:25 +0100)]
login_cap.h: Remove LOGIN_DEFPRI
This is an implementation detail which is likely to become irrelevant in
the future, as we move to not resetting the priority if the
corresponding capability is not present in the configuration file
('/etc/login.conf').
GitHub's code search and Google show no use of this public constant, and
it doesn't exist in OpenBSD and NetBSD.
So, remove this definition and its sole use in-tree.
PR: 276570 (exp-run)
Reviewed by: emaste
Approved by: emaste (mentor)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43609
Olivier Certner [Thu, 25 Jan 2024 22:10:40 +0000 (23:10 +0100)]
login_cap.h: Remove LOGIN_DEFUMASK
This public constant has not been used in-tree since 1997 (this was
noticed while working on previous commit "setusercontext(): umask: Set
it only once (in the common case)").
Since it was an implementation detail and GitHub's code search and
Google show no use of this symbol today, simply remove it.
PR: 276570 (exp-run)
Reviewed by: emaste, kib (earlier version, then part of D40344)
Approved by: emaste (mentor)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43608
Olivier Certner [Tue, 30 May 2023 15:14:50 +0000 (17:14 +0200)]
setusercontext(): Set priority from '~/.login_conf' as well
Setting the process priority is done only when the current process'
effective UID corresponds to that for which context is to be set.
Consequently, setting priority is done with appropriate credentials and
will fail if the target user tries to raise it unduly via his
'~/.login_conf'.
PR: 271751
Reviewed by: kib, Andrew Gierth <andrew_tao173.riddles.org.uk>
Approved by: emaste (mentor)
MFC after: 3 days
Relnotes: yes
Sponsored by: Kumacom SAS
Differential Revision: https://reviews.freebsd.org/D40352
Olivier Certner [Wed, 21 Jun 2023 08:39:47 +0000 (10:39 +0200)]
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
Olivier Certner [Wed, 21 Jun 2023 08:53:37 +0000 (10:53 +0200)]
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
Olivier Certner [Mon, 29 May 2023 17:09:36 +0000 (19:09 +0200)]
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
Olivier Certner [Wed, 21 Jun 2023 08:39:15 +0000 (10:39 +0200)]
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
Olivier Certner [Mon, 29 May 2023 16:39:04 +0000 (18:39 +0200)]
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
Olivier Certner [Mon, 29 May 2023 14:06:37 +0000 (16:06 +0200)]
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
Olivier Certner [Thu, 25 May 2023 14:29:22 +0000 (16:29 +0200)]
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
Olivier Certner [Wed, 21 Jun 2023 08:42:44 +0000 (10:42 +0200)]
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
Olivier Certner [Tue, 20 Jun 2023 19:41:04 +0000 (21:41 +0200)]
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
Olivier Certner [Tue, 20 Jun 2023 16:46:31 +0000 (18:46 +0200)]
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
Olivier Certner [Tue, 20 Jun 2023 20:09:57 +0000 (22:09 +0200)]
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
Olivier Certner [Tue, 20 Jun 2023 16:41:32 +0000 (18:41 +0200)]
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
Olivier Certner [Thu, 25 May 2023 12:41:03 +0000 (14:41 +0200)]
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
Olivier Certner [Thu, 25 May 2023 12:18:45 +0000 (14:18 +0200)]
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
Konstantin Belousov [Mon, 29 Jan 2024 17:54:32 +0000 (19:54 +0200)]
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
Rob Norris [Tue, 23 Jan 2024 10:14:06 +0000 (21:14 +1100)]
Linux 6.8 compat: handle mnt_idmap user_namespace change
struct mnt_idmap no longer has a struct user_namespace within it. Work
around this by creating a temporary with the copy of the map we need
taken from the idmap.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Youzhong Yang <yyang@mathworks.com>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #15805
Rob Norris [Tue, 23 Jan 2024 06:43:20 +0000 (17:43 +1100)]
Linux 6.8 compat: fix inode permission tests
The name inode_permission is now defined in the kernel. Rename ours to
test_permission, in line with most of our other tests.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #15805
Rob Norris [Tue, 23 Jan 2024 05:41:05 +0000 (16:41 +1100)]
Linux 6.8 compat: replace MAX_ORDER define
MAX_ORDER has been renamed to MAX_PAGE_ORDER. Rather than just
redefining it, instead define our own name and set it consistently from
the start.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #15805
Rob Norris [Tue, 23 Jan 2024 05:34:49 +0000 (16:34 +1100)]
Linux 6.8 compat: implement strlcpy fallback
Linux has removed strlcpy in favour of strscpy. This implements a
fallback implementation of strlcpy for this case.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #15805
Rob Norris [Tue, 23 Jan 2024 04:42:57 +0000 (15:42 +1100)]
Linux 6.8 compat: update for new bdev access functions
blkdev_get_by_path() and blkdev_put() have been replaced by
bdev_open_by_path() and bdev_release(), which return a "handle" object
with the bdev object itself inside.
This adds detection for the new functions, and macros to handle the old
and new forms consistently.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #15805
Rob Norris [Mon, 22 Jan 2024 23:50:53 +0000 (10:50 +1100)]
Linux 6.8 compat: make test functions static
The kernel is now being compiled with -Wmissing-prototypes. Most of our
test stub functions had no prototype, and failed to compile. Since they
don't need to be visible anywhere else, just make them all static.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Sponsored-by: https://despairlabs.com/sponsor/
Closes #15805
Brian Behlendorf [Mon, 29 Jan 2024 19:35:43 +0000 (11:35 -0800)]
Linux 6.7 compat: META
Update the META file to reflect compatibility with the 6.7 kernel.
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #15833
John Baldwin [Mon, 29 Jan 2024 19:02:07 +0000 (11:02 -0800)]
bhyve: Use NVMEF macro to construct fields
Reviewed by: corvink, chuck (older version)
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43607
John Baldwin [Mon, 29 Jan 2024 19:01:46 +0000 (11:01 -0800)]
nvmecontrol: Use NVMEF macro to construct fields
Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43606
John Baldwin [Mon, 29 Jan 2024 19:01:13 +0000 (11:01 -0800)]
nvme: Use the NVMEF macro to construct fields
Reviewed by: chuck, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43605
John Baldwin [Mon, 29 Jan 2024 19:00:57 +0000 (11:00 -0800)]
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
John Baldwin [Mon, 29 Jan 2024 19:00:09 +0000 (11:00 -0800)]
bhyve: Use the NVMEM macro instead of expanded versions
Reviewed by: corvink, chuck
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D43603
John Baldwin [Mon, 29 Jan 2024 18:59:37 +0000 (10:59 -0800)]
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
John Baldwin [Mon, 29 Jan 2024 18:58:28 +0000 (10:58 -0800)]
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