This should have been done with commit d9fe718287 but was missed.
Fixes: d9fe718287 ("makefs: Remove the warning printed when makefs -t zfs is used")
MFC after: 3 days
vnet.interface and zfs.dataset can be used to specify multiple
interfaces/datasets in jail.conf, but not on the command-line, which is
a bit surprising. Extend the handling of ip(4|6).addr to those
parameters, update the description of vnet.interface in jail.8, and add
a rudimentary regression test.
Reviewed by: zlei, jamie
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D47651
This is somewhaht hard to test reliably, but we'll give it a shot. Startup
a sleep(1) daemon with a hefty restart delay. In refactoring of daemon(8),
we inadvertently started dropping SIGTERMs that came in while we were
waiting to restart the child, so we employ the strategy:
- Pop the child sleep(1) first
- Wait for sleep(1) to exit (pid file truncated)
- Pop the daemon(8) with a SIGTERM
- Wait for daemon(8) to exit
The pidfile is specifically truncated outside of the event loop so that we
don't have a kqueue to catch it in the current model.
PR: 277959
Reviewed by: des, markj
Differential Revision: https://reviews.freebsd.org/D47005
We populate the kqueue with all of four kevents: three signal handlers and
one for read of the child pipe. Every time we start the child, we rebuild
this kqueue from scratch for the child and tear it down before we exit and
check if we need to restart the child. As a consequence, we effectively
drop any of the signals we're interested in between restarts.
Push the kqueue out into the daemon state to avoid losing any signal events
in the process, and reimplement the restart timer in terms of kqueue timers.
The pipe read event will be automatically deleted upon last close, which
leaves us with only the signal events that really get retained between
restarts of the child.
PR: 277959
Reviewed by: des, markj
Differential Revision: https://reviews.freebsd.org/D47004
We need to be able to test some more restart behavior that depends on
knowing specifically where we're at (inside the event loop or outside of
the event loop). Truncate the pidfile until the process is restarted to
give the test a clean marker rather than having to add arbitrary delays
and hoping for the best.
Reviewed by: des, markj
Differential Revision: https://reviews.freebsd.org/D47003
Fix a typo that was missed probably because it was capitalized.
Mark up with .Pa and fix capitalization.
Specify that cuaUX and cuauX are for USB and UART attachments
respectively.
- Silence most lint warnings
- Update outdated links
- Minor style fixes
- Some igor(1) warnings were ignored on purpose
PR: 248359
Reviewed by: imp, mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Approved by: emaste (mentor)
Fixes: 839f11a4fe ("A number of places in the source tree still reference cuad.* after sio(4) was deprecated by uart(4).")
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1515
Make sure an interface is back up before (re-)starting wpa_supplicant
in wlanconfig not relying on wpa to UP the interface (though we fixed
that).
Sponsored by: The FreeBSD Foundation
Reviewed by: emaste (in D47491)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D47491
During installation bsdinstall asks (via tzsetup):
> Is this machine's CMOS clock set to UTC? If it is set to local time,
> or you don't know, please choose NO here!
Most operating systems, except for Windows, use UTC in the hardware
real-time clock by default. This question from tzsetup is presumably
intended to aid in dual-boot-with-Windows configurations, but these
represent a fraction of all FreeBSD installs.
Rather than asking this question on every install just default to UTC.
Users who want to dual-boot Windows can create /etc/wall_cmos_clock.
We can look at making this smarter in the future.
Reviewed by: bapt, brooks, brd, cy, 0mp, ngie
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45569
The downstream (FreeBSD) ntp man pages are out of date. Switch to those
provided by ntp.org (nwtime.org).
PR: 104493
Differential Revision: https://reviews.freebsd.org/D47319
Introduce -q to quieten other output (unless -v is also given).
pkg-install(8) currently has no option to allow skipping unavail
packages but it will just fail.
We would realy want to try to install as much firmware found as
possible from the installer.
Work around this by doing one firmware package at a time.
For that it is highly helpful to be able to query (or possibly re-query)
all outstanding fimrware packages.
-q together with -n only shows each package to be installed one by line.
Once https://github.com/freebsd/pkg/issues/2195 will be implemented
we could undo this part of the change and future changes to the installer
and use the new option for pkg-install(8) there.
While here switch to getopts so -qn works and not just -q -n.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D47445
Firmware files are available in the comms/rtlbt-firmware port.
Sponsored by: Future Crew LLC
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D46739
If Intel firmware is already in operational mode at boot that takes
place at warm boot, BT adaptor can generate extra HCI events which
interferes with firmware mode detection logic. Ignore them.
Sponsored by: Future Crew LLC
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D46737
Required firmware files are already included in to comms/iwmbt-firmware port
Sponsored by: Future Crew LLC
MFC after: 1 month
Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D46735
When bind() is called, the process umask is applied, so one has to
either clear the umask before binding or call chmod() to add permissions
after the fact. Do the former here to ensure that the socket always has
the correct mode.
Reported by: Lexi Winter <lexi@le-fay.org>
Fixes: 2b8c3a05e0 ("syslogd: Set unix socket modes atomically")
This does not change the rendered ascii at all.
Signed-off-by: Graham Percival <gperciva@tarsnap.com>
Reviewed by: mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
MFC after: 3 days
Sponsored by: Tarsnap Backup Inc.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1473
The -n flag specifies that user and group IDs should remain numeric, not
be mapped to names. The golden output for praudit -n, however,
contained user and group names.
Reported by: markj
Reviewed by: markj
Fixes: ba10bfe509 ("libbsm: honour AU_OFLAG_NORESOLVE")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47434
The previous version used a case-insensitive match (default for -x).
The presence of packages like freebsd-git-devtools and freebsd-ftpd
would falsely trigger the packaged base check.
Instead, just use `pkg which /usr/bin/uname` as a packaged base
indication. pkg uses /usr/bin/uname to determine ABI, so we can rely on
it existing. If it comes from a package then packaged base is in use.
Also, extend the check to all freebsd-update commands. It is easier to
just disallow all commands, and easier to test.
Reported by: Mark Millard
Reviewed by: manu
Fixes: cf1aba2857 ("freebsd-update: refuse to operate on a pkgbase system")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47378
Do the `1193182 / pitch` hack only for sc(4).
PR: 281713
Reported by: Rudolf Polzer
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46803
Add machine-dependent parts for bhyve hypervisor to support
virtualization on RISC-V ISA.
No objection: markj
Sponsored by: UK Research and Innovation
Differential Revision: https://reviews.freebsd.org/D45512
FreeBSD-update is not compatible with packaged base.
PR: 282252
Reviewed by: bapt, markj (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47341
This was lost during the conversion to netlink.
Reviewed by: kp
Fixes: 91fbe0819b ndp: convert ndp(8) to netlink
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D47234
An upcoming fix for the netlink based implementation requires this
refactoring.
No functional change intended.
Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D47233
These were reported by `mandoc -T lint ...` as warnings.
Signed-off-by: Graham Percival <gperciva@tarsnap.com>
Reviewed by: mhorne
MFC after: 3 days
Sponsored by: Tarsnap Backup Inc.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1475
In the hammer2 label reader, make sure to check for a NULL return from
read_buf().
In the NTFS label reader,
- Avoid an infinite loop if a record length is 0.
- Avoid walking past the end of the buffer.
- When a label is found, avoid reading past the end of the buffer.
PR: 278281
Reviewed by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D47292
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).
Sponsored by: The FreeBSD Foundation
MFC after: 14 days
The previous fix for a stack buffer leak in the ahci device model
actually broke the handling of TRIM as one of the checks it added
caused TRIM commands to never be completed. This resulted in command
timeouts if a guest OS did a 'newfs -E' of an AHCI disk, for example.
Also, for the invalid case the previous check was handling, the device
model should be failing with an error rather than claiming success.
To resolve this, validate the length of a TRIM request and fail with
an error if it exceeds the maximum number of supported blocks
advertised via IDENTIFY. In addition, if the PRDT does not provide
enough data, fail the command with an error rather than performing a
partial completion.
This is somewhat complicated by the implementation of TRIM in the ahci
device model. A single TRIM request can specify multiple LBA ranges.
The device model handles this by dispatching blockif_delete() requests
one at a time. When a blockif_delete() request completes, the device
model locates the TRIM buffer and searches for the next LBA range to
handle. Previously, the device model would re-read the trim buffer
from guest memory each time. However, this was subject to some
unpleasant races if the guest changed the PRDT entries or CFIS while a
command was in flight. Instead, read the buffer of trim ranges once
and cache it across multipe internal blockif requests.
Reviewed by: mav
Fixes: 71fa171c64 bhyve: Initialize stack buffer in pci_ahci
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47224
After a strsep() call, p might not point at the original allocation
anymore.
Reported by: CHERI
Reviewed by: christos
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D47266
EDKII can allocate adjacent E820 entries only if they are at a page
boundary. For some unknown and probably strange reasons, Intel puts
it's OpRegion at an offset of 0x18 bytes. If the VBT lays directly
behind the OpRegion, we're going to try allocating two adjacent E820
sharing the same page. This causes EDKII to do not properly allocate
those entries. A Linux guest then isn't able to map the VBT and those
fails to find it.
Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D45336
Implement a TPM 2.0 emulation backend to connect to a running swtpm
instance using a UNIX domain socket.
Reviewed by: corvink
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D46373
The TPM spec (TPM Library, Part3: Commands, Section 5.2: Command Header
Validation) requires that no more bytes are written than the size of the
commands, as given in the request header. Thus the TPM CRB interface
needs to get the command size from the request header and pass that to
the emulation backend.
As the guest OS driver can set the address and size of the command and
response buffers freely within the limits of the provided CRB data
buffer, bhyve should verify that the values set in the corresponding
registers make sense before processing a command.
Reviewed by: corvink
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D46564
FreeBSD's own TPM driver writes 0 to the INT_ENABLE register during
attach, making sure interrupts are off. bhyve really shouldn't kill the
VM when that happens just because it doesn't support TPM interrupts.
Even if a guest was trying to enable interrupts, we should just ignore
it like real TPM hardware would.
Reviewed by: corvink
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D46562
The libkldelf library was originally a part of kldxref(8). It exposed
ELF parsing helpers specialized in parsing KLDs and the kernel
executable. The library can be used to read metadata such as linker_set,
mod_depend, mod_version and PNP match info, and raw data from the ELF.
To promote the reuse of the facilities the ELF parsing code is separated
from kldxref(8) into a new private library.
For now, libkldelf's source files will be compiled into kldxref(8)
directly if kldxref is built during bootstrapping phase. The reason is
linking kldxref(8) against the libkldelf static library has an unwanted
side effect which renders the linker sets inside the libkldelf
implementation empty if the static library is not build by ld -r all the
.o files into a single .o before producing the static library.
Sponsored by: Juniper Networks, Inc.
Reviewed by: markj
Suggested by: jrtc27, markj
Differential Revision: https://reviews.freebsd.org/D46719
The description is listed in angle brackets after the device name
similar to device probe messages.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47157
This is a follow-up to the fix for HYP-19, addressing another condition
where an overflow might still occur. (Spotted by jhb@, thanks!)
Reported by: Synacktiv
Reviewed by: markj
Security: HYP-19
Sponsored by: Alpha-Omega Project
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46882
These were reported by `mandoc -T lint ...` as errors.
The rendered output (in ascii and html) is not affected by this commit.
Signed-off-by: Graham Percival <gperciva@tarsnap.com>
Reviewed by: mhorne
MFC after: 3 days
Sponsored by: Tarsnap Backup Inc.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1459
These were reported by `mandoc -T lint ...` as warnings:
- unusual Xr order
- unusual Xr punctuation
Fixes made by script in https://github.com/Tarsnap/freebsd-doc-scripts
Signed-off-by: Graham Percival <gperciva@tarsnap.com>
Reviewed by: mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Sponsored by: Tarsnap Backup Inc.
Pull Request: https://github.com/freebsd/freebsd-src/pull/1464
When an exception class is unhandled by the kernel we handle it in
userspace by exiting the process. Rather than exiting raise an unknown
reason exception in the guest. The guest can then handle the exception
as it wishes.
Reviewed by: markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D46511