Commit Graph

279713 Commits

Author SHA1 Message Date
Baptiste Daroussin
280f11f1be flua: chown(2) binding, fix bad copy/paste 2022-11-25 09:05:40 +01:00
Baptiste Daroussin
a1ab15abe2 flua: add a chown(2) binding
The main difference with the chown in luaposix, is that it checks
and reports if a user or a group do exist when a string is passed
as arguments

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D37479
2022-11-25 08:49:58 +01:00
Mateusz Guzik
3026214ed6 nlm: only access refcounts using dedicated primitives
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-11-24 19:46:43 +00:00
Mateusz Guzik
8288117a61 bpf: only access refcounts using dedicated primitives
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-11-24 19:44:25 +00:00
Cy Schubert
91db848212 heimdal: Handle other types of garbage data
In addition to garbage realm data, also handle garbage dbname, acl_file,
stash_file, and invalid bitmask garbage data.

PR:		267912
Reported by:	Robert Morris <rtm@lcs.mit.edu>
MFC after:	3 days
2022-11-24 09:23:23 -08:00
Cy Schubert
05bc50bdb1 heimdal: Fix NULL dereference when mangled realm message
Fix a NULL dereference in _kadm5_s_init_context() when the client
sends a mangled realm message.

PR:		267912
Reported by:	Robert Morris <rtm@lcs.mit.edu>
MFC after:	3 days
2022-11-24 09:21:13 -08:00
Cy Schubert
d7e8666ffb heimdal: The version string must always contain a terminating NUL
Should the sender send a string without a terminating NUL, ensure that
the NUL terminates the string regardless.

And while at it only process the version string when bytes are returned.

PR:		267884
Reported by:	Robert Morris <rtm@lcs.mit.edu>
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D37471
2022-11-24 09:21:13 -08:00
Pau Amma
06703946d0 Clarify what's normally not required.
Reported by:	karels

Reviewed by:	carlavilla, karels (informally)

Approved by:	carlavilla (mentor)

Differential Revision: https://reviews.freebsd.org/D37483
2022-11-24 16:29:55 +01:00
Ed Maste
f2865d7d55 pam.d: install hard link with same mode as target
Previously when using NO_ROOT we recorded a METALOG entry for the
pam.d/ftp hard link with a different file mode than the link target
pam.d/ftpd, which is not permitted.

This change is similar to 1dbb9994d4 for .profile

Sponsored by:	The FreeBSD Foundation
2022-11-24 08:14:44 -05:00
John Baldwin
c36de97088 <type_traits>: Avoid instantiating a pointer type in std::decay<>.
GCC expands the pointer type in this conditional expression even for
template types _Up that are not arrays.  This raises an error when
std::decay<> is used with reference types (as is done in LLVM's
sources).  Using add_pointer<> causes GCC to only instantiate a
pointer type for array types.

A similar change to this commit (albeit reworked due to upstream
changes) has been merged to libc++ in commit
26068c6e60324ed866a1ca2afb5cb5eb0aaf015b.

In file included from /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/__compare/ordering.h:13,
                 from /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/__compare/common_comparison_category.h:12,
                 from /usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/tuple:168,
                 from /usr/src/contrib/llvm-project/llvm/include/llvm/ADT/DenseMapInfo.h:20,
                 from /usr/src/contrib/llvm-project/llvm/include/llvm/ADT/DenseMap.h:17,
                 from /usr/src/contrib/llvm-project/llvm/lib/Transforms/Scalar/GVNHoist.cpp:36:
/usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/type_traits: In instantiation of 'struct std::__1::__decay<llvm::CHIArg&, true>':
/usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/type_traits:1591:89:   required from 'struct std::__1::decay<llvm::CHIArg&&>'
/usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/__utility/pair.h:132:16:   required by substitution of 'template<class _Tuple, typename std::__1::enable_if<typename std::__1::conditional<(std::__1::__tuple_like_with_size<_Tuple, 2, typename std::__1::__uncvref<_Tp>::type>::value && (! std::__1::is_same<typename std::__1::decay<_Tp>::type, std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<llvm::CHIArg, 2> > >::value)), std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<llvm::CHIArg, 2> >::_CheckTupleLikeConstructor, std::__1::__check_tuple_constructor_fail>::type::__enable_implicit<_Tuple>(), void>::type* <anonymous> > constexpr std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<llvm::CHIArg, 2> >::pair(_Tuple&&) [with _Tuple = llvm::CHIArg&&; typename std::__1::enable_if<typename std::__1::conditional<(std::__1::__tuple_like_with_size<_Tuple, 2, typename std::__1::__uncvref<_Tp>::type>::value && (! std::__1::is_same<typename std::__1::decay<_Tp>::type, std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<llvm::CHIArg, 2> > >::value)), std::__1::pair<llvm::BasicBlock*, llvm::SmallVector<llvm::CHIArg, 2> >::_CheckTupleLikeConstructor, std::__1::__check_tuple_constructor_fail>::type::__enable_implicit<_Tuple>(), void>::type* <anonymous> = <missing>]'
/usr/src/contrib/llvm-project/llvm/lib/Transforms/Scalar/GVNHoist.cpp:892:51:   required from here
/usr/obj/usr/src/amd64.amd64/tmp/usr/include/c++/v1/type_traits:1582:30: error: forming pointer to reference type 'std::__1::remove_extent<llvm::CHIArg&>::type' {aka 'llvm::CHIArg&'}
 1582 |                      >::type type;
      |                              ^~~~

Reviewed by:	dim
Differential Revision:	https://reviews.freebsd.org/D36898
2022-11-23 16:10:05 -08:00
Pau Amma
88be8b8e54 Fix igor and mandoc -T lint low-hanging fruit in hier(7)
Reviewed by:	danfe, gjb (mentor)

Approved by:	gjb (mentor)

MFC after:	3 days

Differential Revision:	https://reviews.freebsd.org/D37473
2022-11-23 22:40:16 +01:00
Pau Amma
720e0e0ff1 Remove disused /cdrom toplevel dir from hier(7).
Reviewed by:	gjb

Approved by:	gjb (mentor)

MFC after:	3 days

Differential Revision:	https://reviews.freebsd.org/D37472
2022-11-23 22:36:36 +01:00
Ed Maste
7543a9c028 dwatch: install hard links with same mode as target
Previoulsy when using NO_ROOT we recorded METALOG entries for dwatch
hard links with different file modes than their link targets, which is
not permitted.

Reviewed by:	bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37477
2022-11-23 15:10:33 -05:00
Ed Maste
1dbb9994d4 sh: install hard link with same mode as target
Previously when using NO_ROOT we recorded a METALOG entry for the
/.profile hard link with a different mode than the link target, which is
not permitted.

Reviewed by:	bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37476
2022-11-23 15:10:02 -05:00
John Baldwin
abb9a940bb makefs: Ignore some sign comparison warnings from GCC.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D37470
2022-11-23 10:38:29 -08:00
John Baldwin
82ac811efa makefs zfs: Disable -Wunused-function for GCC as well.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D37469
2022-11-23 10:35:30 -08:00
John Baldwin
9821e24441 makefs zfs: Use signed values for both results of ?:.
Reported by:	GCC -Wsign-compare
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D37468
2022-11-23 10:35:14 -08:00
Ed Maste
eafafebe47 compat32: retire now-unused MIPS support
This reverts commit a6d20bbaa2.
2022-11-23 09:33:43 -05:00
Corvin Köhne
7c326ab5bb
vmm: don't lock a mtx in the icr_low write handler
x2apic accesses are handled by a wrmsr exit. This handler is called in a
critical section. So, we can't lock a mtx in the icr_low handler.

Reported by:		kp, pho
Tested by:		kp, pho
Approved by:		manu (mentor)
Fixes:			c0f35dbf19 vmm: Use a cpuset_t for vCPUs waiting for STARTUP IPIs.
MFC after:		1 week
MFC with:		c0f35dbf19
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37452
2022-11-23 09:00:04 +01:00
Mateusz Guzik
04af98db59 gitignore: whack dead architectures 2022-11-23 01:18:03 +00:00
John Baldwin
fd5882e1f2 tftpd: Disable -Wformat-nonliteral for GCC.
GCC warns about the non-literal format string passed to strftime().  A
warning here seems a bit odd as strftime() does not take varargs so
there is not a risk of missing args.
2022-11-22 11:12:06 -08:00
John Baldwin
f6fdf9214a systat: Fix a bunch of use after frees in fetch_ifstat().
I think this was probably just a typo.  initifstat() continues around
a similar loop if the mib data fails to fetch, and fetch_ifstat() was
already using a FOREACH_SAFE loop here so expected to keep going.
Calling clearifstat() from the fetch routine also seems wrong, and the
sort_interface_list() call triggered by the existing needsort = 1 will
itself set needclear to trigger a future clearifstat().

Reported by:	GCC 12 -Wuse-after-free
Differential Revision:	https://reviews.freebsd.org/D36823
2022-11-22 11:11:42 -08:00
Bjoern A. Zeeb
bee60c9897 iwlwifi: fix hang on unloading driver
f808c43ad9 introduced a FreeBSD specific
behaviour to wait for firmware load completion before returning from
loading the driver.  This does no longer allow iwl_drv_stop to detect
that startup has completed and it will wait indefinitely for a
completion event that will not happen.
We could change the complete() call to a complete_all() but to avoid
confusion, future side effects, and for simplicity daisy-chain two
complete events in FreeBSD.

PR:		267869
Reported by:	Peter Much (pmc citylink.dinoex.sub.org)
Tested by:	Peter Much (pmc citylink.dinoex.sub.org)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-11-22 17:29:41 +00:00
John Baldwin
8576f84bc1 tftp: Use printf0 attribute for options_set_request/reply.
These functions accept a NULL format argument so should use the printf0
attribute rather than plain printf.

Reported by:	GCC -Wformat
2022-11-22 08:37:26 -08:00
John Baldwin
7e3e70ce21 libicp: Link with -z noexecstack for ld.bfd.
The assembly source files do not contain GNU-stack annotations, so
ld.bfd defaults to using an executable stack.
2022-11-22 08:37:12 -08:00
John Baldwin
99df55bbb7 libcrypto padlock.so: Link with -z noexecstack for ld.bfd.
The assembly source files do not contain GNU-stack annotations, so
ld.bfd defaults to using an executable stack.
2022-11-22 08:37:04 -08:00
John Baldwin
69f6399c37 libsa: Add missing GNU-stack annotations to _setjmp.S.
ld.bfd marks the stack as executable for the crt objects due to the
missing annotations which raises a fatal warning starting with version
2.39.
2022-11-22 08:36:40 -08:00
John Baldwin
03bbe1845d stand/libsa: Remove MIPS setjmp() and longjmp(). 2022-11-22 08:36:28 -08:00
John Baldwin
5115511ed4 Use __freebsd_kprintf__ with GCC 12+ similar to clang. 2022-11-22 08:36:12 -08:00
Pau Amma
e8261bba4e Update resolv.conf(5) "not necessary" language.
While there, fix mandoc -T lint warnings.

PR:		262492

Differential Revision:	https://reviews.freebsd.org/D37449

MFC after:	1 week

Reviewed by:	gjb

Approved by:	gjb (mentor)
2022-11-22 14:25:22 +01:00
Mateusz Guzik
517547573a crypto: move all zeroing into crypto_getreq
Reviewed by:	jhb, markj
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36774
2022-11-22 12:28:07 +00:00
Mateusz Guzik
c1bfe8c593 ipsec: add key_havesp_any
Saves on work in a common case of checking both directions.

Note further work in the area is impending to elide these in the common
case to begin with.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36485
2022-11-22 12:23:08 +00:00
Mateusz Guzik
86104d3ebb ipsec: prohibit unknown directions in key_havesp
Eliminates a branch checking for its validity.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36485
2022-11-22 12:23:03 +00:00
Goran Mekic
1ffc369aa3 Add dnctl rc.d service
As PF now also supports dummynet but can not configure it on its own,
the service which configures pipes, queues and schedulers is needed.

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D37451
2022-11-22 10:46:19 +01:00
Goran Mekic
3599da158e ipfw: Fix ipfw/dnctl detection
Running "dnctl" vs "/sbin/dnctl" gave different results, because we
looked at the entire argv[0] string, rather than the basename.

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D37431
2022-11-22 09:53:20 +01:00
Cyrus Rahman
b8a0dfb17e Add support for _CR3 critical standby (S3) threshold.
Along with _PSV, _HOT, and _CRT, ACPI supports the _CR3 threshold
which specifies a temperature above which a system should transition
to the S3 standby state.

On FreeBSD, this is more useful than _HOT, which specifies the S4
transition threshold temperature (since FreeBSD does not generally
support the S4 state), or, in many cases, _CRT, since after
transitioning to S3 the system can cool and then be resumed.

Reviewed by:	jhb, bcr (manpages)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D35980
2022-11-21 22:12:04 -08:00
Ed Maste
20a66ab4bf Retire CLANG_IS_CC option
A small reduction in build infrastructure complexity; when we had both
Clang and GCC in the tree it was useful to have both built, and choose
one or the other to install as /usr/bin/cc.  Now only Clang is in the
tree, and there is no point in building and installing base Clang but
not providing it as cc (and c++, cpp).

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37075
2022-11-21 14:56:13 -05:00
Corvin Köhne
67654ffd44
bhyve: use dynamic ACPI table offsets
Now that all ACPI tables are build by basl, basl can dynamically
calculate the offset for each table.

Reviewed by:		jhb, markj (older version)
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37002
2022-11-21 09:28:01 +01:00
Corvin Köhne
03e7111fa6
bhyve: build RSDP table by basl
Building the RSDP table by basl will allow it to be loaded by qemu's
ACPI table loader in the future.

Reviewed by:		jhb, markj (older version)
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37001
2022-11-21 09:28:00 +01:00
Corvin Köhne
f3dcdf8be4
bhyve: build RSDT table by basl
Building the RSDT table by basl will allow it to be loaded by qemu's
ACPI table loader in the future.

Reviewed by:		jhb, markj (older version)
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37000
2022-11-21 09:27:59 +01:00
Corvin Köhne
4a60470f05
bhyve: build XSDT table by basl
Building the XSDT table by basl will allow it to be loaded by qemu's
ACPI table loader in the future.

Reviewed by:		jhb, markj (older version)
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36999
2022-11-21 09:27:58 +01:00
Corvin Köhne
6a75de903b
bhyve: build FADT table by basl
Building the FADT table by basl will allow it to be loaded by qemu's
ACPI table loader in the future.

Reviewed by:		jhb, markj (older version)
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36998
2022-11-21 09:27:57 +01:00
Corvin Köhne
897fe59adf
bhyve: build MADT table by basl
Building the MADT table by basl will allow it to be loaded by qemu's
ACPI table loader in the future.

Reviewed by:		jhb, markj (older version)
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36997
2022-11-21 09:27:56 +01:00
Corvin Köhne
d61d712299
bhyve: build HPET table by basl
Building the HPET table by basl will allow it to be loaded by qemu's
ACPI table loader in the future.

Reviewed by:		jhb, markj (older version)
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36996
2022-11-21 09:27:55 +01:00
Corvin Köhne
60277ad75e
bhyve: add helper to fill a ACPI_GENERIC_ADDRESS
Reviewed by:		jhb
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37407
2022-11-21 09:27:54 +01:00
Corvin Köhne
2c2bd15532
bhyve: build MCFG table by basl
Building the MCFG table by basl will allow it to be loaded by qemu's
ACPI table loader in the future.

Reviewed by:		jhb, markj (older version)
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36995
2022-11-21 09:27:53 +01:00
Corvin Köhne
8897b562ab
bhyve: add helper to append a basl table without a header
The common style for build an ACPI table will be:

1. basl_table_create
2. basl_table_append_header
3. setup an ACPI_TABLE_* struct
4. basl_table_append_bytes (without header)

Add a helper for the last step.

Reviewed by:		jhb, markj
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37406
2022-11-21 09:27:51 +01:00
Corvin Köhne
7263419f38
bhyve: make basl_table_add_* functions public
The code will be more readable if we use struct definitions from ACPI-CA
to build ACPI tables. We can fill out the struct and append it to the
basl_table by using basl_table_append_bytes. After that, we have to
declare which checksums, length and pointers should be patched by basl.
That's done by the add_* functions.

Reviewed by:		jhb, markj
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37405
2022-11-21 09:27:50 +01:00
Corvin Köhne
bdbb1da75a
bhyve: build FACS table by basl
Building the FACS table by basl will allow it to be loaded by qemu's
ACPI table loader in the future.

Reviewed by:		jhb, markj (older version)
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36994
2022-11-21 09:27:48 +01:00
Corvin Köhne
fde8ce8892
vmm: remove unneccessary rendezvous assertion
When a vcpu sees that a rendezvous is in progress, it exits and tries to
handle the rendezvous. The vcpu doesn't check if it's part of the
rendezvous or not. If the vcpu isn't part of the rendezvous, the
rendezvous could be done before it reaches the assertion. This will
cause a panic.

The assertion isn't needed at all because vm_handle_rendezvous properly
handles a spurious rendezvous. So, we can just remove it.

PR:			267779
Reviewed by:		jhb, markj
Tested by:		bz
Approved by:		manu (mentor)
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37417
2022-11-21 08:19:36 +01:00