]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 months agoFix spelling of "behavior" to be consistent with the rest of the file
Benedict Reuschling [Fri, 23 Jun 2023 05:48:01 +0000 (05:48 +0000)]
Fix spelling of "behavior" to be consistent with the rest of the file

12 months agobug: efi_print_global only checks for the first 5 letters of "Driver"
Alfonso Gregory [Mon, 8 May 2023 21:48:50 +0000 (17:48 -0400)]
bug: efi_print_global only checks for the first 5 letters of "Driver"

As a result, it is only really checking for the word Drive, making
"Drive" appended to anything else considered for efi env.

Reviewed by: imp, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/738

12 months agoscsi_all.c: Update to latest asc-num.txt at T10
Warner Losh [Fri, 23 Jun 2023 02:51:30 +0000 (20:51 -0600)]
scsi_all.c: Update to latest asc-num.txt at T10

This updates our table to Sat Mar 25 2023 at 04:30 of the T10
asc-num.txt. I added all the codes that weren't present in the tree,
corrected a couple of the 'alphabet' comments about where the ASC/ASCQ
was defined. I did not, however, make the transition that the
asc-num.txt file made (it deleted W between P and R and added Z after D
so the first few letters shifted a bit). I've not removed the 'W' nor
added the 'Z' at this time. I'm looking for some way to do this
automatically. Try to pick reasonable responses for new entries. When in
doubt, I selected SS_RDEF.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D40718

12 months agoscsi_all.c: Minor formatting nits
Warner Losh [Fri, 23 Jun 2023 02:51:25 +0000 (20:51 -0600)]
scsi_all.c: Minor formatting nits

Noticed the whitespace nits when updating for other reasons.

Sponsored by: Netflix

12 months agoReplace BSD-2-Clause-FreeBSD with BSD-2-Clause
Warner Losh [Fri, 23 Jun 2023 02:51:22 +0000 (20:51 -0600)]
Replace BSD-2-Clause-FreeBSD with BSD-2-Clause

Sponsored by: Netflix

12 months agoCirrus-CI: use llvm16 job by default and make llvm15 manual
Ed Maste [Thu, 22 Jun 2023 23:20:34 +0000 (19:20 -0400)]
Cirrus-CI: use llvm16 job by default and make llvm15 manual

With commit e048f78b2143 the default tool chain is Clang/LLVM 16, so
follow along in the llvm pkg used by Cirrus-CI.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

12 months agoBump __FreeBSD_version for llvm 16.0.6 merge
Dimitry Andric [Thu, 22 Jun 2023 18:24:04 +0000 (20:24 +0200)]
Bump __FreeBSD_version for llvm 16.0.6 merge

PR: 271047
MFC after: 1 month

12 months agoMerge llvm-project release/16.x llvmorg-16.0.6-0-g7cbf1a259152
Dimitry Andric [Thu, 22 Jun 2023 17:47:54 +0000 (19:47 +0200)]
Merge llvm-project release/16.x llvmorg-16.0.6-0-g7cbf1a259152

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16.0.6-0-g7cbf1a259152 (aka 16.0.6 release).

PR: 271047
MFC after: 1 month

12 months agoMerge commit 69d42eef4bec from llvm-project (by Dimitry Andric):
Dimitry Andric [Wed, 14 Jun 2023 18:49:59 +0000 (20:49 +0200)]
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

12 months agoMerge llvm-project release/16.x llvmorg-16.0.5-0-g185b81e034ba
Dimitry Andric [Sun, 4 Jun 2023 19:01:35 +0000 (21:01 +0200)]
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

12 months agoMerge llvm-project release/16.x llvmorg-16.0.4-0-gae42196bc493
Dimitry Andric [Mon, 22 May 2023 17:29:55 +0000 (19:29 +0200)]
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

12 months agoMerge llvm-project release/16.x llvmorg-16.0.3-0-gda3cd333bea5
Dimitry Andric [Fri, 5 May 2023 17:37:33 +0000 (19:37 +0200)]
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

12 months agoclang: re-downgrade implicit int/function declarations to warning only
Dimitry Andric [Tue, 25 Apr 2023 19:24:04 +0000 (21:24 +0200)]
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.

12 months agoMerge llvm-project release/16.x llvmorg-16.0.2-0-g18ddebe1a1a9
Dimitry Andric [Sat, 22 Apr 2023 17:27:13 +0000 (19:27 +0200)]
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

12 months agoMerge commit db492316399a from llvm-project (by Dimitry Andric):
Dimitry Andric [Thu, 20 Apr 2023 19:22:59 +0000 (21:22 +0200)]
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

12 months agoMerge commit 16949c5c48ab from llvm-project (by Dimitry Andric):
Dimitry Andric [Thu, 20 Apr 2023 19:21:37 +0000 (21:21 +0200)]
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

12 months agoMerge llvm-project release/16.x llvmorg-16.0.1-0-gcd89023f7979
Dimitry Andric [Mon, 17 Apr 2023 17:14:23 +0000 (19:14 +0200)]
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

12 months agoMerge llvm-project main llvmorg-16-init-18548-gb0daacf58f41
Dimitry Andric [Fri, 14 Apr 2023 21:41:27 +0000 (23:41 +0200)]
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

12 months agoVendor import of llvm-project branch release/16.x llvmorg-16.0.6-0-g7cbf1a259152...
Dimitry Andric [Thu, 22 Jun 2023 09:50:25 +0000 (11:50 +0200)]
Vendor import of llvm-project branch release/16.x llvmorg-16.0.6-0-g7cbf1a259152 (aka 16.0.6 release).

12 months agogetfacl: free `acl` in print_acl error path
Kyle Evans [Thu, 22 Jun 2023 04:58:33 +0000 (23:58 -0500)]
getfacl: free `acl` in print_acl error path

Sponsored by: Klara, Inc.

12 months agole(4): deprecate and mark for removal before 15.0
Brooks Davis [Wed, 21 Jun 2023 23:50:12 +0000 (00:50 +0100)]
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

12 months agoFix prebuild race between libpam and libtacplus.
Dag-Erling Smørgrav [Wed, 21 Jun 2023 20:58:54 +0000 (20:58 +0000)]
Fix prebuild race between libpam and libtacplus.

Fixes: 21850106fdda
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans, emaste
Differential Revision: https://reviews.freebsd.org/D40702

12 months agom4: Miscellaneous man page fixes.
Dag-Erling Smørgrav [Wed, 21 Jun 2023 20:58:50 +0000 (20:58 +0000)]
m4: Miscellaneous man page fixes.

Sponsored by: Klara, Inc.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D40701

12 months agom4: Add -G option which reverses -g.
Dag-Erling Smørgrav [Wed, 21 Jun 2023 20:58:45 +0000 (20:58 +0000)]
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

12 months agom4: Support long options.
Dag-Erling Smørgrav [Wed, 21 Jun 2023 20:58:40 +0000 (20:58 +0000)]
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

12 months agotcp: fix TCP MD5 computation for the BBR and RACK stack
Michael Tuexen [Wed, 21 Jun 2023 20:54:33 +0000 (22:54 +0200)]
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

12 months agotcp: fix TCP MD5 digest computation for TCP over UDP
Michael Tuexen [Wed, 21 Jun 2023 20:48:12 +0000 (22:48 +0200)]
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

12 months agounix tests: Add a regression test for getpeername(2)
Mark Johnston [Wed, 21 Jun 2023 18:33:52 +0000 (14:33 -0400)]
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

12 months agounix: Fix uipc_peeraddr() to handle self-connected sockets
Mark Johnston [Wed, 21 Jun 2023 18:20:16 +0000 (14:20 -0400)]
unix: Fix uipc_peeraddr() to handle self-connected sockets

Reported by: syzbot+c2da2dbae5fe006556bc@syzkaller.appspotmail.com
Reported by: syzbot+b4d6b093b1d78bfa859b@syzkaller.appspotmail.com
Fixes: e8f6e5b2d969 ("unix: Fix locking in uipc_peeraddr()")
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

12 months agodev/pci: simplify PCI VPD access functions
Stefan Eßer [Wed, 21 Jun 2023 17:36:39 +0000 (19:36 +0200)]
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

12 months agoarm64: print '0x' before hex values
Christos Margiolis [Wed, 21 Jun 2023 15:47:06 +0000 (18:47 +0300)]
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

12 months agocap_net.3: fix typo
Shawn Webb [Wed, 21 Jun 2023 00:47:19 +0000 (20:47 -0400)]
cap_net.3: fix typo

Signed-off-by: Shawn Webb <shawn.webb@hardenedbsd.org>

12 months agoarm64: Enable the Hyper-V keyboard driver
Andrew Turner [Wed, 14 Jun 2023 12:56:36 +0000 (13:56 +0100)]
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

12 months agoHyper-V: vmbus: Prevent load/store reordering when access ring buffer index
Wei Hu [Wed, 21 Jun 2023 09:31:46 +0000 (09:31 +0000)]
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

12 months agostress2: Added two syzkaller reproducers
Peter Holm [Wed, 21 Jun 2023 09:10:13 +0000 (11:10 +0200)]
stress2: Added two syzkaller reproducers

12 months agosctp: fix man page for socket option controlling delayed acks
Michael Tuexen [Wed, 21 Jun 2023 07:03:30 +0000 (09:03 +0200)]
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

12 months agoRevert "bhyve: add command line parameter and parsing for migration"
Corvin Köhne [Wed, 21 Jun 2023 06:55:34 +0000 (08:55 +0200)]
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 c9fdd4f3cc18c03683de85318ba8d318f96b58c4.

12 months agotop(8): restore erronously removed SWAIT array element
Konstantin Belousov [Wed, 21 Jun 2023 05:43:11 +0000 (08:43 +0300)]
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

12 months agotop(8): add missed SLOCK state to the sorted_state[]
Konstantin Belousov [Mon, 19 Jun 2023 16:00:15 +0000 (19:00 +0300)]
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

12 months agotop(8): document the actual sort order for process sorting
Konstantin Belousov [Mon, 19 Jun 2023 15:57:00 +0000 (18:57 +0300)]
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

12 months agotop(8): use designated initializers for sorted_state[]
Konstantin Belousov [Mon, 19 Jun 2023 13:52:05 +0000 (16:52 +0300)]
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

12 months agotop(8): designate the sorted_state[] array as constant
Konstantin Belousov [Mon, 19 Jun 2023 13:49:19 +0000 (16:49 +0300)]
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

12 months agopam_krb5: Fix spoofing vulnerability
Cy Schubert [Wed, 31 May 2023 19:20:27 +0000 (12:20 -0700)]
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

12 months agovm_radix: drop unused function; use bool.
Doug Moore [Wed, 21 Jun 2023 04:52:27 +0000 (23:52 -0500)]
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>

12 months agotcp: expose AccECN mode and TCP FastOpen (TFO) in TCPI
Richard Scheffenegger [Tue, 20 Jun 2023 21:27:11 +0000 (23:27 +0200)]
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

12 months agoUpdate various sys/netinet source files to conform with the style(9)
Richard Scheffenegger [Tue, 20 Jun 2023 21:23:01 +0000 (23:23 +0200)]
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

12 months agofifolog: Trim some dead code and unused variables.
John Baldwin [Tue, 20 Jun 2023 21:03:35 +0000 (14:03 -0700)]
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

12 months agoWarn about nonfunctional WITHOUT options
Colin Percival [Tue, 20 Jun 2023 04:42:17 +0000 (21:42 -0700)]
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

12 months agobfe: add unmaintained / deprecation notice
Ed Maste [Tue, 20 Jun 2023 12:44:22 +0000 (08:44 -0400)]
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

12 months agortld-elf: Mark tls_init_align __unused in free_tls for Variant I TLS.
John Baldwin [Tue, 20 Jun 2023 19:38:48 +0000 (12:38 -0700)]
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

12 months agojail: Mute -Wunused-but-set-variable for yynerrs.
John Baldwin [Tue, 20 Jun 2023 19:38:20 +0000 (12:38 -0700)]
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

12 months agoiasl: Disable -Wunused-but-set-variable for a couple of files.
John Baldwin [Tue, 20 Jun 2023 19:36:43 +0000 (12:36 -0700)]
iasl: Disable -Wunused-but-set-variable for a couple of files.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D40669

12 months agobsd.sys.mk: Add NO_WUNUSED_BUT_SET_VARIABLE helper variable.
John Baldwin [Tue, 20 Jun 2023 19:36:15 +0000 (12:36 -0700)]
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

12 months agotests/fusefs: Suppress false warning from GCC.
John Baldwin [Tue, 20 Jun 2023 19:34:39 +0000 (12:34 -0700)]
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

12 months agoacpidump: Remove set but unused variable.
John Baldwin [Tue, 20 Jun 2023 19:33:37 +0000 (12:33 -0700)]
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

12 months agocamdd: Remove set but unused variables.
John Baldwin [Tue, 20 Jun 2023 19:32:57 +0000 (12:32 -0700)]
camdd: Remove set but unused variables.

Reported by: GCC
Reviewed by: ken
Differential Revision: https://reviews.freebsd.org/D40655

12 months agomt: Remove a set but unused variable.
John Baldwin [Tue, 20 Jun 2023 19:32:18 +0000 (12:32 -0700)]
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

12 months agolibpmc: Define a PMCLOG_SKIP32 helper macro to skip over a 32-bit field.
John Baldwin [Tue, 20 Jun 2023 19:31:43 +0000 (12:31 -0700)]
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

12 months agopf/libevent: Consistently pass evsignal to sigaction.
John Baldwin [Tue, 20 Jun 2023 19:31:19 +0000 (12:31 -0700)]
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

12 months agoradix_trie: eliminate iteration in keydiff
Doug Moore [Tue, 20 Jun 2023 16:30:29 +0000 (11:30 -0500)]
radix_trie: eliminate iteration in keydiff

Use flsll(), instead of a loop, to find where two keys differ, and
then arithmetic to transform that to a trie level.
Approved by: alc, markj
Differential Revision: https://reviews.freebsd.org/D40585

12 months agobsnmpd snmp_bridge: Remove set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:29:00 +0000 (09:29 -0700)]
bsnmpd snmp_bridge: Remove set but unused variable.

12 months agoiostat: Remove set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:29:00 +0000 (09:29 -0700)]
iostat: Remove set but unused variable.

12 months agoprocstat: Remove set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:29:00 +0000 (09:29 -0700)]
procstat: Remove set but unused variable.

12 months agodiff: Fully comment out the jackpot variable.
John Baldwin [Tue, 20 Jun 2023 16:29:00 +0000 (09:29 -0700)]
diff: Fully comment out the jackpot variable.

This fixes a set but unused warning.

12 months agolibgssapi: Remove a set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:29:00 +0000 (09:29 -0700)]
libgssapi: Remove a set but unused variable.

Reported by: clang -Wunused-but-set-variable

12 months agolibalias tests: Mark an unused variable with __unused.
John Baldwin [Tue, 20 Jun 2023 16:29:00 +0000 (09:29 -0700)]
libalias tests: Mark an unused variable with __unused.

It is not trivial to remove this set but unused variable since it
assigned to inside of a macro body, so just mark it with __unused
instead.

12 months agounix_seqpacket_test: Consistently use datalen as length to send.
John Baldwin [Tue, 20 Jun 2023 16:29:00 +0000 (09:29 -0700)]
unix_seqpacket_test: Consistently use datalen as length to send.

This matches the other tests in this file and quiets a set but unused
warning from GCC.

12 months agortld-elf: Remove set but unused variable on 32-bit arm.
John Baldwin [Tue, 20 Jun 2023 16:29:00 +0000 (09:29 -0700)]
rtld-elf: Remove set but unused variable on 32-bit arm.

12 months agoac: Remove set but not used variable.
John Baldwin [Tue, 20 Jun 2023 16:29:00 +0000 (09:29 -0700)]
ac: Remove set but not used variable.

Reported by: clang

12 months agoypldap: Remove set but unused variables.
John Baldwin [Tue, 20 Jun 2023 16:29:00 +0000 (09:29 -0700)]
ypldap: Remove set but unused variables.

Some of these were reported by GCC, others reported by clang.

12 months agonscd: Remove set but unused variables.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
nscd: Remove set but unused variables.

Reported by: GCC

12 months agobluetooth: Remove set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
bluetooth: Remove set but unused variable.

Reported by: GCC

12 months agobluetooth/ath3kfw: Propagate return value from ath3k_load_fwfile.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
bluetooth/ath3kfw: Propagate return value from ath3k_load_fwfile.

The caller ignores the return value so this is a no-op, but
ath3k_init_ar3012 returns the return values of its internal functions,
so this is more consistent.

Fix some misleading indentation while here.

Reported by: GCC -Wunused-but-set-variable (1)

12 months agomptable: Remove set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
mptable: Remove set but unused variable.

Reported by: GCC

12 months agotraceroute: Remove set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
traceroute: Remove set but unused variable.

Reported by: GCC

12 months agorpc.lockd: Remove set but unused variables.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
rpc.lockd: Remove set but unused variables.

Reported by: GCC

12 months agounits: Remove set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
units: Remove set but unused variable.

Reported by: GCC

12 months agomkuzip: Remove set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
mkuzip: Remove set but unused variable.

Reported by: GCC

12 months agolibvgl: Remove set but unused andmask variable from VGLMouseInit.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
libvgl: Remove set but unused andmask variable from VGLMouseInit.

Reported by: GCC

12 months agolib9p: Remove set but unused sockets[] array from l9p_start_server.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
lib9p: Remove set but unused sockets[] array from l9p_start_server.

Reported by: GCC

12 months agolibkvm: Remove set but unused variable from ppc64mmu_hpt_init.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
libkvm: Remove set but unused variable from ppc64mmu_hpt_init.

Reported by: GCC

12 months agolibgssapi: Remove set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
libgssapi: Remove set but unused variable.

Reported by: GCC

12 months agoriscv: improve KTR_TRAP trace entries
Mitchell Horne [Tue, 20 Jun 2023 14:52:26 +0000 (11:52 -0300)]
riscv: improve KTR_TRAP trace entries

For more informative records of exceptions, include key details such as
the exception code and stval register contents. Remove the curthread
argument as it is redundant (saved with every ktr entry), and the
trapframe as it is somewhat meaningless.

Add a new KTR_TRAP trace record for interrupts.

Reviewed by: markj, jhb
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40584

12 months agoossl: Don't try to initialize the cipher for Chacha20+Poly1305.
John Baldwin [Tue, 20 Jun 2023 14:53:50 +0000 (07:53 -0700)]
ossl: Don't try to initialize the cipher for Chacha20+Poly1305.

Chacha20+Poly1305 doesn't use an ossl_cipher instance the way AES-GCM
does, so ossl_lookup_cipher() failed causing ossl_newsession() to
always fail for Chacha20+Poly1305 sessions.

Reported by: gallatin (ktls_test fails with ossl.ko loaded)
Fixes: 9a3444d91c70 ossl: Add a VAES-based AES-GCM implementation for amd64
Tested by: gallatin
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D40580

12 months agopf: Add code to enable filtering for locally delivered packets
Doug Rabson [Tue, 20 Jun 2023 13:01:58 +0000 (14:01 +0100)]
pf: Add code to enable filtering for locally delivered packets

This is disabled by default since it potentially changes the behavior of
existing filter rule sets. To enable this extra filter for packets being
delivered locally, use:

sysctl net.pf.filter_local=1
service pf restart

PR:             268717
Reviewed-by: kp
MFC-after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D40373

12 months agoifconfig.8: Document limitation of groupname
Koichiro Iwao [Tue, 20 Jun 2023 10:14:39 +0000 (19:14 +0900)]
ifconfig.8: Document limitation of groupname

Approved by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40645

12 months agopf: fix build without VIMAGE
Kristof Provost [Tue, 20 Jun 2023 11:20:11 +0000 (13:20 +0200)]
pf: fix build without VIMAGE

Remove the name conflict between the pfsync_defer_tmo variable and
function.

This worked fine in kernels with VIMAGE (the default), but not in those
without.

Reported by: des@
Sponsored by: Rubicon Communications, LLC ("Netgate")

12 months agotarfs: Don't use IO_DIRECT when reading from tarball.
Dag-Erling Smørgrav [Tue, 20 Jun 2023 09:37:24 +0000 (09:37 +0000)]
tarfs: Don't use IO_DIRECT when reading from tarball.

Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D40612

12 months agobhyve: dos2unix
Corvin Köhne [Tue, 20 Jun 2023 09:47:42 +0000 (11:47 +0200)]
bhyve: dos2unix

tpm_intf.h was incorrectly committed with dos line endings.

Fixes: 0917f925b46e3142c4373d1591bf22014d0f338e ("bhyve: add basic CRB interface for TPM devices")
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG

12 months agopf tests: make pfsync:defer test more robust
Kristof Provost [Mon, 19 Jun 2023 14:41:13 +0000 (16:41 +0200)]
pf tests: make pfsync:defer test more robust

Set the defer timeout to 2.5 seconds, and only make sure that there's at
least a second of delay between the pfsync packet and the ping packet.
The intent is to allow the test to pass even when there's considerable
jitter on the timing measurement (e.g. when the test runs in a VM, such
as during the CI tests).

Allow the test to run in CI.

Sponsored by: Rubicon Communications, LLC ("Netgate")

12 months agopf: allow defer timeout to be configured
Kristof Provost [Mon, 19 Jun 2023 14:37:19 +0000 (16:37 +0200)]
pf: allow defer timeout to be configured

Add the net.pfsync.defer_delay sysctl to allow the defer timeout (i.e.
how long pf holds onto packets waiting for the peer to ack the new
state) to be changed.

This is intended to make testing of the defer code more robust, by
allowing longer timeouts to mitigate scheduling/measurement jitter.

Sponsored by: Rubicon Communications, LLC ("Netgate")

12 months agobhyve/tpm: create crb thread for sending tpm commands
Corvin Köhne [Mon, 29 Aug 2022 10:10:44 +0000 (12:10 +0200)]
bhyve/tpm: create crb thread for sending tpm commands

Commands send to a tpm are very slow. They can take up to several
seconds for completion. For that reason, create a thread which issues
the commands to the tpm device.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40458

12 months agobhyve/tpm: build TPM2 table by tpm interface
Corvin Köhne [Mon, 29 Aug 2022 10:10:43 +0000 (12:10 +0200)]
bhyve/tpm: build TPM2 table by tpm interface

Each tpm has a device specific table. Which table a tpm uses depends on
the tpm interface.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40457

12 months agobhyve: maintain RSDT and XSDT by basl
Corvin Köhne [Thu, 15 Jun 2023 09:12:53 +0000 (11:12 +0200)]
bhyve: maintain RSDT and XSDT by basl

In a subsquent commit the TPM emulation will build it's own TPM2 table.
This needs to be registered to the RSDT and XSDT. Instead of making the
rsdt and xsdt variables global, we can simply add a helper to basl.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40559

12 months agobhyve: add bootindex option for several devices
Corvin Köhne [Mon, 16 Aug 2021 07:50:15 +0000 (09:50 +0200)]
bhyve: add bootindex option for several devices

The bootindex option creates an entry in the "bootorder" fwcfg file.
This file can be picked up by the guest firmware to determine the
bootorder. Nevertheless, it's not guaranteed that the guest firmware
uses the bootorder. At the moment, our OVMF ignores the bootorder. This
will change in the future.

If guest firmware supports the "bootorder" fwcfg file and no device uses
the bootindex option, the boot order is determined by the firmware
itself. If one or more devices specify a bootindex, the first bootable
device with the lowest bootindex will be booted. It's not garanteed that
devices without a bootindex will be recognized as bootable from the
firmware in that case.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39285

12 months agobhyve: add helper to create a bootorder
Corvin Köhne [Mon, 16 Aug 2021 07:47:53 +0000 (09:47 +0200)]
bhyve: add helper to create a bootorder

Qemu's fwcfg allows to define a bootorder. Therefore, the hypervisor has
to create a fwcfg item named bootorder, which has a newline seperated
list of boot entries. Qemu's OVMF will pick up the bootorder and applies
it.

Add the moment, bhyve's OVMF doesn't support a custom bootorder by
qemu's fwcfg. However, in the future bhyve will gain support for qemu's
OVMF. Additonally, we can port relevant parts from qemu's to bhyve's
OVMF implementation.

Reviewed by: jhb, markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39284

12 months agoRestore dummy WITHOUT_{CAPSICUM,CASPER} descriptions
Ed Maste [Tue, 20 Jun 2023 01:49:59 +0000 (21:49 -0400)]
Restore dummy WITHOUT_{CAPSICUM,CASPER} descriptions

The makeman CI job ensures that all options have description files.

Bring the CI job back to green by adding back WITHOUT_CAPSICUM and
WITHOUT_CASPER description files (that now state the assoicated options
have no effect).

Fixes: c24c117b9644 ("Remove WITHOUT_{CAPSICUM,CASPER} options")
Sponsored by: The FreeBSD Foundation

12 months agoRemove WITHOUT_{CAPSICUM,CASPER} options
Colin Percival [Sun, 18 Jun 2023 00:03:56 +0000 (17:03 -0700)]
Remove WITHOUT_{CAPSICUM,CASPER} options

At this point CAPSICUM and CASPER are merely forced on via the newly
added __REQUIRED_OPTIONS list; after stable/14 branches I'll sweep
the tree for MK_{CAPSICUM,CASPER}.

This change will not be MFCed.

Discussed on: freebsd-arch
Differential Revision: https://reviews.freebsd.org/D40592

12 months agooptions/makeman: Handle __REQUIRED_OPTIONS
Colin Percival [Sun, 18 Jun 2023 00:01:52 +0000 (17:01 -0700)]
options/makeman: Handle __REQUIRED_OPTIONS

Teach the code which generates src.conf.5 about __REQUIRED_OPTIONS;
without this change it gets confused and thinks that every option
turns the required options on.

Reviewed by: sjg, imp
Differential Revision: https://reviews.freebsd.org/D40591

12 months agobsd.mkopt.mk: Add REQUIRED_OPTIONS list
Colin Percival [Sat, 17 Jun 2023 20:08:37 +0000 (13:08 -0700)]
bsd.mkopt.mk: Add REQUIRED_OPTIONS list

Options on this list will be forced to 'yes'.  This is intended for use
as a transitional measure when an option is ceasing to be optional,
before all of the associated make logic is removed.

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