Commit graph

289861 commits

Author SHA1 Message Date
Warner Losh 07d600649e stand: Remove dangling mips references
Remove mips support files from ficl.

Sponsored by:		Netflix
2024-02-28 07:09:41 -07:00
Stefan Schlosser 865baeaf1a md5.1: Fix an example
The last example in the manpage md5(1) wants to demonstrate
GNU mode (md5sum), but uses BSD mode (md5) instead:

In GNU mode, the -c option does not compare against a hash string
passed as parameter. Instead, it expects a  digest file,
as created under the name digest for /boot/loader.conf in
the example above.

PR:	276560
Reviewed by:	mhorne
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D44098
2024-02-28 09:31:28 +01:00
Stefan Schlosser 77f6c0ce92 nvmecontrol.8: Fix the SYNOPSIS section
The manpage of nvmecontrol(8) has the following SYNOPSIS:

nvmecontrol format [-f fmt] [-m mset] [-o pi] [-l pil] [-E]
[-C] <device-id | namespace-id>

The correct switch for the pi option is -p according
to sbin/nvmecontrol/format.c:

OPT("pi", 'p', arg_uint32, opt, pi, "Protective information")

So correct the SYNOPSIS section accordingly.

PR:	276554
Reviewed by:	imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D44099
2024-02-28 09:26:20 +01:00
Emmanuel Vadot 72b045386d rc: Set var_run_enable to enable by default
This will load/save the /var/run directories at boot/shutdown if
and only if /var/run/ is a tmpfs mount so it is a win for tmpfs
users and a no-op for everyone else.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D44097
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2024-02-28 08:17:58 +01:00
Mitchell Horne 749e318da3 riscv: add starfive kernelconf template
Enable the Synopsis UART driver. Other drivers will be added in the
future.

Reviewed by:	jrtc27
Sponsored by:	The FreeBSD Foundatino
Differential Revision:	https://reviews.freebsd.org/D44105
2024-02-27 18:10:14 -04:00
Mitchell Horne 036ce936a5 riscv: add dwc, dwmmc to NOTES
In the future these drivers will be enabled in GENERIC. For now, ensure
they build with LINT.

Sponsored by:	The FreeBSD Foundation
2024-02-27 18:10:14 -04:00
Mitchell Horne f84e9df6d0 conf: deduplicate dwmmc config logic
The core of this driver is supported by multiple architectures. Move the
config entries to the MI conf/files.

This hardware is found on several available/emerging RISC-V SoCs, so we
will soon need it on this architecture.

Reviewed by:	manu
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D44104
2024-02-27 18:10:14 -04:00
Mitchell Horne a01dc140b2 conf: deduplicate dwc config logic
Move the core dwc(4) file entries to the MI conf/files.
Platform-specific versions e.g. rk_dwc are retained in their current
position. On arm64 this necessitates adding an additional 'device dwc'
option.

This hardware is found on several available/emerging RISC-V SoCs, so we
will soon need it on this architecture.

Reviewed by:	manu
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D44103
2024-02-27 18:10:14 -04:00
Mitchell Horne fae39d8da9 dwc: fix DEBUG macro name
It conflicts with the general "DEBUG" macro defined as an option in LINT
builds. Since this is actually unused, just rename it to GMAC_DEBUG.

Reviewed by:	manu
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D44102
2024-02-27 18:10:14 -04:00
Simon J. Gerraty 8aea77bc3b Add share/mk/local.dirdeps-targets.mk
To include site.dirdeps-targets.mk
2024-02-27 13:37:50 -08:00
Gleb Smirnoff 41ce9c8b88 netlink: restore original buffer if nlmsgs_to_linux() fails
Caller is responsible to free it or reuse.

Fixes:	17083b94a9
2024-02-27 12:45:54 -08:00
John Baldwin 69945c49fe netlink: Don't use a zero-length array
Define SNL_DECLARE_FIELD_PARSER* macros to create a parser that has
no output attributes only input fields and use this to define the
snl_donemsg_parser.

This removes the need for the zero-length nla_p_donemsg[] variable.
Zero length arrays are not valid in ISO C.

Reviewed by:	jrtc27, melifaro
Differential Revision:	https://reviews.freebsd.org/D43918
2024-02-27 11:59:52 -08:00
Eugene Grosbein d1797fb5bb mkimg.1: add new PARTITION SPECIFICATION section
The specification follows a commentary to the function parse_part()
in the source code and the code itself.

MFC after:	3 days
2024-02-28 02:56:26 +07:00
John Baldwin 3a48dfe115 bhnd_chipc: Make use of bus_generic_rman_* to simplify some code
This uses bus_generic_rman_alloc/release_resource to reduce some code
duplication.  However, I've left the custom activate/deactivate
methods as-is.

Differential Revision:	https://reviews.freebsd.org/D43939
2024-02-27 11:44:22 -08:00
John Baldwin b25f03a1a2 bhnd_usb: Use bus_generic_rman_*
For SYS_RES_MEMORY, use bus_generic_rman_* for
activate/deactivate_resource methods as well as custom
map/unmap_resource methods that request submappings of the sc_mem
resource allocated from the parent bus.

Differential Revision:	https://reviews.freebsd.org/D43938
2024-02-27 11:44:03 -08:00
John Baldwin 9b619f0e90 dpaa2: Use bus_generic_rman_*
Reviewed by:	dsl
Differential Revision:	https://reviews.freebsd.org/D43937
2024-02-27 11:43:50 -08:00
John Baldwin 04fc3fb8fc rman: Remove rman_set_start/end
These functions are not safe as the rman implementation assumes that
all regions (including allocated resources) are sorted by address in
the internal linked-list.

Differential Revision:	https://reviews.freebsd.org/D43936
2024-02-27 11:43:34 -08:00
Alexander Motin 7c667affb7 CTL: Drop Format Device and Rigid Disk Geometry mode pages
Those mode pages are obsolete since SBC-2 specification almost 20
years ago.  First I was trying to understand possible relations
between physical block and physical sector terms in different specs.
Then was thinking about possible relations to device CHS geometry
and compatibility issues.  Finally I just decided that none of it
worth the efforts and should rest in piece.

PR:	276524
2024-02-27 13:28:44 -05:00
Gordon Bergling 6bce41a38e carp(4): Fix a typo in a source code comment
- s/successfull/successful/

MFC after:	3 days
2024-02-27 17:39:57 +01:00
Gordon Bergling e2f3649613 bxe(4): Fix two typos in a kernel messages
- s/successfull/successful/

MFC after:	3 days
2024-02-27 17:38:53 +01:00
Kristof Provost 9566d92726 pf: fix packet-to-big for route-to as well
When we handle a packet via route-to (i.e. pf_route6()) we still need to
verify the MTU. However, we only run that check in the forwarding case.

Set the PFIL_FWD tag when running the pf_test6(PF_OUT) check from
pf_route6(). We are in fact forwarding, so should call the test function
as such. This will cause us to run the MTU check, and generate an ICMP6
packet-too-big error when required.

See also:	54c62e3e5d
See also:	f1c0030bb0
See also:	https://redmine.pfsense.org/issues/14290
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-02-27 14:38:38 +01:00
Baptiste Daroussin cce3a70a77 pci_vendors: update to 2024.02.02 2024-02-27 14:01:11 +01:00
Gordon Bergling 8f87d402e3 dumprestore.h: Fix typos in source code comments
- s/dumpped/dumped/

MFC after:	3 days
2024-02-27 13:49:21 +01:00
Gordon Bergling 04d5a8ae04 vge(4): Fix a typo in a source code comment
- s/opration/operation/

MFC after:	3 days
2024-02-27 13:42:10 +01:00
Peter Holm 81b7ebe32e stress2: Added a few regression tests 2024-02-27 11:05:26 +01:00
Olivier Certner aeff15b392
sched: Simplify sched_lend_user_prio_cond()
If 'td_lend_user_pri' has the expected value, there is no need to check
the fields that sched_lend_user_prio() modifies, they either are already
good or soon will be ('td->td_lend_user_pri' has just been changed by
a concurrent update).

Reviewed by:            kib
Approved by:            emaste (mentor)
MFC after:              2 weeks
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D44050
2024-02-27 09:59:48 +01:00
Olivier Certner 39e4665c96
PP mutexes: lock: Reduce 'umtx_lock' holding before taking the user lock
There is no need to have it for the priority check (that the thread
doesn't have a higher priority than the mutex's ceiling), and there's
also no need to take it if the thread doesn't have privileges to set its
priority to the mutex's ceiling.

While here, turn 'su' into a 'bool' and compute the internal priority
corresponding to the mutex's ceiling once and for all, putting it in new
'new_pri'.

Reviewed by:            kib
Approved by:            emaste (mentor)
MFC after:              2 weeks
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D44045
2024-02-27 09:59:42 +01:00
Olivier Certner 9ac3ac9ece
PP mutexes: lock: Check if priority is too high against base one
Doing this instead of using the current (user) priority, which includes
current lendings, prevents gratuitous failures for threads involved in
multiple locking groups, where each group is defined as the threads that
can lock a particular PP or PI mutex.  No deadlock can occur in this
case.  Indeed, if a thread holds such a lock A giving it a higher
priority than the ceiling of some other lock B that is PP, and B is
acquired by another thread, effectively the latter may not be able to
run but this situation can only last until the first thread releases A,
which it will do eventually.

Reviewed by:            kib
Approved by:            emaste (mentor)
MFC after:              2 weeks
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D44044
2024-02-27 09:59:36 +01:00
Olivier Certner 1df8700aa6
PP mutexes: unlock: Reset inherited prio regardless of privileges
'uq_inherited_pri' contains the current priority inherited from Priority
Protection mutexes.  If -1 is passed through 'm_ceilings[1]', meaning
that there are no such mutexes held anymore, this must be reflected into
it by setting it to PRI_MAX, regardless of whether the thread has
privilege to set realtime priorities (PRI_MAX is also obviously not
a realtime priority level).  By contrast, it shall not be updated and
the computed 'new_inherited_pri' shall stay unused if the thread doesn't
have the ability to set a realtime priority, possibly keeping an older
such priority acquired previously.

Reviewed by:            kib
Approved by:            emaste (mentor)
MFC after:              2 weeks
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D43984
2024-02-27 09:59:20 +01:00
Emmanuel Vadot 5acbe6d1fb pam_xdg: Reset rv to 0
Otherwise on success it ontain the return value of asprintf.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Fixes:		2d2950c889 ("pam_xdg: Check asprintf return value")
2024-02-27 08:06:02 +01:00
Emmanuel Vadot 2d2950c889 pam_xdg: Check asprintf return value
Reported by:	Shawn Webb <shawn.webb@hardenedbsd.org>
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Fixes:          6e69612d5d ("pam: Add pam_xdg module")
2024-02-27 07:42:47 +01:00
Emmanuel Vadot 84329908c5 pam_xdg: Remove leftover debug printf
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Fixes:		6e69612d5d ("pam: Add pam_xdg module")
2024-02-27 07:42:47 +01:00
Warner Losh 9398a495eb loader: Add loader.exit
Add loader.exit(status). While one can get alomst this behavior with
loader.perform("quit"), quit doesn't allow a value to be returned to the
firmware. The interpretation of 'status' is firmware specific. This can
be used when autobooting doesn't work in scripts, for example, to allow
the firmware to try something else...

Sponsored by:		Netflix

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44094
2024-02-26 20:49:46 -07:00
Christos Margiolis 8bfb23abf8 pcm.4: Fix lint warnings
Ignore the "manual not found" warnings for snd_ai2s(4) and
snd_davbus(4).

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43996
2024-02-27 00:28:53 +01:00
Florian Walpen a9341f0f0a snd_uaudio(4): Fix sample rate selection after 42fdcd9fd9.
The sample rate selection of snd_uaudio(4) at runtime was implicitly
relying on a specific order in the device config list. In case a default
was set through the hw.usb.uaudio.default_rate sysctl tunable, commit
42fdcd9fd9 removed a duplicate sample rate entry from that list, which
inadvertently broke sample rate selection at runtime. Implement sample
rate selection in a way that works for any order in the device config
list.

Reported by:	Lexi Winter <lexi@le-fay.org>
MFC after:	1 week
Reviewed by:	christos
Differential Revision:	https://reviews.freebsd.org/D44051
2024-02-27 00:27:47 +01:00
Warner Losh bc4c7e78f8 ofwdump: Convert ints that are booleans to bool.
No functional changes...

Sponsored by:		Netflix
2024-02-26 16:15:55 -07:00
Stefan Eßer 7b77d37a56 rtld-elf: support either byte-order of hints file
Accept either little-endian or big-endian representation of the ELF
hints magic number in the header of a hints file and convert the
parameters to the native byte-order of the repsective system.

This is a pre-requisite for a planned change to always write the byte
order in little-endian format on all architectures. The only relvant
architecture that uses big-endian data is powerpc64, and it is not
likely that new architectures will choose that representation of data
in memory.

When all supported architectures use little-endian data in the hints
file, the byte swap logic can be enabled for big-endian CPUs at
compile time. Up to that point, there is a very small run-time penalty
that is paid on all systems to check the byte-order of the hints file
and to provide the option to byte-swap the parameters read from the
hints file header.

This commit contains the changes from review D44080 (which had been
split off from this patch for easier review),

Reviewed by:	kib
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D44053
2024-02-26 23:18:12 +01:00
Ed Maste 975d773082 kern: fix panic with disabled ttys
PR: 277240, 277329
Reviewed by: kib (earlier version)
Fixes: f1d0a0cbec ("jail: Fix information leak.")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44086
2024-02-26 15:11:27 -05:00
Dag-Erling Smørgrav 312b1076c6 diff: Bump manual page date.
Sponsored by:	Klara, Inc.
2024-02-26 19:21:40 +01:00
Dag-Erling Smørgrav 53de23f4d1 diff: Fix --expand-tabs and --side-by-side.
* Overhaul column width and padding calculation.
* Rewrite print_space() so it is now a) correct and b) understandable.
* Rewrite tab expansion in fetch() for the same reason.

This brings us in line with GNU diff for all cases I could think of.

Sponsored by:	Klara, Inc.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D44014
2024-02-26 19:08:06 +01:00
Emmanuel Vadot 6b9e6f12e5 pam: Always use pam_xdg for session and xdm
This ensure that the XDG_RUNTIME_DIR is always created and the environment
variable is present which is a must for any wayland user (at least).
The only "cost" of it is a directory is created and unused.

Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D44012
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2024-02-26 18:35:22 +01:00
Emmanuel Vadot 6e69612d5d pam: Add pam_xdg module
This is a module to setup the XDG directories and environment variables.
For now the only usage is to have a XDG_RUNTIME_DIR environment setup at
user login.
All other environment variable have a default fallback so no need to export
them in this module.
The directory is created according to the XDG Base directory specification.

The default base directory is /var/run/xdg/<username> but can be configured
using the runtime_dir=<dir> module option.

According to the spec the directory *must* not survive a reboot so adding
var_run_enable="YES" to rc.conf is highly recommanded.

Reviewed by:	des, pauamma (manpages)
Differential Revision:	https://reviews.freebsd.org/D44011
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2024-02-26 18:34:52 +01:00
Konstantin Belousov 1a56620b79 ipsec esp: avoid dereferencing freed secasindex
It is possible that SA was removed while processing packed, in which
case it is changed to the DEAD state and it index is removed from the
tree. Dereferencing sav->sah then touches freed memory.

Reviewed by:	ae
Sponsored by:	NVIDIA networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44079
2024-02-26 16:27:46 +02:00
Toomas Soome 1b3f4ccb7d loader: we can only env_discard() existing variable
While dropping nvpair from nvstore, we also remove the corresponding
environment variable. By doing so, we should be careful not to try
to unset non-existing variable.

Reviewed by:	imp
MFC after:      2 week
Differential revision:  https://reviews.freebsd.org/D44083
2024-02-26 14:56:52 +02:00
Xin LI 8db56defa7 MFV: xz 5.6.0.
MFC after:	2 weeks
2024-02-25 15:46:22 -08:00
Florian Walpen dc15f02506 snd_hdspe(4): Optional unified pcm device.
Add a sysctl tunable to unify all physical ports of an HDSPe sound card
into one pcm device, with up to 14 (AIO) or 36 (RayDAT) channels. This
makes all ports available in multi-channel audio software.

Differential Revision:	https://reviews.freebsd.org/D43798
2024-02-25 21:39:36 +00:00
Konstantin Belousov 32fdcff870 libc/sys: add errno test
Despite looking trivial, it requires proper split of exports from libsys
and libc, proper filtering work in rtld, and operational libsys.

Reviewed by:	emaste, imp
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44075
2024-02-25 22:35:17 +02:00
Xin LI a7819ed7ad Vendor import of xz 5.6.0 (trimmed) 2024-02-25 11:07:28 -08:00
Richard Scheffenegger 8917131e00 tcp: need default in switch statement for enum.
fix clang error after c9b6241e25

Reviewed By: imp
Differential Revision: https://reviews.freebsd.org/D44081
2024-02-25 08:24:13 +01:00
Richard Scheffenegger c9b6241e25 tcp: address enum-int-mismatch
fix gcc13 error after f74352fbcf
2024-02-25 04:46:39 +01:00