Commit graph

20249 commits

Author SHA1 Message Date
Mike Karels 48514c5724 mountd: do not warn about using class mask with -mask
The previous code would warn that the mask was being defaulted to
an obsolete class mask even if -mask was present after -network.
Import a fix from Peter Much with a little tweaking, deferring the
warning until after all parameters are processed.

PR:		263011
Obtained from:	pmc at citilink.dinoex.sub.org
MFC after:	3 days
Reviewed by:	rmacklem
Differential Revision:	https://reviews.freebsd.org/D41774
2023-09-08 09:06:42 -05:00
Jamie Gritton 165234d552 jail.conf(5): Fix and expand description of ".include".
Escape a period that caused a line not to be includesd.  Also mention
that glob(3) patterns may be included, and a consequence of that.

PR:		273561
Reported by:	crest@rlwinm.de
Reviewed by:	emaste
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41723
2023-09-05 13:35:54 -07:00
Dmitry Chagin edd28b857e jail(8): Fix mandoc warnings
Reviewed by:		gbe
Differential Revision:	https://reviews.freebsd.org/D41680
MFC after:		1 week
2023-09-01 11:13:46 +03:00
Shawn Webb cb48780db4 jail: Add the ability to access system-level filesystem extended attributes
Prior to this commit privileged accounts in a jail could not access to the
filesystem extended attributes in the system namespace. To control access to
the system namespace in a per-jail basis add a new configuration parameter
allow.extattr which is off by default.

Reported by:		zirias
Tested by:		zirias
Obtained from:		HardenedBSD
Reviewed by:		kevans, jamie
Differential revision:	https://reviews.freebsd.org/D41643
MFC after:		1 week
Relnotes:		yes
2023-09-01 11:11:33 +03:00
Jamie Gritton db08e8ba0e Re-remove $FreeBSD$ inadvertantly put back into jail.8 2023-08-31 15:35:00 -07:00
Kristof Provost 6fbb9fbf7d snmp_pf: use libpfctl's pfctl_get_status() rather than DIOCGETSTATUS
Prefer libpfctl functions over direct access to the ioctl whenever
possible. This will allow subsequent removal of DIOCGETSTATUS (in 15) as
there already is an nvlist-based alternative.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D41650
2023-08-31 10:56:32 +02:00
Eugene Grosbein 872e894056 unbreak BEGEMOT-LM75-MIB.txt
The MIB has several bugs making it unusable. Fix it.

Reported-by:	Eugene M. Zheganin <eugene@zhegan.in>
MFC-after:	2 weeks
2023-08-31 09:47:57 +07:00
Dag-Erling Smørgrav 09c45b089d iostat: getopt() / usage() cleanup.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D41636
2023-08-29 17:23:23 +00:00
Jamie Gritton dab7fc49e7 jail: make jail(8) man page more readable and more correct
The synopsis section of jail(8) is fine at showing everything that could
be on the command line, but doesn't make much sense. Add some sub-
ections for the different uses of the command.

Also fix up the paragraph about command-line parameter specification,
including removing some clearly erroneous information.

Reviewed by:	dvl
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41606
2023-08-28 11:22:36 -07:00
Jake Freeland fcace2906d syslogd: Add some basic regression tests
Reviewed by:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41403
2023-08-23 12:17:40 -04:00
Jessica Clarke 968a3db715 kbdcontrol: Support building as a bootstrap tool on old and non-FreeBSD
Systems that predate 971bac5ace ("kbd: consolidate kb interfaces
(phase one)") cannot build kbdcontrol since kbdelays and kbrates moved
to sys/kbio.h. Moreover, on non-FreeBSD, it requires all kinds of ioctls
and sysctls that are highly FreeBSD-specific to build, but we use it as
a bootstrap tool to generate the keymaps used by some kernels (LINT ones
in particular). Thus, when bootstrapping kbdcontrol, disable everything
that's not needed for that singular use, and use the in-tree kbio.h to
get the definitions of the necessary structures.

This allows KBDMUX_DFLT_KEYMAP, UKBD_DFLT_KEYMAP and ATKBD_DFLT_KEYMAP
to be enabled when building on non-FreeBSD, and thus LINT kernels.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D41541
2023-08-22 21:00:28 +01:00
Corvin Köhne 6f7e9779fc
bhyve: add config option to load ACPI tables into memory
For backward compatibility, the ACPI tables are loaded into the guest
memory. Windows scans the memory, finds the ACPI tables and uses them.
It ignores the ACPI tables provided by the UEFI. We are patching the
ACPI tables in the guest memory, so that's mostly fine. However, Windows
will break when the ACPI tables become to large or when we add entries
which can't be patched by bhyve. One example of an unpatchable entry, is
a TPM log. The TPM log has to be allocated by the guest firmware. As the
address of the TPM log is unpredictable, bhyve can't assign it in the
memory version of the ACPI tables. Additionally, this makes it
impossible for bhyve to calculate a correct checksum of the table.

By default ACPI tables are still loaded into guest memory for backward
compatibility. The new acpi_tables_in_memory config value can be set to
false to avoid this behaviour.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39979
2023-08-22 07:49:00 +02:00
Dag-Erling Smørgrav 2ba1d4970a unbound: Move config.h to lib directory.
It was originally in contrib, and moved to usr.sbin in 6692aa840c1f; I always thought lib would make more sense but never got around to moving it.

Reviewed by:	cy
Differential Revision:	https://reviews.freebsd.org/D41504
2023-08-19 01:44:58 +00:00
Bjoern A. Zeeb 214e3e09b3 fwget: fix installing multiple firmware files
Remove quotes around the list of packages to install.
Otherwise pkg is only fed one argument which results in a
non-working solution:
pkg: No packages available to install matching 'wifi-firmware-ath10k-kmod wifi-firmware-mt76-kmod wifi-firmware-ath11k-kmod' have been found in the repositories

MFC after:	10 days
Reviewed by:	manu
Differential Revision: https://reviews.freebsd.org/D41474
2023-08-18 01:22:22 +00:00
Ed Maste d1eb515f14 bhyve: default UART to 115200
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D41494
2023-08-17 14:53:23 -04:00
John Baldwin 18974bd616 bhyve: Store the FreeBSD OUI in little-endian in the controller data
Section 7.10.3 of the NVME 1.4b specification states that the IEEE OUI
in the identify controller structure is stored in little-endian format
(unlike the embedded OUI in EUI64 identifiers).

Reviewed by:	corvink, chuck, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D41487
2023-08-17 11:32:32 -07:00
Dag-Erling Smørgrav e738085b94 Remove my middle name. 2023-08-17 15:08:30 +02:00
Corvin Köhne 67c26eb2a5
bhyve: add cmdline option for TPM emulation
At the moment, only a TPM passthru is supported. The cmdline looks like:

-l tpm,passthru,/dev/tpm0

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D32961
2023-08-17 08:17:59 +02:00
Ed Maste 90aad5d3e4 makefs: clean up some leftovers after $FreeBSD$ tag removal
Fixes: 2a63c3be15
2023-08-16 16:24:37 -04:00
Warner Losh 9524e274b5 Remove $FreeBSD$: one-line xdr pattern
Remove /^\s*%\s*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:55:47 -06:00
Warner Losh 9636a14538 Remove $FreeBSD$: two-line lua tag
Remove /^--\n--\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:30 -06:00
Warner Losh 05248206f7 Remove $FreeBSD$: one-line bare tag
Remove /^\s*\$FreeBSD\$$\n/
2023-08-16 11:55:20 -06:00
Warner Losh b2c76c41be Remove $FreeBSD$: one-line nroff pattern
Remove /^\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:15 -06:00
Warner Losh fa9896e082 Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:10 -06:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh c857356409 Remove $FreeBSD$: alt one-line .c pattern
Remove /^\s*__RCSID\("\$FreeBSD\$"\);\n/
2023-08-16 11:54:53 -06:00
Warner Losh da5432eda8 Remove $FreeBSD$: alt two-line .c pattern
Remove /^\s*__RCSID\("\$FreeBSD\$"\);\n\n/
2023-08-16 11:54:48 -06:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh 2a63c3be15 Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-08-16 11:54:29 -06:00
Warner Losh 42b388439b Remove $FreeBSD$: one-line .h pattern
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
2023-08-16 11:54:23 -06:00
Warner Losh b3e7694832 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:16 -06:00
Corvin Köhne 85a775e61b
bhyve: add Qemu PPI emulation for TPM devices
Windows requires a physical presence interface to recognize the TPM
device. Qemu's OVMF has an implementation for the PPI which can be
reused. Using the Qemu PPI makes it very easy because we don't have to
implement new PPI functionality into our OVMF. The Qemu implementation
is already there.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40462
2023-08-14 10:17:36 +02:00
Rick Macklem 2409231121 mountd: Fix type of signal variable
Without this patch got_sighup(), which is the SIGHUP handler,
would set a variable of type int.

This would appear to be incorrect, although it has worked reliably.
This patch changes the type to "_Atomic(int)", which appears
to be all that is needed to correct it.

Reported by:	pen@lysator.lui.se
Reviewed by:	theraven, karels (prev version), kevans (prev version)
Differential Revision:	https://reviews.freebsd.org/D41265
2023-08-10 12:50:35 -07:00
Corvin Köhne 29200a8133
bhyve: emulate TPM passthru by accessing /dev/tpmX
To send commands to the TPM device, bhyve can use the host TPM driver by
reading and writing from /dev/tpmX. Using this approach, only the host
TPM driver has to detect and interact with the physical TPM interface.
This simplifies bhyve's code much. As the host TPM driver has to
interact with the TPM regardless of bhyve making use of it or not, makes
it a good approach.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40460
2023-08-10 09:23:42 +02:00
Corvin Köhne 28dc1aa733
bhyve: add emulation for CRB register of TPM devices
Trap accesses to the CRB MMIO range and emulate them properly.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40459
2023-08-10 09:23:33 +02:00
Marius Strobl 9ec7a595ed mergemaster(8): Remove support for sparc64 2023-08-06 22:28:46 +02:00
Doug Rabson 1d7ffb373c pkgbase: reorganise caroot and openssl packages
This splits out the certctl utility into a new certctl package and the
openssl libs into an openssl-lib package.

PR:		272816
Reviewed by:	manu
Differential Revision: https://reviews.freebsd.org/D41321
2023-08-05 09:30:35 +01:00
Gordon Bergling 85dab3fe7a i2c.8: Fix a typo in the manual page
- s/endianess/endianness/

MFC after:	5 days
2023-08-04 13:50:48 +02:00
John Baldwin bed3ae1d78 bhyve: Fully reset the fwctl state machine if the guest requests a reset.
If a guest tries to reset the fwctl device while a pending request was
in flight, the fwctl state machine can be left in an incomplete state.
Specifically, rinfo is not cleared.

Normally the state machine for fwctl alternates between REQ (receiving
request) and RESP (sending response) and ignores port writes while in
RESP or port reads while in REQ.  Once a guest completes the writes to
the port to send a request, the state machine transitions to RESP and
ignores future writes.

However, if a guest writes a full request and then resets the fwctl
device, the state would transition to REQ without draining the pending
response or discarding the received request.  Instead, additional
port writes after the reset were treated as new payload bytes, but
were appended to the previously-received request and could overflow
the fget_str buffer.

To fix, fully reset the fwctl state machine if the guest requests a
reset.

admbugs:	998
Approved by:	so
Reviewed by:	markj
Reported by:	Omri Ben Bassat <t-benbassato@microsoft.com>
Security:	FreeBSD-SA-23:07.bhyve
Security:	CVE-2023-3494
2023-08-01 15:45:41 -04:00
Jessica Clarke 309ec6ab28 etcupdate: Remove redundant semicolons
Fixes:	03e62670c3 ("etcupdate: Consolidate nobuild cases and make more robust")
2023-07-27 07:55:13 +01:00
Jessica Clarke 246364454f etcupdate: Use new buildetc and installetc targets when available
These new targets avoid the need to invoke internal build system targets
or set internal variables when building, and also have the added benefit
of working with BUILD_WITH_STRICT_TMPPATH. Old source trees lacking such
targets will not work with BUILD_WITH_STRICT_TMPPATH; they could be made
to work by copying the steps, but it's not worth doing so, as they never
have worked in the past. The primary goal of this is to support changing
the default of BUILD_WITH_STRICT_TMPPATH to enabled.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D41206
2023-07-27 05:10:49 +01:00
Jessica Clarke 03e62670c3 etcupdate: Consolidate nobuild cases and make more robust
The distrib-dirs and distribution steps are shared between the two, the
only difference is whether MAKEOBJDIRPREFIX is in the environment for
the latter. Having in the environment for the former is currently not
needed but does no harm and will be needed in future, so we can just
export it up-front in the subshell. When we do distrib-dirs relative to
_obj and everything also doesn't matter, so move it next to distribution
where it makes more sense. Finally, to avoid complicated && chains, use
"|| exit 1" everywhere to make the subshell fail, and add an extra one
on to the cd $SRCDIR to handle that failing (otherwise we'd go on and
try to build the current directory after cd prints its error, which is
unhelpful).

These changes will make it easier to bundle these steps up into new
top-level targets to allow the build system to manage the steps rather
than etcupdate, which will also handle BUILD_WITH_STRICT_TMPPATH, which
currently does not work with etcupdate.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D41204
2023-07-27 05:10:48 +01:00
Marius Strobl 4ef1c6f75d base: Remove support for the VTOC8 partitioning scheme
The removal of the sparc64 support in February 2020 obsoleted the
VTOC8 partitioning scheme as no other FreeBSD platform makes use
of it. Moreover, the code is bitrotting as nothing defines e. g.
LOADER_VTOC8_SUPPORT any more and, thus, should go now, too. With
this change, the following commits are reverted as far as VTOC8
is concerned and parts haven't already previously been deleted
along with prior sparc64 removals:
094fcb157d
a7d366e958
ba8d50d08b

The alignment example d9711c28ef
added to the VTOC8 section of gpart.8 is folded into the MBR one.

This should finally conclude the deorbit of sparc64-specific bits.

        We had joy, we had fun
        we ran Unix on a Sun.
        But that source and the song
        of FreeBSD have all gone.

Credits to Michael Bueker for the original "Unix on a Sun" and Rod
McKuen for the "Seasons in the Sun" lyrics.
2023-07-26 13:16:12 +02:00
Yuri Pankov bb255cee93 tzsetup: fix "misleading indentation" warning with -DVERBOSE 2023-07-26 12:33:42 +02:00
Vitaliy Gusev 65f8467e33
bhyvectl: Add '--get-debug-cpus' command
vmm and libvmmapi already have handlers for that. When adding debug
cpus, they were only used for the debug stub. Over time, they were
reused by other parts like snapshots or idle APs.

Reviewed by:		corvink, jhb
MFC after:		1 week
Sponsored by:		vStack
Differential Revision:	https://reviews.freebsd.org/D40804
2023-07-25 14:03:54 +02:00
Corvin Köhne f0124ab111
bhyve: do not hold CRB mutex when executing TPM commands
TPM commands can take up to several seconds to execute. If we hold the
CRB mutex while executing the command, MMIO accesses could be blocked
for a long time. Therefore, just copy all required values and work on
the copied values.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40724
2023-07-25 08:50:23 +02:00
Ed Maste e0a63d875e pciconf: add PCIe 5.0 and PCIe 6.0 link speeds
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40710
2023-07-20 13:39:17 -04:00
Naman Sood 181692ab08
pw: Add regression tests for useradd bug fixes
PR:		238995
Reviewed by:	jrm
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41080
2023-07-19 10:43:12 -03:00
Naman Sood 1a8d37b8cf
pw: Use existing group entry, even if it already has members
Fix the following problem:

1. A nonexistent user, someuser, is added to /etc/group as
   someuser:*:12345:someuser.
2. someuser is then created with the default login group.

A second group entry for someuser will be created.

   someuser:*:12345:someuser
   someuser:*:12346:

With this fix, the existing group entry will be used.

PR:		238995
Reviewed by:	bapt, jrm
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41057
2023-07-19 10:40:53 -03:00
Naman Sood 17839f45d8
pw: Ensure group membership is not duplicated
Fix the following problem:

1. A nonexistent user, someuser, is added to somegroup in /etc/group.
2. someuser is then created with membership in somegroup.

The entry for somegroup in /etc/group will then contain

    somegroup:*:12345:someuser,someuser

With this fix, the entry will be

    somegroup:*:12345:someuser

PR:		238995
Reviewed by:	bapt, jrm
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41076
2023-07-19 10:36:09 -03:00