freebsd.git
20 months agoMFV: cherry-pick "PR/358: Fix width for -f - (jpalus)"
Xin LI [Wed, 7 Sep 2022 06:31:20 +0000 (23:31 -0700)]
MFV: cherry-pick "PR/358: Fix width for -f - (jpalus)"

MFC after: 1 week
PR: bin/266264

20 months agoPR/358: Fix width for -f - (jpalus)
Christos Zoulas [Mon, 4 Jul 2022 17:00:51 +0000 (17:00 +0000)]
PR/358: Fix width for -f - (jpalus)

(cherry picked from commit 19bf47777d0002ee884467e45e6ace702e40a4c1)

20 months agolibc: add test case for qsort_b(3)
Xin LI [Wed, 7 Sep 2022 06:11:46 +0000 (23:11 -0700)]
libc: add test case for qsort_b(3)

Reviewed by:  markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D36463

20 months agodivert(4): do not depend on ipfw(4)
Gleb Smirnoff [Wed, 7 Sep 2022 03:54:57 +0000 (20:54 -0700)]
divert(4): do not depend on ipfw(4)

Although originally socket was intended to use with ipfw(4) only, now
it also can be used with pf(4).  On a kernel without packet filters,
it still can be used to inject traffic.

20 months agodivert(4): don't check for CSUM_SCTP without INET
Gleb Smirnoff [Wed, 7 Sep 2022 03:54:57 +0000 (20:54 -0700)]
divert(4): don't check for CSUM_SCTP without INET

This compiles, but actually is a dead code.

Noticed by: bz
Fixes: e72c522858cb

20 months agotests: partial revert of 4627bc1e90fd17c8d4f44de6b932d456b67661fc
Gleb Smirnoff [Wed, 7 Sep 2022 03:54:49 +0000 (20:54 -0700)]
tests: partial revert of 4627bc1e90fd17c8d4f44de6b932d456b67661fc

Python's socketmodule isn't able to construct sockaddr when it doesn't
recognize the address family.  Until this is solved in python let the
tests use the compatibility way to create divert(4) socket.

20 months agoipfilter: Remove unused ioctl
Cy Schubert [Tue, 6 Sep 2022 20:58:35 +0000 (13:58 -0700)]
ipfilter: Remove unused ioctl

The SIOCSTAT1 ioctl is only used in ip_auth and is unused in ip_state.
The ip_state version was likely added to support a new statistic yet
to be developed in ipfstat(8) or for some sample userspace application
(similar in fashion to the sample provided for authentication rules).
There is no need to report individual state hash table bucket lengths
to any future userspace application.

If needed for any future debugging purposes a DTrace probe would be a
better vehicle.

This unused ioctl in ip_stat results in a panic.

PR: 266124
Reported by: Robert Morris <rtm@lcs.mit.edu>
MFC after: 3 days

20 months agoipfilter: Remove IPL_SELECT
Cy Schubert [Fri, 25 Mar 2022 03:15:49 +0000 (20:15 -0700)]
ipfilter: Remove IPL_SELECT

IPL_SELECT was used for HP-UX >= 11.11 only. Remove this de trop code.

MFC after: 3 days

20 months agoCTL: Validate IOCTL parameters.
Alexander Motin [Wed, 7 Sep 2022 01:58:27 +0000 (21:58 -0400)]
CTL: Validate IOCTL parameters.

It was possible to cause kernel panic by passing too large args_len
or non-NULL result_nvl.

Though since the /dev/cam/ctl device is accessible only by root and
used only by limited number of tools it was not a big problem.

PR: 266115
PR: 266136
Reported by: Robert Morris <rtm@lcs.mit.edu>
MFC after: 1 week

20 months agoarm64: machdep.c fix two typos
Warner Losh [Wed, 7 Sep 2022 00:09:14 +0000 (18:09 -0600)]
arm64: machdep.c fix two typos

Sponsored by: Netflix

20 months agoFix for f4fc389.
Kirk McKusick [Tue, 6 Sep 2022 23:22:03 +0000 (16:22 -0700)]
Fix for f4fc389.

Need to check for NULL pointer before using.

Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation

20 months agoClarify error messages about bad inodes.
Kirk McKusick [Tue, 6 Sep 2022 23:16:24 +0000 (16:16 -0700)]
Clarify error messages about bad inodes.

When something was found wrong with an inode the error message
was always "UNKNOWN FILE TYPE". This error is now used only when
the file type field is wrong. Other errors have their own messages:
"BAD FILE SIZE", "NEGATIVE FILE SIZE", "BAD SPECIAL-FILE RDEV",
"INVALID DIRECT BLOCK", and "INVALID INDIRECT BLOCK".

More complete information about the inode is also provided.

Sponsored by: The FreeBSD Foundation

20 months agoImport the updated Arm Optimized Routines
Andrew Turner [Tue, 6 Sep 2022 16:20:29 +0000 (17:20 +0100)]
Import the updated Arm Optimized Routines

The main changes this brings in are:
 - Improves the performance of memcmp
 - Adds SVE implementation of memcpy
 - Uses the MTE version of some str* functions as they are faster

Sponsored by:   The FreeBSD Foundation

20 months agoloader.efi(8): document slop control, amd64 nocopy, and amd64 fault commands
Konstantin Belousov [Sun, 4 Sep 2022 07:36:35 +0000 (10:36 +0300)]
loader.efi(8): document slop control, amd64 nocopy, and amd64 fault commands

Reviewed by: imp
Discussed with: gbe (man pages)
English wording help by: rpokala
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D36435

20 months agoDecode the arm64 ID_AA64ISAR1_EL1 register
Andrew Turner [Tue, 28 Jun 2022 13:39:03 +0000 (13:39 +0000)]
Decode the arm64 ID_AA64ISAR1_EL1 register

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35627

20 months agopf: make pfsync_state_import appease an assert in pf_free_state
Mateusz Guzik [Tue, 6 Sep 2022 14:56:29 +0000 (16:56 +0200)]
pf: make pfsync_state_import appease an assert in pf_free_state

The newly created state failed to be inserted anywhere. This follows
other places.

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

20 months agoifconfig: print interface name on SIOCIFCREATE2 error
Bjoern A. Zeeb [Tue, 6 Sep 2022 13:09:39 +0000 (13:09 +0000)]
ifconfig: print interface name on SIOCIFCREATE2 error

We have repeatedly gotten reports of unclassified SIOCIFCREATE2 errors
(usually "Device not configured").  This can happen if there is
configuration for interfaces in rc.conf which do not (yet) exist and
we try to configure.  I can, e.g., provoke this by configuring wlan
interfaces with their physical interface not installed.
In order to cut support (guesswork) down print the name of the
interface to be configured with the error message.
Hopefully this will help us in the future to improve other configuration
or driver problems.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

20 months agoFix the IV length in the armv8 AES GCM code
Andrew Turner [Wed, 31 Aug 2022 14:55:19 +0000 (15:55 +0100)]
Fix the IV length in the armv8 AES GCM code

Reviewed by: cem, delphij
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36403

20 months agoktls: Add missing NULL pointer check for TLS RX hardware offload.
Hans Petter Selasky [Tue, 6 Sep 2022 10:56:19 +0000 (12:56 +0200)]
ktls: Add missing NULL pointer check for TLS RX hardware offload.

The send tag pointer may be NULL when the ktls_reset_receive_tag()
function is invoked. Add check for this.

Reviewed by: gallatin @
Sponsored by: NVIDIA Networking

20 months agostand: Parse all arguments passed by UEFI
Michael Gmelin [Mon, 5 Sep 2022 15:56:11 +0000 (17:56 +0200)]
stand: Parse all arguments passed by UEFI

Approved by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36457

20 months agopfctl: fix recrusive printing of ethernet anchors
Kristof Provost [Thu, 1 Sep 2022 09:45:19 +0000 (11:45 +0200)]
pfctl: fix recrusive printing of ethernet anchors

Similar to the preceding fix for layer three rules, ensure that we
recursively list wildcard anchors for ethernet rules.

MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D36417

20 months agopfctl: fix recrusive printing of anchors
Kristof Provost [Thu, 1 Sep 2022 08:16:24 +0000 (10:16 +0200)]
pfctl: fix recrusive printing of anchors

Fix a couple of problems with printing of anchors, in particular recursive
printing, both of inline anchors and when requested explicitly with a '*'
in the anchor.
- Correct recursive printing of wildcard anchors (recurse into child anchors
rather than rules, which don't exist)
- Print multi-part anchor paths correctly (pr6065)
- Fix comments and prevent users from specifying multi-component names for
inline anchors.

tested by phessler
ok henning

Also fix the relevant pfctl test case to reflect the new (and now
correct) behaviour).

MFC after: 3 weeks
Obtained from: OpenBSD (mcbride, f9a568a27c740528301ca3419316c85a9fc7f1de)
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D36416

20 months agopfctl: fix printing anchors
Kristof Provost [Tue, 30 Aug 2022 14:32:30 +0000 (16:32 +0200)]
pfctl: fix printing anchors

Ensure that we pass the (base) anchorname to the kernel, not the '/*'
suffix.

MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D36415

20 months agopf tests: test wildcard anchors
Kristof Provost [Wed, 31 Aug 2022 13:40:33 +0000 (15:40 +0200)]
pf tests: test wildcard anchors

Ensure that a wildcard anchor actually includes any nested anchors (i.e.
foo/* will call into foo/bar).

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D36414

20 months agoopenssl: install pc files
Baptiste Daroussin [Fri, 26 Aug 2022 14:02:09 +0000 (16:02 +0200)]
openssl: install pc files

most programs in ports are looking for .pc files in order to get the
necessary information on how to compile and link against openssl.

The ports now also has a way to hide or force a path for pkgconf.

Providing .pc files along with openssl in base will allow (once all
the supported version of FreeBSD has it) so improve the framework to
deal with openssl in base vs openssl in ports (and libressl)

This will also greatly reduce the number of patches necessary to
workaround the build systems which only knows how to detect where
openssl is installed via pkgconf.

PR: 266051
MFC After: 3 weeks
Reviewed by: jkim, delphij
Exp-run by: antoine
Differential Revision: https://reviews.freebsd.org/D36360

20 months agoinit: fix shutdown race
Corvin Köhne [Tue, 6 Sep 2022 07:06:51 +0000 (09:06 +0200)]
init: fix shutdown race

When calling shutdown, shutdown sends a signal to init and exits. This
causes a race condition for the waitpid function. If the signal wins the
race, wpid will be set to -1 and init calls death_single. If shutdown
wins the race, wpid will be set to the pid of the shutdown process and
the requested_transition will be ignored.

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

20 months agoMFV: less v608
Xin LI [Tue, 6 Sep 2022 05:52:39 +0000 (22:52 -0700)]
MFV: less v608

Relnotes: yes
MFC after: 2 weeks

20 months agoqat: make function definition match prototype
Ed Maste [Tue, 6 Sep 2022 01:24:07 +0000 (21:24 -0400)]
qat: make function definition match prototype

LacSymCb_CallbacksRegister declared with a (void) argument list but was
defined with ().  With Clang 15 this produced a warning.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

20 months agoVendor import of less v608.
Xin LI [Mon, 5 Sep 2022 23:57:47 +0000 (16:57 -0700)]
Vendor import of less v608.

20 months agoLinuxKPI: 80211 / iwlwifi: improve queue management
Bjoern A. Zeeb [Mon, 5 Sep 2022 21:03:03 +0000 (21:03 +0000)]
LinuxKPI: 80211 / iwlwifi: improve queue management

For one initialise vif->hw_queues later set in lkpi_80211_txq_tx_one()
for drivers using them.  This may still need slightly more cleanup once
we get QUEUE_CONTROL-supporting drivers into the tree.

For the other rework and improve how we deal with tid/ac/txq in
lkpi_80211_txq_tx_one() and cleanup old comments and unused code.
This seems to reduce (remove) "Invalid TXQ id" reports from iwlwifi.
(The assumption is that the frame(s) triggering this WARN_ONCE or the
added FreeBSD specific logging were sent with lkpi_80211_mo_tx()).

Adjust the one logging from e674ddec0b4138274539587fe9336b577ff1242a
to IWL_DEBUG_TX so that now this is fixed it is also not always logged
anymore but leave it in case we need to further debug queues in the
future.

Tested by: pstef, Kevin Oberman (rkoberman gmail.com)
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

20 months agoLinuxKPI: 80211: improve linuxkpi_ieee80211_get_tid()
Bjoern A. Zeeb [Mon, 5 Sep 2022 20:57:17 +0000 (20:57 +0000)]
LinuxKPI: 80211: improve linuxkpi_ieee80211_get_tid()

Continue what was started in 26a36948331bd08d9afaddfc0da724eacdb953dd
in iwlwifi and extend out internal implementation of
linuxkpi_ieee80211_get_tid() by an argument as to whether "no-QoS"
answers are acceptable.  For the LinuxKPI ieee80211_get_tid() set
this to false as the Linux derived drivers seem to do extra checks
for the QoS-Data frame before acquiring the tid.
Add KASSERTs to enforce the extra argument.
This allows us to use the net80211 variant in LinuxKPI for other
means explicitly documenting that we do accept a IEEE80211_NONQOS_TID.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

20 months agoFormatting cleanups and debugging fix.
Kirk McKusick [Mon, 5 Sep 2022 19:06:58 +0000 (12:06 -0700)]
Formatting cleanups and debugging fix.

Sponsored by: The FreeBSD Foundation

20 months agopam_unix: Remove bogus __unused attribute
Felix Palmen [Mon, 5 Sep 2022 18:50:29 +0000 (20:50 +0200)]
pam_unix: Remove bogus __unused attribute

Approved by: cy, des, tcberner (mentor)
Differential Revision: https://reviews.freebsd.org/D34320

20 months agoloop(4): make interface methods static
Gleb Smirnoff [Mon, 5 Sep 2022 17:29:10 +0000 (10:29 -0700)]
loop(4): make interface methods static

20 months agotcp: tcp6_connect() requires net epoch
Gleb Smirnoff [Mon, 5 Sep 2022 17:15:19 +0000 (10:15 -0700)]
tcp: tcp6_connect() requires net epoch

PR: 262663
Reported & tested by: dch
MFC after: 2 weeks

20 months agoRevert "usb: Remove a double words in a source code comments"
Gordon Bergling [Sun, 4 Sep 2022 15:40:25 +0000 (17:40 +0200)]
Revert "usb: Remove a double words in a source code comments"

This reverts commit 8ca67bf1273a5168f8a3787183159c477632e582.

The original comment was correct; changing it loses a key part.

Reported by: jrtc27

20 months agoRevert "stand: Grammar fix for a source code comment"
Gordon Bergling [Mon, 5 Sep 2022 13:40:55 +0000 (15:40 +0200)]
Revert "stand: Grammar fix for a source code comment"

This reverts commit 7d91d6b83e74edf278dde375e6049aca833cbebd.

The orginal comment is more natural.

Reported by:jrtc27

20 months agolibexec/rc: Add var_run rc script
Cy Schubert [Sun, 28 Aug 2022 12:48:25 +0000 (05:48 -0700)]
libexec/rc: Add var_run rc script

Users with a tmpfs /var/run will lose the directory tree state of
/var/run at reboot. This rc script will optionally (by default)
capture the state of the directory structure in /var/run prior to
shutdown and recreate it at system boot.

Alternatively a user can save the state of the /var/run directories
manually using service var_run save and disable the autosaving of
/var/run state using the var_run_autosave variable, for those
paranoid SSD users.

PR: 259585, 259699
Reported by: freebsd@walstatt-de.de,
Reviewed by: philip, gbe (previous version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36386

20 months agopf: stop using PFIL_FWD
Mateusz Guzik [Fri, 2 Sep 2022 16:36:52 +0000 (18:36 +0200)]
pf: stop using PFIL_FWD

It is only there to check if the packet was reassembled,
relevant if we are forwarding. But if the packet originated
locally it could not have been reassembled, thus the flag is
redundant.

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

20 months agonetinet6: call lle_event eventhandler after updating state
Alexander V. Chernikov [Mon, 5 Sep 2022 12:57:20 +0000 (12:57 +0000)]
netinet6: call lle_event eventhandler after updating state

Fix nd6_na_input() eventhandler call: run eventhandler after lle
 state transition.

Old behaviour (as seen by event handler):
 * fe80::5054:ff:fe8c:63e9 dev vtnet0 lladdr 52:54:00:8c:63:e9 INCOMPLETE
New behaviour:
* fe80::5054:ff:fe8c:63e9 dev vtnet0 lladdr 52:54:00:8c:63:e9 REACHABLE

MFC after: 2 weeks

20 months agolibpmc: pmc_init() should avoid overflowing pmc_class_table
Toomas Soome [Wed, 31 Aug 2022 08:09:18 +0000 (11:09 +0300)]
libpmc: pmc_init() should avoid overflowing pmc_class_table

Use calloc().

Walk the class list we get from kernel, so we will not add something
the kernel does not know about.

Avoid picking headers from /usr/include.

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

20 months agosignal: use proc_iterate to save on work
Mateusz Guzik [Thu, 10 Mar 2022 18:58:12 +0000 (19:58 +0100)]
signal: use proc_iterate to save on work

Most notably poudriere performs kill -9 -1 in jails for each port
being built. This reduces the scan from hundrends of processes to
literally 1.

Reviewed by: jamie, markj
Differential Revision: https://reviews.freebsd.org/D34522

20 months agojail: add process linkage
Mateusz Guzik [Thu, 10 Mar 2022 18:42:37 +0000 (19:42 +0100)]
jail: add process linkage

It allows iteration over processes belonging to given jail instead of
having to walk the entire allproc list.

Note the iteration can miss processes which remains bug-compatible
with previous code.

Reviewed by: jamie (previous version), markj (previous version)
Differential Revision: https://reviews.freebsd.org/D34522

20 months agorouting: allow logging framework to be used outside of the subsystem
Alexander V. Chernikov [Mon, 5 Sep 2022 10:44:27 +0000 (10:44 +0000)]
routing: allow logging framework to be used outside of the subsystem

MFC after: 2 weeks

20 months agossh: describe deprecated options in general in update doc
Ed Maste [Fri, 19 Aug 2022 14:43:19 +0000 (10:43 -0400)]
ssh: describe deprecated options in general in update doc

Rename "HPN" to more general "Retired patches."  We handle two now-
removed patches the same way: to avoid breaking existing configurations
we accept, but ignore, the option.

Sponsored by: The FreeBSD Foundation

20 months agonfscl: Allow "nolockd" to work for NFSv4 mounts
Rick Macklem [Sun, 4 Sep 2022 20:09:33 +0000 (13:09 -0700)]
nfscl: Allow "nolockd" to work for NFSv4 mounts

Commit 40ada74ee1da modified the NFSv4.1/4.2 client so
that it would issue a DestroySession to the server when
all session slots are marked bad.  This handles the
case where session slots get broken when "intr" or "soft"
NFSv4 fairly well.1/4.2 mounts are done.

There are two other cases where having an NFSv4.1/4.2
RPC attempt terminate without completion can leave
state in a non-determinate condition.

One is file locking RPCs.  If the "nolockd" option is
used, this avoids file locking RPCs by doing locking
locally within the client.

The other is Open locks, but since all FreeBSD Open
locks are done with OPEN_SHARE_DENY_NONE, the locking
state for these should not be critical.

This patch enables use of "nolockd" for NFSv4 mounts,
so that it can be combined with "intr" and/or "soft",
making the latter more usable.

Use of "intr" or "soft" NFSv4 mounts are still not
recommended, but when combined with "nolockd" should
now work fairly well.

A man page update will be done as a separate commit.

MFC after: 2 weeks

20 months agocd9660(5): Correct a typo in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 16:20:09 +0000 (18:20 +0200)]
cd9660(5): Correct a typo in a source code comment

- s/byes/bytes/

MFC after: 3 days

20 months agobxe(4): Grammar fix for a source code comment
Gordon Bergling [Sun, 4 Sep 2022 15:43:15 +0000 (17:43 +0200)]
bxe(4): Grammar fix for a source code comment

- s/that that/that the/

MFC after: 3 days

20 months agousb: Remove a double words in a source code comments
Gordon Bergling [Sun, 4 Sep 2022 15:40:25 +0000 (17:40 +0200)]
usb: Remove a double words in a source code comments

- s/that that/that/

MFC after: 3 days

20 months agostand/kboot: Add note about why we use MACHINE_ARCH here
Warner Losh [Sun, 4 Sep 2022 15:31:51 +0000 (09:31 -0600)]
stand/kboot: Add note about why we use MACHINE_ARCH here

Normally in the boot loader, we key off of MACHINE since that specifies
the kernel and the loader is very tuned to each type of MACHINE in
general. In this case, however, we're producing a Linux binary, with
Linux system calls encoded in it. These align better along the
MACHINE_ARCH axis of FreeBSD. For PowerPC the system calls are radically
different for each of our MACHINE_ARCHes, with only powerpc64 and
powerpc64le sharing the same numbers and memory layout. The same was
true about mips when it was in the tree. 32-bit arm uses the same
layout, however, for both armv6 and armv7 ports: that can be easily
shared in the unlikely event we support that in the future.

Sponsored by: Netflix

20 months agoipfilter: Grammar fix for the ipfilter howto
Gordon Bergling [Sun, 4 Sep 2022 15:37:28 +0000 (17:37 +0200)]
ipfilter: Grammar fix for the ipfilter howto

- s/that that/that the/

MFC after: 3 days

20 months agomsdosfs(5): Remove a double word in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 15:34:52 +0000 (17:34 +0200)]
msdosfs(5): Remove a double word in a source code comment

- s/that that/that/

MFC after: 3 days

20 months agokern: Remove a double word in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 15:32:10 +0000 (17:32 +0200)]
kern: Remove a double word in a source code comment

- s/that that/that/

MFC after: 3 days

20 months agobpf(3): Grammar fix for a source code comment
Gordon Bergling [Sun, 4 Sep 2022 15:30:05 +0000 (17:30 +0200)]
bpf(3): Grammar fix for a source code comment

- s/that that/that the/

MFC after: 3 days

20 months agopkg(8): Remove a double word in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 15:28:16 +0000 (17:28 +0200)]
pkg(8): Remove a double word in a source code comment

- s/that that/that/

MFC after: 3 days

20 months agostand: Grammar fix for a source code comment
Gordon Bergling [Sun, 4 Sep 2022 15:26:48 +0000 (17:26 +0200)]
stand: Grammar fix for a source code comment

- s/that that/that this/

MFC after: 3 days

20 months agohyperv: Fix a typo in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 15:19:40 +0000 (17:19 +0200)]
hyperv: Fix a typo in a source code comment

- s/Unsupport/Unsupported/

MFC after: 3 days

20 months agomsun: Remove a double word in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 11:57:38 +0000 (13:57 +0200)]
msun: Remove a double word in a source code comment

- s/the the/the/

MFC after: 3 days

20 months agobhyve(4): Remove a double word in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 11:57:00 +0000 (13:57 +0200)]
bhyve(4): Remove a double word in a source code comment

- s/the the/the/

MFC after: 3 days

20 months agoqcom_qup: Remove a double word in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 11:54:40 +0000 (13:54 +0200)]
qcom_qup: Remove a double word in a source code comment

- s/the the/the/

MFC after: 3 days

20 months agonet80211(4): Remove a double word in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 11:53:17 +0000 (13:53 +0200)]
net80211(4): Remove a double word in a source code comment

- s/the the/the/

MFC after: 3 days

20 months agotmpfs(5): Remove a double word in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 11:51:50 +0000 (13:51 +0200)]
tmpfs(5): Remove a double word in a source code comment

- s/the the/the/

MFC after: 3 days

20 months agohyperv: Remove a double word in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 11:49:47 +0000 (13:49 +0200)]
hyperv: Remove a double word in a source code comment

- s/the the/the/

MFC after: 3 days

20 months agomps(4): Remove a double word in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 11:48:21 +0000 (13:48 +0200)]
mps(4): Remove a double word in a source code comment

- s/the the/the/

MFC after: 3 days

20 months agompr(4): Remove a double word in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 11:46:44 +0000 (13:46 +0200)]
mpr(4): Remove a double word in a source code comment

- s/the the/the/

MFC after: 3 days

20 months agohid: Remove a double word in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 11:45:50 +0000 (13:45 +0200)]
hid: Remove a double word in a source code comment

- s/the the/the/

MFC after: 3 days

20 months agonetmap(4): Remove a double word in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 11:42:48 +0000 (13:42 +0200)]
netmap(4): Remove a double word in a source code comment

- s/the the/the/

MFC after: 3 days

20 months agoetherswitch(4): Remove a double word in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 11:41:44 +0000 (13:41 +0200)]
etherswitch(4): Remove a double word in a source code comment

- s/the the/the/

MFC after: 3 days

20 months agoarm64: Remove a double word in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 11:40:15 +0000 (13:40 +0200)]
arm64: Remove a double word in a source code comment

- s/the the/the/

MFC after: 3 days

20 months agostand: Remove a double word in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 11:39:35 +0000 (13:39 +0200)]
stand: Remove a double word in a source code comment

- s/the the/the/

MFC after: 3 days

20 months agox86: Correct a typo in source code comment
Gordon Bergling [Sun, 4 Sep 2022 11:36:53 +0000 (13:36 +0200)]
x86: Correct a typo in source code comment

- s/occured/occurred/

MFC after: 3 days

20 months agoi386: Correct a typo in source code comment
Gordon Bergling [Sun, 4 Sep 2022 11:35:34 +0000 (13:35 +0200)]
i386: Correct a typo in source code comment

- s/occured/occurred/

MFC after: 3 days

20 months agoiwm(4): Correct some typos in source code comments
Gordon Bergling [Sun, 4 Sep 2022 11:33:59 +0000 (13:33 +0200)]
iwm(4): Correct some typos in source code comments

- s/occured/occurred/

MFC after: 3 days

20 months agopowerpc: Correct some typos in source code comments
Gordon Bergling [Sun, 4 Sep 2022 11:32:13 +0000 (13:32 +0200)]
powerpc: Correct some typos in source code comments

- s/occured/occurred/

MFC after: 3 days

20 months agovmci(4): Correct some typos in source code comments
Gordon Bergling [Sun, 4 Sep 2022 11:28:47 +0000 (13:28 +0200)]
vmci(4): Correct some typos in source code comments

- s/occured/occurred/

MFC after: 3 days

20 months agoping(8): Correct a typo in source code comment
Gordon Bergling [Sun, 4 Sep 2022 11:26:34 +0000 (13:26 +0200)]
ping(8): Correct a typo in source code comment

- s/occured/occurred/

MFC after: 3 days

20 months agoip6.4: Correct a typo in the manual page
Gordon Bergling [Sun, 4 Sep 2022 11:03:44 +0000 (13:03 +0200)]
ip6.4: Correct a typo in the manual page

- s/the the/the/

MFC after: 3 days

20 months agontpd(8): Correct a typo in comment of the rc script
Gordon Bergling [Sun, 4 Sep 2022 11:02:21 +0000 (13:02 +0200)]
ntpd(8): Correct a typo in comment of the rc script

- s/the the/the/

MFC after: 3 days

20 months agokern: Correct some typos in source code comments
Gordon Bergling [Sun, 4 Sep 2022 11:00:01 +0000 (13:00 +0200)]
kern: Correct some typos in source code comments

- s/occured/occurred/
- s/the the/the/

MFC after: 3 days

20 months agonetdump(4): Correct a typo in source code comment
Gordon Bergling [Sun, 4 Sep 2022 10:59:29 +0000 (12:59 +0200)]
netdump(4): Correct a typo in source code comment

- s/occured/occurred/

MFC after: 3 days

20 months agotcp_rack: Correct some typos in source code comments
Gordon Bergling [Sun, 4 Sep 2022 10:58:13 +0000 (12:58 +0200)]
tcp_rack: Correct some typos in source code comments

- s/occured/occurred/

MFC after: 3 days

20 months agonetinet: Correct a typo in source code comment
Gordon Bergling [Sun, 4 Sep 2022 10:57:12 +0000 (12:57 +0200)]
netinet: Correct a typo in source code comment

- s/occured/occurred/

MFC after: 3 days

20 months agoipf.4: Correct a typo in the manual page
Gordon Bergling [Sun, 4 Sep 2022 10:55:42 +0000 (12:55 +0200)]
ipf.4: Correct a typo in the manual page

- s/occured/occurred/

MFC after: 3 days

20 months agolibifconfig: Correct some typos in source code comments
Gordon Bergling [Sun, 4 Sep 2022 10:53:58 +0000 (12:53 +0200)]
libifconfig: Correct some typos in source code comments

- s/occured/occurred/
- s/the the/the/

MFC after: 3 days

20 months agopmc(3): Correct some typos in event descriptions
Gordon Bergling [Sun, 4 Sep 2022 10:52:38 +0000 (12:52 +0200)]
pmc(3): Correct some typos in event descriptions

- s/occured/occurred/
- s/the the/the/

MFC after: 3 days

20 months agoqat(4): Correct some typos in source code comments
Gordon Bergling [Sun, 4 Sep 2022 10:51:22 +0000 (12:51 +0200)]
qat(4): Correct some typos in source code comments

- s/occured/occurred/
- s/the the/the/

MFC after: 3 days

20 months agobhnd(4): Correct some typos in source code comments
Gordon Bergling [Sun, 4 Sep 2022 10:49:42 +0000 (12:49 +0200)]
bhnd(4): Correct some typos in source code comments

- s/occured/occurred/

While here, fix some whitespace issues.

MFC after: 3 days

20 months agotcp_hpts: Correct some typos in source code comments
Gordon Bergling [Sun, 4 Sep 2022 10:47:49 +0000 (12:47 +0200)]
tcp_hpts: Correct some typos in source code comments

- s/occured/occurred/
- s/the the/the/

MFC after: 3 days

20 months agonetpfil: Correct some typos in source code comments
Gordon Bergling [Sun, 4 Sep 2022 10:46:05 +0000 (12:46 +0200)]
netpfil: Correct some typos in source code comments

- s/occured/occurred/
- s/the the/the/

MFC after: 3 days

20 months agoiwn(4): Correct a typo in a kernel error message
Gordon Bergling [Sun, 4 Sep 2022 10:23:27 +0000 (12:23 +0200)]
iwn(4): Correct a typo in a kernel error message

- s/settting/setting/

MFC after: 5 days

20 months agosound(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 4 Sep 2022 09:23:34 +0000 (11:23 +0200)]
sound(4): Fix a typo in a source code comment

- s/availavle/available/

MFC after: 3 days

20 months agortld.c: remove extra blank line
Konstantin Belousov [Wed, 31 Aug 2022 01:06:51 +0000 (04:06 +0300)]
rtld.c: remove extra blank line

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36396

20 months agortld: style the rest of rtld_lock.c
Konstantin Belousov [Tue, 30 Aug 2022 12:49:15 +0000 (15:49 +0300)]
rtld: style the rest of rtld_lock.c

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36396

20 months agortld: mask signals for default read locks
Konstantin Belousov [Tue, 30 Aug 2022 12:46:30 +0000 (15:46 +0300)]
rtld: mask signals for default read locks

Rtld locks from libthr defer signals delivery, which means that binding
is not possible while a signal handler is executed.

Binding might upgrade read-locked rtld_bind_lock to write-lock, if
symbol resolution requires loading filters.  If a signal would be delivered
while rtld is in read-locked section, and signal handler needs binding
which upgrades the lock, for non-threaded image that uses default rtld
locks, we get the rtld data structures modified under the top-level
active rtld frame.

To correct the problem, mask signals for read-locking of default locks
in addition to the write-locking.  It is very cheap now with
sigfastblock(2).

Note that the global state is used to track pre-locked state of either
sigfastblock(2) or signal mask (if sigfastblock(2) is administratively
disabled).  It is fine for non-threaded images since there are no other
threads.  But I believe that it is fine for threaded images using libc_r
as well, since masking signals disables preemption (I did not tested
it).

NetBSD PR: https://gnats.netbsd.org/56979
Reported by: tmunro
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D36396

20 months agoLinuxKPI: 80211: scanning code updates
Bjoern A. Zeeb [Sat, 3 Sep 2022 23:40:51 +0000 (23:40 +0000)]
LinuxKPI: 80211: scanning code updates

For consistency rename LKPI_SCAN_RUNNING adding a LHW_ prefix.
Add a local flag LKPI_LHW_SCAN_HW mirroring the net80211
IEEE80211_FEXT_SCAN_OFFLOAD flag.
Slightly simplify the code.
Overload (*ic_scan_curchan) and (*ic_scan_mindwell) so that we can
call the net80211 implementation in case of software scan but skip it
in case of full-offload scans.
Also add a bandaid to our (*ic_set_channel) implementation to not siwtch
channels if we have an active hw_scan running.

Obtained from: bz/wireless-dev
Sponsored by: The FreeBSD Foundation (partially)
MFC after: 4 days

20 months agoLinuxKPI: 80211: implement (*get_antenna) and set ic_[rt]xstream
Bjoern A. Zeeb [Sat, 3 Sep 2022 23:11:05 +0000 (23:11 +0000)]
LinuxKPI: 80211: implement (*get_antenna) and set ic_[rt]xstream

Implement the mac80211 (*get_antenna) call and after checking any
antenna information present query the current configuration on startup
(both informations should be identical at this point in theory).
Both the wiphy variables and function call report a bitmask not a count.
Count the bits for net80211 for as long as we get away with just a
number in ic_[rt]xstream.

Sponsored by: The FreeBSD Foundation
MFC after: 4 days

20 months agoLinuxKPI: 80211: make HW_CRYPTO compileable again
Bjoern A. Zeeb [Sat, 3 Sep 2022 22:51:16 +0000 (22:51 +0000)]
LinuxKPI: 80211: make HW_CRYPTO compileable again

Rename TRY_HW_CRYPTO to LKPI_80211_HW_CRYPTO for consitency and make
it compileable again in case someone wants to sit down and make it
work.  It's probably not too much to do.  Otherwise I might eventually
get around to it.

Obtained from: bz/wireless-dev
Sponsored by: The FreeBSD Foundation
MFC after: 4 days

20 months agomgb: quiten -Wunused-function with LINT builds
Bjoern A. Zeeb [Sat, 3 Sep 2022 22:47:19 +0000 (22:47 +0000)]
mgb: quiten -Wunused-function with LINT builds

As the function itself seems to be helpful don't remove the code but
change the #ifdef DEBUG to #if 0 to avoid:
  warning: unused function 'mgb_dump_some_stats' [-Wunused-function]
with LINT builds.

20 months agoFix printf formating.
Kirk McKusick [Sat, 3 Sep 2022 22:39:45 +0000 (15:39 -0700)]
Fix printf formating.

Fix for f4fc389.

Reported by:  Jenkins
Sponsored by: The FreeBSD Foundation

20 months agoProperly handle the replacement of a partially allocated root directory.
Kirk McKusick [Sat, 3 Sep 2022 21:46:50 +0000 (14:46 -0700)]
Properly handle the replacement of a partially allocated root directory.

If the root directory exists but has a bad block number Pass1 will
accept it and setup an inoinfo structure for it. When Pass2 runs
and cannot read the root inode's content because of a bad (or
duplicate) block number, it removes the bad root inode and replaces
it. As part of creating the replacement root inode, it creates an
inoinfo entry for it. But Pass2 did delete the inoinfo entry that
Pass1 had set up for the root inode so ended up with two inoinfo
structures for it. The final step of Pass2 checks that all the ".."
entries are correct adding them if they are missing which resulted
in a second ".." entry being added to the root directory which
definitely did not go over well in the kernel name cache!

Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation