Commit Graph

284592 Commits

Author SHA1 Message Date
Dimitry Andric
cf24393421 Merge commit 69d42eef4bec from llvm-project (by Dimitry Andric):
[Clang] Show type in enum out of range diagnostic

  When the diagnostic for an out of range enum value is printed, it
  currently does not show the actual enum type in question, for example:

      v8/src/base/bit-field.h:43:29: error: integer value 7 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion]
        static constexpr T kMax = static_cast<T>(kNumValues - 1);
                                  ^

  This can make it cumbersome to find the cause for the problem. Add the
  enum type to the diagnostic message, to make it easier.

  Reviewed By: aaron.ballman

  Differential Revision: https://reviews.llvm.org/D152788

PR:		271047
MFC after:	1 month
2023-06-22 20:22:54 +02:00
Dimitry Andric
2efbaac7a0 Merge llvm-project release/16.x llvmorg-16.0.5-0-g185b81e034ba
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16.0.5-0-g185b81e034ba (aka 16.0.5 release).

PR:		271047
MFC after:	1 month
2023-06-22 20:22:50 +02:00
Dimitry Andric
a324c34037 Merge llvm-project release/16.x llvmorg-16.0.4-0-gae42196bc493
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16.0.4-0-gae42196bc493 (aka 16.0.4 release).

PR:		271047
MFC after:	1 month
2023-06-22 20:22:43 +02:00
Dimitry Andric
cbe9438cfe Merge llvm-project release/16.x llvmorg-16.0.3-0-gda3cd333bea5
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16.0.3-0-gda3cd333bea5 (aka 16.0.3 release).

PR:		271047
MFC after:	1 month
2023-06-22 20:22:35 +02:00
Dimitry Andric
c3450ad127 clang: re-downgrade implicit int/function declarations to warning only
This reapplies upstream commit c0141f3c300f by Aaron Ballman:

  Downgrade implicit int and implicit function declaration to warning only

  The changes in Clang 15.0.0 which enabled these diagnostics as a
  warning which defaulted to an error caused disruption for people
  working on distributions such as Gentoo. There was an explicit request
  to downgrade these to be warning-only in Clang 15.0.1 with the
  expectation that Clang 16 will default the diagnostics to an error.

  See
  https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213
  for more details on the discussion.

  See https://reviews.llvm.org/D133800 for the public review of these
  changes.

As noted in the upstream discussion, there are many programs that fail
to configure or build correctly, if these warnings are turned into
errors by default.

Note that most affected programs in ports are relatively old, and are
unlikely to be fixed by actually adjusting their declarations, but by
compiling with -std=gnu89, which downgrades the errors back to warning
again. Lots of tedious work for very little gain.
2023-06-22 20:22:33 +02:00
Dimitry Andric
9e7101a856 Merge llvm-project release/16.x llvmorg-16.0.2-0-g18ddebe1a1a9
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16.0.2-0-g18ddebe1a1a9 (aka 16.0.2 release).

PR:		271047
MFC after:	1 month
2023-06-22 20:22:28 +02:00
Dimitry Andric
1ac57eed95 Merge commit db492316399a from llvm-project (by Dimitry Andric):
[clang][BFloat] Avoid redefining bfloat16_t in arm_neon.h

  As of https://reviews.llvm.org/D79708, clang-tblgen generates `arm_neon.h`,
  `arm_sve.h` and `arm_bf16.h`, and all those generated files will contain a
  typedef of `bfloat16_t`. However, `arm_neon.h` and `arm_sve.h` include
  `arm_bf16.h` immediately before their own typedef:

      #include <arm_bf16.h>
      typedef __bf16 bfloat16_t;

  With a recent version of clang (I used 16.0.1) this results in warnings:

      /usr/lib/clang/16/include/arm_neon.h:38:16: error: redefinition of typedef 'bfloat16_t' is a C11 feature [-Werror,-Wtypedef-redefinition]

  Since `arm_bf16.h` is very likely supposed to be the one true place where
  `bfloat16_t` is defined, I propose to delete the duplicate typedefs from the
  generated `arm_neon.h` and `arm_sve.h`.

  Reviewed By: sdesmalen, simonbutcher

  Differential Revision: https://reviews.llvm.org/D148822

PR:		271047
MFC after:	1 month
2023-06-22 20:22:26 +02:00
Dimitry Andric
482e0fcdf7 Merge commit 16949c5c48ab from llvm-project (by Dimitry Andric):
[compiler-rt] Include system headers before optionally defining HWCAP macros

  In https://reviews.llvm.org/D141285 the optional definitions of `HWCAP`
  macros were moved to before their usage. However, they were also moved
  to before the inclusion of system headers which can optionally define
  them. If any of those system headers then actually defined any of the
  `HWCAP` macros, it would result in a redefinition error.

  Move the system header includes to just before the optional definitions,
  to avoid this problem.

  Reviewed By: ilinpv

  Differential Revision: https://reviews.llvm.org/D148819

PR:		271047
MFC after:	1 month
2023-06-22 20:22:25 +02:00
Dimitry Andric
1ac55f4cb0 Merge llvm-project release/16.x llvmorg-16.0.1-0-gcd89023f7979
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16.0.1-0-gcd89023f7979 (aka 16.0.1 release).

PR:		271047
MFC after:	1 month
2023-06-22 20:22:20 +02:00
Dimitry Andric
bdd1243df5 Merge llvm-project main llvmorg-16-init-18548-gb0daacf58f41
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16-init-18548-gb0daacf58f41.

PR:		271047
MFC after:	1 month
2023-06-22 20:20:56 +02:00
Kyle Evans
781624ca2d getfacl: free acl in print_acl error path
Sponsored by:	Klara, Inc.
2023-06-21 23:58:33 -05:00
Brooks Davis
b95d2237af le(4): deprecate and mark for removal before 15.0
We kept le(4) in the pre-12.0 purge because it was needed for Qemu/MIPS
(virtio networking didn't work) but the MIPS port has been removed.

Reviewed by:	emaste
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D40683
2023-06-22 00:52:12 +01:00
Dag-Erling Smørgrav
bd9049eeff Fix prebuild race between libpam and libtacplus.
Fixes:		21850106fd
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, emaste
Differential Revision:	https://reviews.freebsd.org/D40702
2023-06-21 20:59:03 +00:00
Dag-Erling Smørgrav
db4c5b8a05 m4: Miscellaneous man page fixes.
Sponsored by:	Klara, Inc.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D40701
2023-06-21 20:59:03 +00:00
Dag-Erling Smørgrav
6c9ed64c94 m4: Add -G option which reverses -g.
This matches GNU m4's -G / --traditional option, and although BSD m4 in non-GNU mode is not exactly identical to GNU mode in traditional mode, it's close enough.

Sponsored by:	Klara, Inc.
Reviewed by:	kevans, imp
Differential Revision:	https://reviews.freebsd.org/D40697
2023-06-21 20:59:03 +00:00
Dag-Erling Smørgrav
47b32f8f93 m4: Support long options.
The option names are identical to those of the equivalent options in GNU m4, except of course for --gnu which does not exist in GNU m4.

While here, make the argument to -d / --debug optional, with the same default behavior as in GNU m4, and document it properly.

Sponsored by:	Klara, Inc.
Reviewed by:	kevans, imp
Differential Revision:	https://reviews.freebsd.org/D40694
2023-06-21 20:59:03 +00:00
Michael Tuexen
02b885b09d tcp: fix TCP MD5 computation for the BBR and RACK stack
PR:			253096
Reviewed by:		cc, rscheff
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D40597
2023-06-21 22:54:33 +02:00
Michael Tuexen
0fb0711dba tcp: fix TCP MD5 digest computation for TCP over UDP
Skip the UDP header for the computation. This is similar to
skipping IPv6 extension headers.

Reviewed by:		cc, rscheff
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D40596
2023-06-21 22:48:12 +02:00
Mark Johnston
383d51d592 unix tests: Add a regression test for getpeername(2)
Ensure that it works as expected when applied to a self-connected
socket.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2023-06-21 14:39:36 -04:00
Mark Johnston
712079d381 unix: Fix uipc_peeraddr() to handle self-connected sockets
Reported by:	syzbot+c2da2dbae5fe006556bc@syzkaller.appspotmail.com
Reported by:	syzbot+b4d6b093b1d78bfa859b@syzkaller.appspotmail.com
Fixes:		e8f6e5b2d9 ("unix: Fix locking in uipc_peeraddr()")
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2023-06-21 14:38:26 -04:00
Stefan Eßer
586164cc09 dev/pci: simplify PCI VPD access functions
This update contains a rewrite of the VPD parser based on the
definition of the structure of the VPD data (ident, R/O resource
data, optional R/W data, end tag).

The parser it replaces was based on a state machine, with the tags
and the parsed data controlling the state changes. The flexibility
of this parser is actually not required, and it has caused kernel
panics when operating on malformed data.

Analysis of the VPD code to make it more robust lead me to believe
that it was easier to write a "strict" parser than to restrict the
flexible state machine to detect and reject non-well-formed data.
A number of restrictions had already been added, but they make the
state machine ever more complex and harder to understand.

This updated parser has been verified to return identical parsed data
as the current implementation for the example VPD data given in the
PCI standard and in some actual PCIe VPD data.

It is strict in the sense that it detects and rejects any deviation
from a well-formed VPD structure.

PR:		272018
Approved by:	kib
MFC after:	4 weeks
Differential Revision:	https://reviews.freebsd.org/D34268
2023-06-21 19:36:39 +02:00
Christos Margiolis
e5c7aa5c70 arm64: print '0x' before hex values
Not making it explicit that we're printing values in hex can be
misleading when the number doesn't contain hex-only symbols (a-f). A
good example of this is print_gp_register(), where we print "(func +
offset)"; if the offset doesn't contain a-f symbols, it's not
immediately clear if that value is in decimal or hex. Using '%#' instead
of '0x%' also isn't a better option, it doesn't print '0x' if the value
is 0, and it also messes up column alignment.

Reviewed by:	imp, markj
Approved by:	markj (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40583
2023-06-21 18:47:06 +03:00
Shawn Webb
1723e7f33a cap_net.3: fix typo
Signed-off-by:	Shawn Webb <shawn.webb@hardenedbsd.org>
2023-06-21 11:26:34 -04:00
Andrew Turner
3a1bfe881a arm64: Enable the Hyper-V keyboard driver
Tested on Hyper-V on a Windows Dev Kit 2023

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D40533
2023-06-21 13:17:40 +01:00
Wei Hu
17050a2b5b Hyper-V: vmbus: Prevent load/store reordering when access ring buffer index
When running VM on ARM64 Hyper-V, we have seen netvsc/hn driver hit
assert on reading duplicated network completion packets over vmbus
channel or one of the tx channels stalls completely. This seems to
caused by processor reordering the instructions when vmbus driver
reading or updating its channel ring buffer indexes.

Fix this by using load acquire and store release instructions to
enforce the order of these memory accesses.

PR:		271764
Reported by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Reviewed by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Tested by:	whu
Sponsored by:	Microsoft
2023-06-21 10:10:49 +00:00
Peter Holm
83c701af53 stress2: Added two syzkaller reproducers 2023-06-21 11:10:13 +02:00
Michael Tuexen
133b132bc1 sctp: fix man page for socket option controlling delayed acks
The SCTP_DELAYED_ACK_TIME socket option was replaced by the
SCTP_DELAYED_SACK in the socket API specification in
draft-ietf-tsvwg-sctpsocket-14.
The code was updated in r170056, but the man page was not.

PR:		272124
MFC after:	3 days
2023-06-21 09:18:05 +02:00
Corvin Köhne
1e8d0c6cf6
Revert "bhyve: add command line parameter and parsing for migration"
Unfortunately, this feature didn't receive much feedback in the past.
However, after committing this, some people came up and complain that
this feature requires some more discussion before upstreaming it.
Additionally, it wasn't a good idea to start this new feature by adding
a new command line parameter as it fixes the user interface.

This reverts commit c9fdd4f3cc.
2023-06-21 08:55:34 +02:00
Konstantin Belousov
5bd5470a2c top(8): restore erronously removed SWAIT array element
due to bad rebase.

Noted by:	kevans
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Fixes:	6a5e6a50bd55c3fb4933abe1edaad3a928700c42ESC
2023-06-21 08:43:11 +03:00
Konstantin Belousov
6a5e6a50bd top(8): add missed SLOCK state to the sorted_state[]
Put it near/after the sleep state.

Noted by:	Mark Millard <marklmi@yahoo.com>
Reviewed by:	kevans
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D40607
2023-06-21 08:37:25 +03:00
Konstantin Belousov
d636fc5bd1 top(8): document the actual sort order for process sorting
Noted by:	Mark Millard <marklmi@yahoo.com>
Reviewed by:	kevans
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D40607
2023-06-21 08:37:24 +03:00
Konstantin Belousov
bc2ac2585a top(8): use designated initializers for sorted_state[]
Also correct comments for individual state, duplicating the S* constants
descriptions from sys/proc.h [*].

Reviewed by:	kevans (previous version)
Noted by:	Mark Millard <marklmi@yahoo.com> [*]
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D40607
2023-06-21 08:36:45 +03:00
Konstantin Belousov
5c6393451f top(8): designate the sorted_state[] array as constant
Reviewed by:	kevans
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D40607
2023-06-21 08:36:33 +03:00
Cy Schubert
813847e49e pam_krb5: Fix spoofing vulnerability
An adversary on the network can log in via ssh as any user by spoofing
the KDC. When the machine has a keytab installed the keytab is used to
verify the service ticket. However, without a keytab there is no way
for pam_krb5 to verify the KDC's response and get a TGT with the
password.

If both the password _and_ the KDC are controlled by an adversary, the
adversary can provide a password that the adversary's spoofed KDC will
return a valid tgt for.  Currently, without a keytab, pam_krb5 is
vulnerable to this attack.

Reported by:	Taylor R Campbell <riastradh@netbsd.org> via emaste@
Reviewed by:	so
Approved by:	so
Security:	FreeBSD-SA-23:04.pam_krb5
Security:	CVE-2023-3326
2023-06-20 22:19:47 -07:00
Doug Moore
1efa7dbc07 vm_radix: drop unused function; use bool.
Replace boolean_t with bool in vm_radix.c. Drop the unused function
vm_radix_is_singleton, which is unused and has no corresponding
function in subr_pctrie.c.
Reviewed by:	alc
Differential Revision:	<https://reviews.freebsd.org/D40586>
2023-06-20 23:52:27 -05:00
Richard Scheffenegger
04682968c3 tcp: expose AccECN mode and TCP FastOpen (TFO) in TCPI
Reviewed By:		tuexen, #transport
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D40621
2023-06-20 23:48:56 +02:00
Richard Scheffenegger
7ea8d02798 Update various sys/netinet source files to conform with the style(9)
guide on how to label FALLTHOUGH in switch statements.

No functional chance.

Reviewed By:		tuexen, cc, #transport
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D40622
2023-06-20 23:23:19 +02:00
John Baldwin
4a0b57b0b4 fifolog: Trim some dead code and unused variables.
The gmt_ptr and gmt variables are not used, so the call to gmtime can
be removed entirely.  In addition, there isn't a need to call
localtime twice.

Reported by:	GCC -Wunused-but-set-variable
Reviewed by:	phk, emaste
Differential Revision:	https://reviews.freebsd.org/D40656
2023-06-20 14:03:35 -07:00
Colin Percival
824b64a2f1 Warn about nonfunctional WITHOUT options
Print a warning if we try to WITHOUT_ an option which is marked as
"required" (and forced on).

Suggested by:	emaste, imp
Reviewed by:	emaste, imp
Differential Revision:	https://reviews.freebsd.org/D40613
2023-06-20 13:58:58 -07:00
Ed Maste
4bc148c30e bfe: add unmaintained / deprecation notice
The bfe (Broadcom BCM4401 10/100 Ethernet) driver has known bugs and no
active maintenance.  There have been no changes other than sweeping tree
changes, typo corrections etc. since 2008 a far as I can tell.  Add a
note in the man page so that users expectations are correctly set, and
indicate that it may be removed in the future.

I did not add a gone_in() call in the driver itself as there is no
specific target version for removal, and this driver has evidence of
recent use (dmesg, PRs).

PR:		201947, 213751
Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40625
2023-06-20 16:42:34 -04:00
John Baldwin
38efd4df23 rtld-elf: Mark tls_init_align __unused in free_tls for Variant I TLS.
Some architectures (powerpc and RISC-V) always use 0 for the post TLS
size in which case tls_init_align isn't used by
calculate_tls_post_size.  Use __unused to quiet the warning for these
platforms.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D40673
2023-06-20 12:38:48 -07:00
John Baldwin
3456659866 jail: Mute -Wunused-but-set-variable for yynerrs.
This is in the generated parser when using %pure-parser.

y.tab.c:382:14: error: variable 'yynerrs' set but not used [-Werror,-Wunused-but-set-variable]
    int      yynerrs;
             ^

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D40671
2023-06-20 12:38:20 -07:00
John Baldwin
f13a7fabfe iasl: Disable -Wunused-but-set-variable for a couple of files.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D40669
2023-06-20 12:36:43 -07:00
John Baldwin
ad79b018dc bsd.sys.mk: Add NO_WUNUSED_BUT_SET_VARIABLE helper variable.
This is already present in sys/conf/kern.mk and can be used to
selectively disable -Wunused-but-set-variable.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D40663
2023-06-20 12:36:15 -07:00
John Baldwin
062de1c5df tests/fusefs: Suppress false warning from GCC.
GCC complains that DNAME in the inval_entry_below_root test is not
used, but EXPECT_LOOKUP() does pass DNAME to strcmp in an internal
lambda function.

Reviewed by:	asomers
Differential Revision:	https://reviews.freebsd.org/D40661
2023-06-20 12:34:39 -07:00
John Baldwin
e65868ddd4 acpidump: Remove set but unused variable.
ACPICA's table dumper doesn't try to dump this subtable's contents
either.

Reported by:	GCC
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D40657
2023-06-20 12:33:37 -07:00
John Baldwin
52642de03b camdd: Remove set but unused variables.
Reported by:	GCC
Reviewed by:	ken
Differential Revision:	https://reviews.freebsd.org/D40655
2023-06-20 12:32:57 -07:00
John Baldwin
9a55543f8e mt: Remove a set but unused variable.
The variable is unused because the -v (verbose) flag to
'mt getdensity' is a no-op.

Reported by:	GCC
Reviewed by:	ken
Differential Revision:	https://reviews.freebsd.org/D40653
2023-06-20 12:32:18 -07:00
John Baldwin
8144db85fe libpmc: Define a PMCLOG_SKIP32 helper macro to skip over a 32-bit field.
This replaces a set but unused noop variable with a more explicit
macro.

Reviewed by:	jkoshy, mhorne
Differential Revision:	https://reviews.freebsd.org/D40651
2023-06-20 12:31:43 -07:00
John Baldwin
b488428efe pf/libevent: Consistently pass evsignal to sigaction.
This silences a set but unused warning from GCC.

Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D40649
2023-06-20 12:31:19 -07:00