Commit graph

20726 commits

Author SHA1 Message Date
Renato Botelho 55d2990548 bsdinstall: Fix wifi network selection size
Use correct variable while creating dialog used to select among
available wireless networks

Approved by:	asiciliano
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D45271
2024-05-20 13:39:29 -03:00
Mike Karels 0b39b2e2dd adduser: create dataset only if home is directly within dataset
Currently, if the prefix of the new home directory is a subdirectory
of a ZFS dataset, adduser will create a new dataset up one or more
levels from the intended destination.  "pw useradd" will then create
a normal directory in the desired location, leaving an unused dataset.
Check for this situation when determining whether to create a dataset,
and let pw create the directory.

Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D45229
MFC after:	3 days
2024-05-20 08:43:34 -05:00
Konstantin Belousov 6cba29c09a acpidump IVRS table format: change 'IOMMUId' into 'IOMMU DeviceId'
and apply the consistent format for device ids used in other IVRS
elements.  The field seems to be the PCI Device ID of the IOMMU itself,
instead of an abstract unit ID.

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-05-20 02:04:45 +03:00
Pierre Pronchery f7d45c5443 bhyve: avoid side effect in assertion
An assert() was setting the error variable instead of checking it.

Reported by:	Coverity Scan
CID:		1521431
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1244
2024-05-17 15:45:18 -04:00
Pierre Pronchery e9806d2128 bhyve: avoid resource leak in error path
In e820_finalize(), the e820_fwcfg_item variable, containing the
etc/e820 file (for the e820 table from the BIOS) is not free()'d when it
could not be added to the QEMU firmware configuration device (fw_cfg).

Reported by:	Coverity Scan
CID:		1522761
Reviewed by:	corvink, jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45223
2024-05-17 12:26:27 -04:00
Pierre Pronchery f38117359a ctladm: fix resource leak
The str variable in cctl_nvlist_end_element() does not get free()'d when
converted to an integer value. (name is "trtype")

Reported by:	Coverity Scan
Coverity ID:	1545039
Sponsored by:	The FreeBSD Foundation

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1237
2024-05-16 11:22:48 -06:00
Pierre Pronchery 1787871a66 bhyve: avoid resource leak
In bhyve_parse_config_option(), a string is allocated and passed to
nvlist_add_string() but not free'd afterwards.

Reported by:	Coverity
CID:		1544049
Sponsored by:	The FreeBSD Foundation

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1234
2024-05-16 11:19:33 -06:00
Alexander Ziaee 1a720cbec5 man filesystems: fix xrefs after move to section 4
Reviewed by: des, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1077
2024-05-16 10:25:29 -06:00
Dag-Erling Smørgrav 46a619c6d4 adduser: Additional variable fixes.
One function used `_input` without making it local, causing its value to
leak into other functions.  This broke the `-f` case.  Fix that instance
and initialize all local variables that weren't already initialized.

Fixes:		170d088290
MFC after:	3 days
Reviewed by:	karels
Differential Revision:	https://reviews.freebsd.org/D45204
2024-05-15 14:13:49 +02:00
Fernando Apesteguía 47535ba3d3 bsdinstall: Remove unused variables in fetchmissingdists
ALL_DISTRIBUTIONS and VERIFY_MANIFEST_SIG

They are neither used in the script nor exported.
Not referenced anywhere in bsdinstall/*

Approved by:		imp@
Differential Revision:	https://reviews.freebsd.org/D42369
2024-05-12 19:25:06 +02:00
Dag-Erling Smørgrav 44e72c6e2e Add man page for nfslockd.
PR:		130238
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D45139
2024-05-10 11:23:13 +02:00
Paweł Krawczyk 042267e0cd Explain cron.d
Add details on the format of system cron files, which are mentioned in
cron(8) which refers here but barely explained here.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1106
2024-05-09 22:34:36 -06:00
Lexi Winter cd917a17bc arp.8: don't document a syntax that doesn't exist
The arp.8 manpage documents 'arp -d <addr> pub', but the 'pub' flag is
not accepted by the arp command.  Remove this incorrect documentation.

Reviewed by: imp, gleb, mp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1215
2024-05-09 17:26:52 -06:00
Kristof Provost f1612e7087 libpfctl: fix file descriptor leak
pfctl_get_rules_info() opened a netlink socket, but failed to close it again.
Fix this by factoring out the netlink-based function into a _h variant that
takes struct pfctl_handle, and implement pfctl_get_rules_info() based on that,
remembering to close the fd.

While here migrate all in-tree consumers to the _h variant.

MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-05-09 14:07:07 +02:00
Mark Johnston 5d62025d82 bhyve: Do not define GDB_LOG
This had been added for debugging and shouldn't have been committed.

Fixes:		f81cdf24ba ("bhyve: Add support for XML register definitions")
MFC after:	3 days
2024-05-08 12:11:09 -04:00
Mark Johnston ffbaa453c1 bsdinstall: Stop loading cryptodev for ZFS installations
- zfs depends on the crypto module, not cryptodev, and most arm64 kernel
  configs include std.dev, which includes "device crypto" anyway.
- This config works around a problem with kldxref lacking cross-target
  support, but that has since been fixed.
- Loading cryptodev creates /dev/crypto, which gives unprivileged users
  access to the kernel's opencrypto framework.  Very few applications
  need it, so we're needlessly increasing the kernel's surface area.

Thus, stop auto-loading cryptodev.

Reviewed by:	kevans, allanjude, des
Differential Revision:	https://reviews.freebsd.org/D45127
2024-05-08 12:01:52 -04:00
Dag-Erling Smørgrav e12b7446bd pw: Test home directory ownership and mode.
MFC after:	3 days
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D45099
2024-05-06 18:18:50 +02:00
Dag-Erling Smørgrav 46c4e86ebf adduser: Fix confusion between uclass and _class.
This caused adduser to produce an invalid `pw(8)` command line.  Due to
bugs in `pw(8)`, the command line was silently accepted and led to the
user being created, but locked out and with no home directory.

Also fix the default value for the “Another user?” prompt.

Fixes:		170d088290
MFC after:	3 days
Reviewed by:	karels, allanjude
Differential Revision:	https://reviews.freebsd.org/D45098
2024-05-06 18:18:47 +02:00
Dag-Erling Smørgrav c86119328e pw: Don't silently ignore unparsed command line arguments.
MFC after:	3 days
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D45097
2024-05-06 18:18:43 +02:00
Dag-Erling Smørgrav a9ea647c29 pw: Rename some enums.
Rename `M_PRINT` and `M_UPDATE` to `M_SHOW` and `M_MODIFY` to match the
names of the commands they represent.  No functional change intended.

MFC after:	3 days
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D45096
2024-05-06 18:18:39 +02:00
Lexi Winter 0ad9b235e1 arp(8): fix a typo in error message for -s/-S
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1214
2024-05-04 09:02:42 -06:00
Lexi Winter 2f9966ff63 packages: add package for NTP
Reviewed by: imp, manu
Pull Request: https://github.com/freebsd/freebsd-src/pull/1193
2024-05-04 07:41:54 -06:00
Michael Osipov aa48259f33 periodic.conf: remove long deprecated security_daily_compat_var()
This function is documented to be gone in after 11. Time to remove this
compat shim.

PR:		275296
Reviewed by:	jrm (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D44796
2024-05-03 09:38:55 +02:00
John Baldwin a8089ea5ae nvmfd: A simple userspace daemon for the NVMe over Fabrics controller
This daemon can operate as a purely userspace controller exporting one
or more simulated RAM disks or local block devices as NVMe namespaces
to a remote host.  In this case the daemon provides a discovery
controller with a single entry for an I/O controller.

nvmfd can also offload I/O controller queue pairs to the nvmft.ko
in-kernel Fabrics controller when -K is passed.  In this mode, nvmfd
still accepts connections and performs initial transport-specific
negotitation in userland.  The daemon still provides a userspace-only
discovery controller with a single entry for an I/O controller.
However, queue pairs for the I/O controller are handed off to the CTL
NVMF frontend.

Eventually ctld(8) should be refactored to to provide an abstraction
for the frontend protocol and the discovery and the kernel mode of
this daemon should be merged into ctld(8).  At that point this daemon
can be moved to tools/tools/nvmf as a debugging tool (mostly as sample
code for a userspace controller using libnvmf).

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44731
2024-05-02 16:38:39 -07:00
John Baldwin 17c907dd7a ctladm: Add nvterminate command to drop active NVMeoF associations
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44729
2024-05-02 16:38:39 -07:00
John Baldwin 4f9fa31c5c ctladm: Add nvlist command to list active NVMeoF associations
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44728
2024-05-02 16:38:39 -07:00
John Baldwin 5fd68977a5 ctladm: Permit creating nvmf ports
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44727
2024-05-02 16:38:30 -07:00
John Baldwin 6f308bcf57 ctl: Support NVMe requests in debug trace functions
Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44719
2024-05-02 16:31:34 -07:00
John Baldwin 352cf4a64a ctl: Avoid an upcast for calling ctl_scsi_path_string
Change the first argument of ctl_scsi_path_string to be the embedded
header structure instead of the union.  Currently union ctl_io and
struct ctl_scsiio have the same alignment, but this changes on i386 if
a new union member is added that contains a uint64_t member (such as
an embedded struct nvme_command for NVMeoF).  In that case, union
ctl_io requires stronger alignment, so the upcast from struct
ctl_scsiio to union ctl_io in ctl_scsi_sense_sbuf raises an increasing
alignment warning on i386.

Avoid the warning by passing struct ctl_io_hdr as the first argument
to ctl_scsi_path_string instead.

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D44716
2024-05-02 16:30:20 -07:00
John Baldwin afd0c206a6 ctladm: Use nitems() in a few more places
Sponsored by:	Chelsio Communications

Differential Revision:	https://reviews.freebsd.org/D45017
2024-05-02 09:55:15 -07:00
SHENG-YI HONG e10b9d6602 bhyve: Move lock of uart frontend to uart backend
Currently, lock of uart in bhyve is placed in frontend. There are some
problems about it:

1. If every frontend should has a lock, why not move it inside backend
   as they all have same uart_softc.
2. If backend needs to modify the information of uart after initialize,
   it will be impossible as backend cannot use lock. For example, if we
   want implement a telnet support for uart in backend, It should wait
   for connection when initialize. After some remote process connect it,
   it needs to modify rfd and wfd in backend.

So I decide to move it to backend.

Reviewed by:	corvink, jhb, markj
Differential Revision:	https://reviews.freebsd.org/D44947
2024-05-01 11:09:31 -04:00
Mark Johnston c1b37d909e bhyvectl: Add arm64 bits and hook it up to the build
For now this implementation doesn't provide any machine dependent
functionality on arm64, but it's enough to be able to reset and destroy
VMs.

Reviewed by:	jhb
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D44932
2024-05-01 08:33:23 -04:00
Mark Johnston 1c4ee7dfb8 bhyvectl: Prepare to add arm64 support
Move MD code into a separate directory and add a simple interface which
lets the MD bits register options and handle them.

No functional change intended.

Reviewed by:	jhb
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D44932
2024-05-01 08:31:00 -04:00
Olivier Certner 9b30b96c1f
Remove remnants of portsnap(8)
This was prompted by noticing that '/var/db/portsnap' still exists on
newly-installed machines.

With this change, all mentions of portsnap(8) in the tree are gone,
except for the historical note in the AUTHORS section of manpage
phttpget(8).

locate(1) will thus start indexing again '/var/db/portsnap' on machines
where this directory still exists, which may be a good way to push
administrators to delete it.

Reviewed by:            cperciva
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D45023
2024-04-30 22:44:34 +09:00
Kristof Provost 5824df8d99 pf: convert DIOCGETSTATUS to netlink
Introduce pfctl_get_status_h() because we need the pfctl_handle. In this variant
use netlink to obtain the information.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-04-29 16:32:23 +02:00
Mark Johnston 390e44988a bhyve: Fix handling of -r
Just make "restore_file" a global variable so that it can be set by the
MD option handler.

Reviewed by:	corvink
Reported by:	bdrewery
Fixes:		981f9f7495 ("bhyve: Push option parsing down into bhyverun_machdep.c")
Differential Revision:	https://reviews.freebsd.org/D44974
2024-04-29 10:13:50 -04:00
Dag-Erling Smørgrav 9e8618276f adduser: Really fix a syntax error
Fixes:		5cafc38f11
Differential Revision:	https://reviews.freebsd.org/D44871
2024-04-29 12:29:35 +02:00
Lexi Winter 1b3c07bed6 package: move OpenBSM auditing into its own package
Move auditing runtime (auditd, etc.) into the new FreeBSD-audit package.
Also move the runtime OpenBSM manual pages from libbsm into auditd so
they get installed with the right package.

Add an UPDATING entry noting the new packages.

Reviewed by: imp, manu
Pull Request: https://github.com/freebsd/freebsd-src/pull/1197
2024-04-28 22:33:06 -06:00
Lexi Winter 0c0a2110f1 package: move authpf into the FreeBSD-pf package
Reviewed by: imp, manu
Pull Request: https://github.com/freebsd/freebsd-src/pull/1198
2024-04-28 22:33:02 -06:00
Elyes Haouas b561d8f59c zonectl: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2024-04-28 21:30:55 -06:00
Elyes Haouas cbfd42cc07 wlandebug: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2024-04-28 21:30:55 -06:00
Elyes Haouas abab59f662 usbconfig: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2024-04-28 21:30:55 -06:00
Elyes Haouas 4c6e656e2e rwhod: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2024-04-28 21:30:55 -06:00
Elyes Haouas f93475cf0f pstat: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2024-04-28 21:30:55 -06:00
Elyes Haouas 67db7b43d0 ppp: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2024-04-28 21:30:55 -06:00
Elyes Haouas bccbb2fc4b ndp: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2024-04-28 21:30:54 -06:00
Elyes Haouas 83409a9357 moused: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2024-04-28 21:30:54 -06:00
Elyes Haouas 338d9c35d5 kbdcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2024-04-28 21:24:47 -06:00
Elyes Haouas 8f65dcd627 ctld: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2024-04-28 21:24:47 -06:00
Elyes Haouas 2f8ea2f605 ctladm: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2024-04-28 21:24:47 -06:00