Commit Graph

279729 Commits

Author SHA1 Message Date
Warner Losh
fea231d21b ofw: Cast function pointer to proper type
clang 15 insists that we call entry() via a function prototype. Rather
than copping out and using (...), cast it to the same prototype that's
used elsewhere (with tweaks to pointers to make them fit into that
prototype). No functional change.

Sponsored by:		Netflix
2022-11-27 13:23:28 -07:00
Warner Losh
10e804b628 ashldi3: Use C89-style function definition
Use the 'prototype' style function definition. No functional change.

Sponsored by:		Netflix
2022-11-27 13:23:25 -07:00
Warner Losh
1ea42a2880 md5: Use c89 function definitions
Use the c89 function definitions rather than the old K&R definitions.

Sponsored by:		Netflix
2022-11-27 13:22:31 -07:00
Dave Cottlehuber
0af49f00b3 release/oci: add Oracle Cloud image builder
Provides an OCI (Oracle Cloud Infrastructure) release target for
Oracle's KVM-based VM implementation. Tested using 13.1-RELEASE,
primarily on Ampere CPU on A1.Flex VM shapes, but also works on
amd64 shapes.

- supports cloud-init and custom scripts
- provides a freebsd@ sudo-enabled user
- root user disabled over ssh & console

Approved by:    gjb
Reviewed by:    emaste
MFS after:      1 week
Sponsored by:   The FreeBSD Foundation
Sponsored by:   SkunkWerks, GmbH
Technical assistance from:  Oracle
Differential Revision: https://reviews.freebsd.org/D34746
2022-11-27 11:12:02 +00:00
Cy Schubert
671f55828d heimdal: Check return code from _hdb_fetch_kvno()
A malformed principal will cause kadmind to segfault. The PR
addresses only when chpass is requested but delete is also affected.
Fix both.

PR:		268002
Reported by:	Robert Morris <rtm@lcs.mit.edu>
MFC after:	3 days
2022-11-26 18:41:52 -08:00
Cy Schubert
5040a7a9aa heimdal: Add missing iprop error checks.
Inspired by upstream 9d6dd21256f87988605fa75172be9cc92535064c.

Obtained from:	Heimdal 9d6dd21256f87988605fa75172be9cc92535064c
MFC after:	3 days
2022-11-26 18:41:52 -08:00
Cy Schubert
80999dcd5b heimdal: Add missing kadmind error checks
Inspired by:	Heimdal commmit 1b213c1082be4ef5a1c23928d614c762f837dbe7
MFC after:	3 days
2022-11-26 18:41:52 -08:00
Cy Schubert
879b0e9cd2 heimdal: Add missing kadm5 error checks
Obtained from:	Heimdal commit 4a0e01f9edabe36d0f2cab188078dd29fa5aaf02
MFC after:	3 days
2022-11-26 18:41:52 -08:00
Cy Schubert
780f663df3 heimdal: Add missing kadm5 error checks
Generally obtained from upstream 655c057769f56bd8cdb7d16e93f1e7a7cb260342.

PR:		267944, 267972
Obtained from:	Heimdal commit 655c057769f56bd8cdb7d16e93f1e7a7cb260342
MFC after:	3 days
2022-11-26 18:41:51 -08:00
Cy Schubert
e13150e28c heimdal: Fix uninitialized pointer dereference
krb5_ret_preincipal() returns a non-zero return code when
a garbage principal is passed to it. Unfortunately ret_principal_ent()
does not check the return code, with garbage pointing to what would
have been the principal. This results in a segfault when free() is
called.

PR:		267944, 267972
Reported by:	Robert Morris <rtm@lcs.mit.edu>
MFC after:	3 days
2022-11-26 18:41:51 -08:00
Justin Hibbits
41e85e8e35 dpaa: Don't probe disabled devices
Probing disabled devices just adds noise.
2022-11-26 19:45:37 -05:00
Justin Hibbits
598e073f74 dpaa: Use BUS_PASS_SUPPORTDEV for pqmdio
BUS_PASS_SUPPORTDEV is semantically better than BUS_PASS_RESOURCE, since
it's a support device for dtsec, so only needs probed before dtsec, not
before interrupts.

Suggested by:	manu
2022-11-26 11:32:24 -05:00
Justin Hibbits
fae4c6494a dpaa: Probe and attach pqmdio at BUS_PASS_RESOURCE
Avoid the fragile nature of depending on ordering of the devices in the
FDT by forcing the MDIO driver to precede the DTSEC driver.
2022-11-26 11:28:09 -05:00
Justin Hibbits
21d5b592fa dpaa: Account for MDIO device not being found
It's possible the MDIO device hasn't been and attached, or is incorrect
in the device tree so can't probe and attach.  In this case,
ofw_bus_find_child_device_by_phandle() will fail, and return NULL.
Return an error from find_mdio() here to prevent the MAC from attaching,
rather than worry about a NULL pointer dereference later on when
accessing the PHY.
2022-11-26 10:55:21 -05:00
Ed Maste
f93d92f43d pkgbase: report errors via metalog reader exit status
Reviewed by:	kevans
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37482
2022-11-25 09:13:31 -05:00
Alexander Leidinger
ff0c7816db Remove UPDATING entries from old branches.
We only support updates from major version N to N+1:
stable/13 was branched on 20210122, remove all old entries from stable/10
branch point in 2013 to 20210122.
2022-11-25 10:17:14 +01:00
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