]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agossh: update to OpenSSH v8.9p1
Ed Maste [Wed, 13 Apr 2022 20:00:56 +0000 (16:00 -0400)]
ssh: update to OpenSSH v8.9p1

Release notes are available at https://www.openssh.com/txt/release-8.9

Some highlights:

 * ssh(1), sshd(8), ssh-add(1), ssh-agent(1): add a system for
   restricting forwarding and use of keys added to ssh-agent(1)

 * ssh(1), sshd(8): add the sntrup761x25519-sha512@openssh.com hybrid
   ECDH/x25519 + Streamlined NTRU Prime post-quantum KEX to the
   default KEXAlgorithms list (after the ECDH methods but before the
   prime-group DH ones). The next release of OpenSSH is likely to
   make this key exchange the default method.

 * sshd(8), portable OpenSSH only: this release removes in-built
   support for MD5-hashed passwords. If you require these on your
   system then we recommend linking against libxcrypt or similar.

Future deprecation notice
=========================

A near-future release of OpenSSH will switch scp(1) from using the
legacy scp/rcp protocol to using SFTP by default.

Legacy scp/rcp performs wildcard expansion of remote filenames (e.g.
"scp host:* .") through the remote shell. This has the side effect of
requiring double quoting of shell meta-characters in file names
included on scp(1) command-lines, otherwise they could be interpreted
as shell commands on the remote side.

MFC after: 1 month
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

2 years agosctp: fix parameter type in NAT status message
Michael Tuexen [Wed, 13 Apr 2022 17:46:28 +0000 (19:46 +0200)]
sctp: fix parameter type in NAT status message

Thanks to Sriram Yagnaraman for providing the patch for the
userland stack.

MFC after: 3 days

2 years agoe1000: Try auto-negotiation for fixed 100 or 10 configuration
J.R. Oldroyd [Wed, 13 Apr 2022 16:11:30 +0000 (09:11 -0700)]
e1000: Try auto-negotiation for fixed 100 or 10 configuration

Currently if an e1000 interface is set to a fixed media configuration,
for gigabit, it will participate in auto-negotiation as required by
IEEE 802.3-2018 Clause 37. However, if set to fixed media configuration
for 100 or 10, it does NOT participate in auto-negotiation.

By my reading of Clauses 28 and 37, while auto-negotiation is optional
for 100 and 10, it is not prohibited and is, in fact, "highly
recommended".

This patch enables auto-negotiation for fixed 100 and 10 media
configuration, in a similar manner to that already performed for 1000.
I.e., the patch enables advertising of just the manually configured
settings with the goal of allowing the remote end to match the manually
configured settings if it has them available.

To be clear, this patch does NOT allow an em(4) interface that has been
manually configured with specific media settings to respond to
auto-negotiation by then configuring different parameters to those that
were manually configured. The intent of this patch is to fully comply
with the requirements of Clause 37, but for 100 and 10.

The need for this has arisen on an em(4) link where the other end is
under a different administrative control and is set to full
auto-negotiation. Due to the cable length GigE is not working well. It
is desired to set the em(4) end to "media 100baseTX mediatype
full-duplex" which does work when both ends are configured that way.
Currently, because em(4) does not participate in autoneg for this
setting, the remote defaults to half-duplex - i.e., there's a duplex
mismatch and things don't work. With this patch, em(4) would inform the
remote that it has only 100baseTX full, the remote would match that and
it will work.

Approved by: erj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D34449

2 years agoe1000: Update mc filter before RCTL flags
Kevin Bowling [Wed, 13 Apr 2022 16:01:19 +0000 (09:01 -0700)]
e1000: Update mc filter before RCTL flags

Update mc filter array before changing RCTL flags as in 5a3eb6207a35

Approved by: grehan
MFC after: 2 weeks

2 years agoixgbe: Update mc filter before FCTRL flags
Kevin Bowling [Wed, 13 Apr 2022 15:59:21 +0000 (08:59 -0700)]
ixgbe: Update mc filter before FCTRL flags

Update mc filter array before changing FCTRL flags, similar to 5a3eb6207a35

Approved by: grehan
MFC after: 2 weeks

2 years agoetcupdate: remove redundant diff3 flag
Tom Jones [Wed, 13 Apr 2022 15:02:15 +0000 (16:02 +0100)]
etcupdate: remove redundant diff3 flag

-A and -m select different output modes output modes for diff3. When
both flags are present gnu diff3 prefers -m, drop the extra -A flag in
etcupdate.

Reviewed by: pstef, 0mp
MFC after: 3 days
Sponsored by: Klara Inc
Differential Revision: <https://reviews.freebsd.org/D###>

2 years agolibsysdecode: Fix decoding of Capsicum rights
Mark Johnston [Wed, 13 Apr 2022 14:47:08 +0000 (10:47 -0400)]
libsysdecode: Fix decoding of Capsicum rights

Capsicum rights are a bit tricky since some of them are subsets of
others, and one can have rights R1 and R2 such that R1 is a subset of
R2, but there is no collection of named rights whose union is R2.  So,
they don't behave like most other flag sets.  sysdecode_cap_rights(3)
does not handle this properly and so can emit misleading decodings.

Try to fix all of these problems:
- Include composite rights in the caprights table.
- Use a constructor to sort the caprights table such that "larger"
  rights appear first and thus are matched first.
- Don't print rights that are a subset of rights already printed, so as
  to minimize the length of the output.
- Print a trailing message if some of the specific rights are not
  matched by the table.

PR: 263165
Reviewed by: pauamma_gundo.com (doc), jhb, emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34874

2 years agonfscl: Clean up the code by removing unused arguments
Rick Macklem [Wed, 13 Apr 2022 14:43:13 +0000 (07:43 -0700)]
nfscl: Clean up the code by removing unused arguments

The "void *stuff" (also called fstuff and dstuff) argument
was used by the Mac OSX port.  For FreeBSD, this argument
is always NULL, so remove it to clean up the code.

This commit gets rid of "stuff" for nfscl_loadattrcache().
Future commits will do the same for other functions.

2 years agotcp: Whitespace cleanup in brr and rack
Richard Scheffenegger [Wed, 13 Apr 2022 10:47:34 +0000 (12:47 +0200)]
tcp: Whitespace cleanup in brr and rack

Whitespace cleanup (leading spaces to tabs)
Nicefy function definitions with indentations

No functional change

Reviewed By: #transport, thj
Sponsored by:   NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D30043

2 years agosc: Move prev_ysize under #ifndef SC_NO_HISTORY
Dmitry Chagin [Wed, 13 Apr 2022 09:35:55 +0000 (12:35 +0300)]
sc: Move prev_ysize under #ifndef SC_NO_HISTORY

Finish fdf288f39.

2 years agostress2: Fix cleanup after test run
Peter Holm [Wed, 13 Apr 2022 09:07:49 +0000 (11:07 +0200)]
stress2: Fix cleanup after test run

2 years agostress2: Added comment
Peter Holm [Wed, 13 Apr 2022 09:04:36 +0000 (11:04 +0200)]
stress2: Added comment

2 years agostress2: Remove working tests from the exclude list
Peter Holm [Wed, 13 Apr 2022 09:03:32 +0000 (11:03 +0200)]
stress2: Remove working tests from the exclude list

2 years ago[patch][doc] Fix EXAMPLE in kqueue(2)
Fernando Apesteguía [Mon, 11 Apr 2022 18:40:28 +0000 (20:40 +0200)]
[patch][doc] Fix EXAMPLE in kqueue(2)

The error control was not properly implemented. "changelist" is const, hence
event.flags is never changed by the syscall.

PR: 196844
Reported by: eugen@
Reviewed by: PauAmma <pauamma@gundo.com>
Approved by: eugen@
Fixes: 8c231786f01b9f8614e2fe5b47196db1caa7a772

2 years agocxgbe/cxgbei: Allow max PDU payload lengths to be changed with a sysctl.
Navdeep Parhar [Tue, 25 Jan 2022 22:27:28 +0000 (14:27 -0800)]
cxgbe/cxgbei: Allow max PDU payload lengths to be changed with a sysctl.

New connections will use the new values.  Existing connections are not
affected.

Obtained from: jhb@
MFC after: 3 weeks
Sponsored by: Chelsio Communications

2 years agoloader: userboot: provide a getsecs() implementation
Kyle Evans [Wed, 13 Apr 2022 00:29:54 +0000 (19:29 -0500)]
loader: userboot: provide a getsecs() implementation

We don't need it for userboot, but it avoids issues with BIND_NOW, so
just provide it.  time(3) isn't defined but ends up being provided by
libc linked into the host process, which is generally fine.

PR: 262920
Reviewed by: imp, jhb
MFC after: 3 days
Diferential Revision: https://reviews.freebsd.org/D34758

2 years agostand: libefi: swap /Pci() printing around
Kyle Evans [Wed, 13 Apr 2022 00:29:54 +0000 (19:29 -0500)]
stand: libefi: swap /Pci() printing around

Printing device followed by interface matches, e.g., edk2.  Note that
this is only a fallback, many firmware implementations will provide the
protocol that we'll use to format device paths.

Reviewed by: imp, tsoome
Sponsored by: Ampere Computing
Submitted by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D34539

2 years agosmc: Rename constants for control register from CTR* to CTRL*.
John Baldwin [Wed, 13 Apr 2022 00:11:28 +0000 (17:11 -0700)]
smc: Rename constants for control register from CTR* to CTRL*.

This avoids a conflict with the recently-added CTR macro in
<sys/ktr.h>.

2 years agoix: Remove cpu_id and related code from ixgbe_if_msix_intr_assign.
John Baldwin [Wed, 13 Apr 2022 00:01:46 +0000 (17:01 -0700)]
ix: Remove cpu_id and related code from ixgbe_if_msix_intr_assign.

Reviewed by: erj
Differential Revision: https://reviews.freebsd.org/D34828

2 years agoaw_wdog: support Allwinner D1 watchdog
Julien Cassette [Tue, 12 Apr 2022 22:12:49 +0000 (19:12 -0300)]
aw_wdog: support Allwinner D1 watchdog

This device is present on the Allwinner D1-based SoCs. Without this
driver, the watchdog timeout will trigger a reset a few seconds after
control is given to the kernel.

Reviewed By: manu, mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34749

2 years agocgem: support SGMII PHY connection mode
Milan Obuch [Thu, 7 Apr 2022 13:04:18 +0000 (10:04 -0300)]
cgem: support SGMII PHY connection mode

As the PolarFire SoC needs SGMII to connect the PHY, check the
'phy-mode' property of device tree node for ethernet and act on it
appropriately.

Add the compatible strings for the PolarFire SoC device tree.
'microchip,mpfs-mss-gem" is not officially documented but has been
observed in the available firmware for this platform, so it is included
for now.

Also, fix a typo in if_cgem_hw.h.

Reviewed by: mhorne
MFC after: 1 week
Sponsored by: Conclusive Engineering
Differential Revision: https://reviews.freebsd.org/D34764

2 years agocgem: rework hardware quirk detection
Milan Obuch [Thu, 7 Apr 2022 12:57:25 +0000 (09:57 -0300)]
cgem: rework hardware quirk detection

Rather than doing these checks based on the detected hardware variant, allow
quirks to be specified as a set of flags for each compatible string.
This simplifies adding support for new compatible hardware.

Reviewed by: mhorne
MFC after: 1 week
Sponsored by: Conclusive Engineering
Differential Revision: https://reviews.freebsd.org/D34764

2 years agorack: Remove unused variable.
John Baldwin [Tue, 12 Apr 2022 21:59:00 +0000 (14:59 -0700)]
rack: Remove unused variable.

2 years agosyscons VGA draw_txtcharcursor: Move sc under #ifndef SC_NO_FONT_LOADING.
John Baldwin [Tue, 12 Apr 2022 21:59:00 +0000 (14:59 -0700)]
syscons VGA draw_txtcharcursor: Move sc under #ifndef SC_NO_FONT_LOADING.

2 years agomlx5 RATELIMIT: Remove an unused variable.
John Baldwin [Tue, 12 Apr 2022 21:59:00 +0000 (14:59 -0700)]
mlx5 RATELIMIT: Remove an unused variable.

2 years agoinfiniband: Disable -Wunused-but-set-variable for a few more OFED files.
John Baldwin [Tue, 12 Apr 2022 21:58:59 +0000 (14:58 -0700)]
infiniband: Disable -Wunused-but-set-variable for a few more OFED files.

2 years agosctp: Remove unused variable.
John Baldwin [Tue, 12 Apr 2022 21:58:59 +0000 (14:58 -0700)]
sctp: Remove unused variable.

2 years agoin_pcboutput_txrtlmt: Remove unused variable.
John Baldwin [Tue, 12 Apr 2022 21:58:59 +0000 (14:58 -0700)]
in_pcboutput_txrtlmt: Remove unused variable.

2 years agonetgraph: Remove the rethook parameter from NG_NODE_FOREACH_HOOK.
John Baldwin [Tue, 12 Apr 2022 21:58:59 +0000 (14:58 -0700)]
netgraph: Remove the rethook parameter from NG_NODE_FOREACH_HOOK.

This parameter was set to the hook that terminated the iteration
early.  However, none of the remaining callers used this argument and
it was always set to an otherwise-unused variable.

2 years agonetgraph: Remove unused variable.
John Baldwin [Tue, 12 Apr 2022 21:58:59 +0000 (14:58 -0700)]
netgraph: Remove unused variable.

2 years agosched_4bsd: Remove unused variables.
John Baldwin [Tue, 12 Apr 2022 21:58:59 +0000 (14:58 -0700)]
sched_4bsd: Remove unused variables.

2 years agorealloc(9): Move slab and zone under #ifndef DEBUG_REDZONE.
John Baldwin [Tue, 12 Apr 2022 21:58:59 +0000 (14:58 -0700)]
realloc(9): Move slab and zone under #ifndef DEBUG_REDZONE.

2 years agosc: Move prev_ysize under #ifndef SC_NO_HISTORY.
John Baldwin [Tue, 12 Apr 2022 21:58:59 +0000 (14:58 -0700)]
sc: Move prev_ysize under #ifndef SC_NO_HISTORY.

2 years agoisp: Remove unused variable.
John Baldwin [Tue, 12 Apr 2022 21:58:59 +0000 (14:58 -0700)]
isp: Remove unused variable.

2 years agoarswitch: Remove unused variable.
John Baldwin [Tue, 12 Apr 2022 21:58:59 +0000 (14:58 -0700)]
arswitch: Remove unused variable.

2 years agoopalflash: Remove unused variable.
John Baldwin [Tue, 12 Apr 2022 21:58:59 +0000 (14:58 -0700)]
opalflash: Remove unused variable.

2 years agops3fb: Remove unused variable.
John Baldwin [Tue, 12 Apr 2022 21:58:59 +0000 (14:58 -0700)]
ps3fb: Remove unused variable.

2 years agollan: Remove unused variables.
John Baldwin [Tue, 12 Apr 2022 21:58:59 +0000 (14:58 -0700)]
llan: Remove unused variables.

In theory the errors during llan_attach should be handled, but other
errors in llan_attach (e.g. bus_setup_intr) are already ignored, so
just remove the unused variable to preserve the status quo.

2 years agopowerpc cpudep_ap_setup: Quite unused variable warnings.
John Baldwin [Tue, 12 Apr 2022 21:58:59 +0000 (14:58 -0700)]
powerpc cpudep_ap_setup: Quite unused variable warnings.

2 years agoppc hwpmc: Remove unused variables.
John Baldwin [Tue, 12 Apr 2022 21:58:58 +0000 (14:58 -0700)]
ppc hwpmc: Remove unused variables.

2 years agopowerpc: Remove unused variables.
John Baldwin [Tue, 12 Apr 2022 21:58:58 +0000 (14:58 -0700)]
powerpc: Remove unused variables.

2 years agopowerpc pmu: Quiet set but unused warnings.
John Baldwin [Tue, 12 Apr 2022 21:58:58 +0000 (14:58 -0700)]
powerpc pmu: Quiet set but unused warnings.

- Remove unused variables.

- Replace a dummy variable with a void cast.

2 years agopowerpc pmu: Don't use garbage battery info.
John Baldwin [Tue, 12 Apr 2022 21:58:58 +0000 (14:58 -0700)]
powerpc pmu: Don't use garbage battery info.

If pmu_query_battery fails, don't notify a change in battery status.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D34889

2 years agograckle badaddr: Use void casts instead of a dummy variable.
John Baldwin [Tue, 12 Apr 2022 21:58:58 +0000 (14:58 -0700)]
grackle badaddr: Use void casts instead of a dummy variable.

2 years agocuda: Remove unused variables.
John Baldwin [Tue, 12 Apr 2022 21:58:58 +0000 (14:58 -0700)]
cuda: Remove unused variables.

2 years agoata_dbdma_dmainit: Remove unused variable.
John Baldwin [Tue, 12 Apr 2022 21:58:58 +0000 (14:58 -0700)]
ata_dbdma_dmainit: Remove unused variable.

2 years agoata_kauai: Remove unused variable.
John Baldwin [Tue, 12 Apr 2022 21:58:58 +0000 (14:58 -0700)]
ata_kauai: Remove unused variable.

2 years agopowerpc cpufreq: Remove unused variables.
John Baldwin [Tue, 12 Apr 2022 21:58:58 +0000 (14:58 -0700)]
powerpc cpufreq: Remove unused variables.

2 years agoppc mmoea64: Workaround set but unused warnings for RB_NEXT.
John Baldwin [Tue, 12 Apr 2022 21:58:58 +0000 (14:58 -0700)]
ppc mmoea64: Workaround set but unused warnings for RB_NEXT.

Inline the unused expression passed as the second argument to RB_NEXT.

2 years agoppc aim flush_disable_caches: Use void casts instead of a dummy variable.
John Baldwin [Tue, 12 Apr 2022 21:58:58 +0000 (14:58 -0700)]
ppc aim flush_disable_caches: Use void casts instead of a dummy variable.

2 years agosound aoa: Mark variable only used in debug trace as unused.
John Baldwin [Tue, 12 Apr 2022 21:58:58 +0000 (14:58 -0700)]
sound aoa: Mark variable only used in debug trace as unused.

2 years agopowermac_nvram: Actually return EBUSY on error from open.
John Baldwin [Tue, 12 Apr 2022 21:58:58 +0000 (14:58 -0700)]
powermac_nvram: Actually return EBUSY on error from open.

2 years agoadt746x: Remove unused variables.
John Baldwin [Tue, 12 Apr 2022 21:58:58 +0000 (14:58 -0700)]
adt746x: Remove unused variables.

2 years agoriscv bounce_bus_dma_tag_destroy: Silence set but unused warning.
John Baldwin [Tue, 12 Apr 2022 21:58:57 +0000 (14:58 -0700)]
riscv bounce_bus_dma_tag_destroy: Silence set but unused warning.

2 years agoif_xae: Remove unused variables.
John Baldwin [Tue, 12 Apr 2022 21:58:57 +0000 (14:58 -0700)]
if_xae: Remove unused variables.

2 years agoaxidma: Remove unused variables.
John Baldwin [Tue, 12 Apr 2022 21:58:57 +0000 (14:58 -0700)]
axidma: Remove unused variables.

2 years agouart_dev_lowrisc: Remove unused variables in stub functions.
John Baldwin [Tue, 12 Apr 2022 21:58:57 +0000 (14:58 -0700)]
uart_dev_lowrisc: Remove unused variables in stub functions.

2 years agoiicoc: Remove unused variable.
John Baldwin [Tue, 12 Apr 2022 21:58:57 +0000 (14:58 -0700)]
iicoc: Remove unused variable.

2 years agoFix a slew of mdoc warnings/errors.
Christian Brueffer [Tue, 12 Apr 2022 21:52:54 +0000 (23:52 +0200)]
Fix a slew of mdoc warnings/errors.

2 years agoKTR: Add CTR() and TR() macros which accept a variable number of arguments.
John Baldwin [Tue, 12 Apr 2022 21:51:59 +0000 (14:51 -0700)]
KTR: Add CTR() and TR() macros which accept a variable number of arguments.

These can be used in place of the CTRn() macros which require n to match
the number of optional arguments.

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

2 years agoi40e_validate_filter_settings: Remove unused variables.
John Baldwin [Tue, 12 Apr 2022 21:51:44 +0000 (14:51 -0700)]
i40e_validate_filter_settings: Remove unused variables.

Reviewed by: erj
Differential Revision: https://reviews.freebsd.org/D34829

2 years agotty: Remove an incorrect assertion from ttyinq_line_iterate()
Mark Johnston [Tue, 12 Apr 2022 21:30:04 +0000 (17:30 -0400)]
tty: Remove an incorrect assertion from ttyinq_line_iterate()

We may legitimately have tib == NULL if we're at the very end of the
queue.

PR: 215373
Reported by: pho
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agolibctf: Fix recursive descent into anonymous SOU fields
Mark Johnston [Tue, 12 Apr 2022 19:24:40 +0000 (15:24 -0400)]
libctf: Fix recursive descent into anonymous SOU fields

PR: 262412
Tested by: dhw, gallatin
Fixes: a6fb86917362 ("libctf: Handle CTFv3 containers")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

2 years agoInstall the recently added posix.mk file
Colin Percival [Mon, 11 Apr 2022 17:48:43 +0000 (10:48 -0700)]
Install the recently added posix.mk file

This enables POSIX compatibility for Makefiles which start with
.POSIX:

Submitted by: sjg

2 years agoAdd new french bépo keyboard layout (version 1.1rc2) normalized by
Olivier Cochard [Tue, 12 Apr 2022 18:48:06 +0000 (20:48 +0200)]
Add new french bépo keyboard layout (version 1.1rc2) normalized by
French national organization for standardization as "NF Z71‐300"
PR: 160227
Approved by: emaste
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D34886

2 years agolibarchive: import changes from upstream
Martin Matuska [Tue, 12 Apr 2022 18:12:34 +0000 (20:12 +0200)]
libarchive: import changes from upstream

Libarchive 3.6.1

Bug fixes:
  PR #1549: archive_digest: check return value of EVP_DigestInit()

PR: 263146 (exp-run)
MFC after: 1 week

2 years ago<sys/_stdarg.h>: Fix indentation after removing __GNUCLIKE checks.
John Baldwin [Tue, 12 Apr 2022 17:12:13 +0000 (10:12 -0700)]
<sys/_stdarg.h>: Fix indentation after removing __GNUCLIKE checks.

2 years agoRemove checks for <sys/cdefs.h> being included.
John Baldwin [Tue, 12 Apr 2022 17:06:18 +0000 (10:06 -0700)]
Remove checks for <sys/cdefs.h> being included.

These files no longer depend on the macros required when these checks
were added.

PR: 263102 (exp-run)
Reviewed by: brooks, imp, emaste
Differential Revision: https://reviews.freebsd.org/D34804

2 years agoRemove checks for __CC_SUPPORTS_WARNING assuming it is always true.
John Baldwin [Tue, 12 Apr 2022 17:06:13 +0000 (10:06 -0700)]
Remove checks for __CC_SUPPORTS_WARNING assuming it is always true.

All supported compilers (modern versions of GCC and clang) support
this.

PR: 263102 (exp-run)
Reviewed by: brooks, imp
Differential Revision: https://reviews.freebsd.org/D34803

2 years agoRemove checks for __CC_SUPPORTS__INLINE assuming it is always true.
John Baldwin [Tue, 12 Apr 2022 17:06:09 +0000 (10:06 -0700)]
Remove checks for __CC_SUPPORTS__INLINE assuming it is always true.

All supported compilers (modern versions of GCC and clang) support
this.

PR: 263102 (exp-run)
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D34802

2 years agoRemove check for __CC_SUPPORTS___FUNC__.
John Baldwin [Tue, 12 Apr 2022 17:06:04 +0000 (10:06 -0700)]
Remove check for __CC_SUPPORTS___FUNC__.

__func__ is part of C99.

PR: 263102 (exp-run)
Reviewed by: brooks, imp, emaste
Differential Revision: https://reviews.freebsd.org/D34801

2 years agoRemove checks for __GNUCLIKE macros for varargs.
John Baldwin [Tue, 12 Apr 2022 17:06:00 +0000 (10:06 -0700)]
Remove checks for __GNUCLIKE macros for varargs.

All supported compilers (modern versions of GCC and clang) support
these.

PR: 263102 (exp-run)
Reviewed by: brooks, imp
Differential Revision: https://reviews.freebsd.org/D34800

2 years agoRemove checks for __GNUCLIKE___SECTION assuming it is always true.
John Baldwin [Tue, 12 Apr 2022 17:05:55 +0000 (10:05 -0700)]
Remove checks for __GNUCLIKE___SECTION assuming it is always true.

All supported compilers (modern versions of GCC and clang) support
this.

PR: 263102 (exp-run)
Reviewed by: brooks, imp, emaste
Differential Revision: https://reviews.freebsd.org/D34799

2 years agoRemove checks for __GNUCLIKE___TYPEOF assuming it is always true.
John Baldwin [Tue, 12 Apr 2022 17:05:50 +0000 (10:05 -0700)]
Remove checks for __GNUCLIKE___TYPEOF assuming it is always true.

All supported compilers (modern versions of GCC and clang) support
this.

PR: 263102 (exp-run)
Reviewed by: brooks, imp, emaste
Differential Revision: https://reviews.freebsd.org/D34798

2 years agoRemove checks for __GNUCLIKE_ASM assuming it is always true.
John Baldwin [Tue, 12 Apr 2022 17:05:45 +0000 (10:05 -0700)]
Remove checks for __GNUCLIKE_ASM assuming it is always true.

All supported compilers (modern versions of GCC and clang) support
this.

Many places didn't have an #else so would just silently do the wrong
thing.  Ancient versions of icc (the original motivation for this) are
no longer a compiler FreeBSD supports.

PR: 263102 (exp-run)
Reviewed by: brooks, imp
Differential Revision: https://reviews.freebsd.org/D34797

2 years agox86: Remove silly checks for <sys/cdefs.h>.
John Baldwin [Tue, 12 Apr 2022 17:05:39 +0000 (10:05 -0700)]
x86: Remove silly checks for <sys/cdefs.h>.

These headers #include <sys/cdefs.h> right after checking if it has
already been #included.  The nested #include already existed when the
check for _SYS_CDEFS_H_ was added, so the check shouldn't have been
added in the first place.

PR: 263102 (exp-run)
Reported by: brooks
Reviewed by: brooks, imp, emaste
Differential Revision: https://reviews.freebsd.org/D34796

2 years agoce,cp: Remove pointless checks for <sys/cdefs.h>
John Baldwin [Tue, 12 Apr 2022 17:05:34 +0000 (10:05 -0700)]
ce,cp: Remove pointless checks for <sys/cdefs.h>

Both of these headers check for _SYS_CDEFS_H_ after including
<sys/param.h> which itself includes <sys/cdefs.h>.

PR: 263102 (exp-run)
Reviewed by: brooks, imp, emaste
Differential Revision: https://reviews.freebsd.org/D34795

2 years agoExtend the length of dirpath to fix failure in kyua test
David Bright [Tue, 12 Apr 2022 16:15:06 +0000 (09:15 -0700)]
Extend the length of dirpath to fix failure in kyua test

When an overlength path is set as the temporary directory for test
case sys/audit/inter-process:shm_unlink_success, the test will fail,
e.g.

```
root@freebsd:/usr/tests/sys/audit # env TMPDIR=/var/tmp/tests/kyua kyua test inter-process:shm_unlink_success
inter-process:shm_unlink_success  ->  failed: shm_unlink.*fileforaudit.*return,success not found in auditpipe within the time limit  [10.452s]

Results file id is usr_tests_sys_audit.20220412-221852-924310
Results saved to /root/.kyua/store/results.usr_tests_sys_audit.20220412-221852-924310.db

0/1 passed (1 failed)
```

The root cause is that dirpath is defined too small to handle it.

Reviewers: vangyzen, dab
Differential Revision: https://reviews.freebsd.org/D34885
Submitted by: Yongbo Yao (yongbo.yao@dell.com)
Sponsored by: Dell Technologies

2 years agoprotect(1): Correct typo and add newline
Daniel Ebdrup Jensen [Tue, 12 Apr 2022 10:38:50 +0000 (12:38 +0200)]
protect(1): Correct typo and add newline

Fix a typo, and move a sentence onto a new line in accordance with
mdoc(7) syntax.

While here, also remember to bump .Dd accordingly, as it was missed in
the prior commit.

Reported by: maxim@

2 years agokdb: set kdb_why when entered via reboot and panic
Tom Jones [Tue, 12 Apr 2022 09:30:22 +0000 (10:30 +0100)]
kdb: set kdb_why when entered via reboot and panic

Reviewed by: jhb
Sponsored by:   NetApp, Inc.
Sponsored by:   Klara, Inc.
X-NetApp-PR:    #74
Differential Revision: https://reviews.freebsd.org/D34551

2 years agoudp: allow udp_tun_func_t() to indicate it did not eat the packet
Kristof Provost [Mon, 11 Apr 2022 13:58:28 +0000 (15:58 +0200)]
udp: allow udp_tun_func_t() to indicate it did not eat the packet

Allow udp tunnel functions to indicate they have not taken ownership of
the packet, and that normal UDP processing should continue.

This is especially useful for scenarios where the kernel has taken
ownership of a socket that was originally created by userspace. It
allows the tunnel function to pass through certain packets for userspace
processing.

The primary user of this is if_ovpn, when it receives messages from
unknown peers (which might be a new client).

Reviewed by: tuexen
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D34883

2 years agoxen/acpi: upload Cx and Px data to Xen
Roger Pau Monné [Thu, 17 Mar 2022 13:40:19 +0000 (14:40 +0100)]
xen/acpi: upload Cx and Px data to Xen

When FreeBSD is running as dom0 (initial domain) on a Xen system it
has access to the native ACPI tables and is the OSPM. However the
hypervisor is the entity in charge of the CPU idle and frequency
states, and in order to perform this duty it requires information
found the ACPI dynamic tables that can only be parsed by the OSPM.

Introduce a new Xen specific ACPI driver to fetch the Processor
related information and upload it to Xen. Note that this driver needs
to take precedence over the generic ACPI CPU driver when running as
dom0, so downgrade the probe score of the native driver to
BUS_PROBE_DEFAULT in order for the Xen specific driver to use
BUS_PROBE_SPECIFIC.

Tested on an Intel NUC to successfully parse and upload both the Cx and
Px states to Xen.

Sponsored by: Citrix Systems R&D
Reviewed by: jhb kib
Differential revision: https://reviews.freebsd.org/D34841

2 years agotzsetup(8): Refactoring to delete dialog(3) code
Alfonso S. Siciliano [Mon, 11 Apr 2022 22:27:29 +0000 (00:27 +0200)]
tzsetup(8): Refactoring to delete dialog(3) code

Little refactoring to complete the conversion to bsddialog(3),
not functional changes:

 * Delete: remaining code for autosizing using BSDDIALOG_AUTOSIZE.
 * Add: constants to delete magical numbers and to avoid unclear
   returned values.
 * Delete: redundant 'conf.button.default_cancel=false', performed by
   bsddialog_initconf().
 * Add: a new function message_zoneinfo_file() to merge features.

Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D34862

2 years agoprotect.1: document existence of _oomprotect
Adam Wolk [Mon, 11 Apr 2022 22:23:43 +0000 (00:23 +0200)]
protect.1: document existence of _oomprotect

Improve discoverability of the functionality by mentioning in the
userland tool manual. Add a SEE ALSO entry to rc.conf(5) where more
details are provided.

Sponsored by:   Fudo Security (a.wolk)
Differential Revision: https://reviews.freebsd.org/D30334

2 years agolinux(4): Copyout actual size of addr to the user space in accept().
Dmitry Chagin [Mon, 11 Apr 2022 20:33:27 +0000 (23:33 +0300)]
linux(4): Copyout actual size of addr to the user space in accept().

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

2 years agolinux(4): Limit user-supplied sockaddr length in recvfrom().
Dmitry Chagin [Mon, 11 Apr 2022 20:32:28 +0000 (23:32 +0300)]
linux(4): Limit user-supplied sockaddr length in recvfrom().

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

2 years agolinux(4): Remove unnecessary PTRIN().
Dmitry Chagin [Mon, 11 Apr 2022 20:32:02 +0000 (23:32 +0300)]
linux(4): Remove unnecessary PTRIN().

2 years agolinux(4): Handle SO_DOMAIN in getsockopt syscall.
Dmitry Chagin [Mon, 11 Apr 2022 20:31:28 +0000 (23:31 +0300)]
linux(4): Handle SO_DOMAIN in getsockopt syscall.

Differential revision: https://reviews.freebsd.org/D34714

2 years agogetdirentries: return ENOENT for unlinked but still open directory.
Dmitry Chagin [Mon, 11 Apr 2022 20:30:16 +0000 (23:30 +0300)]
getdirentries: return ENOENT for unlinked but still open directory.

To be more compatible to IEEE Std 1003.1-2008 (“POSIX.1”).

Reviewed by: mjg, Pau Amma (doc)
Differential revision:  https://reviews.freebsd.org/D34680
MFC after: 2 weeks

2 years agolinux(4): Prevent an attempt to copy an uninitialized source address.
Dmitry Chagin [Mon, 11 Apr 2022 20:29:45 +0000 (23:29 +0300)]
linux(4): Prevent an attempt to copy an uninitialized source address.

PR: 259380
MFC after: 3 days

2 years agoIPv4 multicast: fix LOR in shutdown path
Mike Karels [Fri, 8 Apr 2022 12:37:15 +0000 (07:37 -0500)]
IPv4 multicast: fix LOR in shutdown path

X_ip_mrouter_done() was calling the interface ioctl routines via
if_allmulti() while holding a write lock.  However, some interface
ioctl routines, including em/iflib and tap, use sxlocks, which are
not permitted while holding a non-sleepable lock, and this elicits
a warning from WITNESS.  Fix the locking issue by recording the
affected interface pointers in a malloc'ed array, and call
if_allmulti() on each after dropping the rwlock.

Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D34845

2 years agoClean up some grammos I left behind.
Jens Schweikhardt [Mon, 11 Apr 2022 18:24:11 +0000 (20:24 +0200)]
Clean up some grammos I left behind.

2 years agoCorrect typos and more precise wording.
Jens Schweikhardt [Mon, 11 Apr 2022 18:15:12 +0000 (20:15 +0200)]
Correct typos and more precise wording.

2 years agoifconfig.8: Note that -l accepts -g in addition to -d and -u
Mateusz Piotrowski [Mon, 11 Apr 2022 18:03:26 +0000 (20:03 +0200)]
ifconfig.8: Note that -l accepts -g in addition to -d and -u

Fixes: 5533c5046ada ifconfig.8: Update -l synopsis
MFC after: 3 days

2 years ago[linprocfs] add sys/kernel/random/boot_id
Fernando Apesteguía [Tue, 8 Mar 2022 14:19:53 +0000 (15:19 +0100)]
[linprocfs] add sys/kernel/random/boot_id

This file holds a UUID that is invariant for every boot. In our case, it is
invariant per mount.

PR: 262369
Reported by: sodynet1@gmail.com
Approved by: dchagin@
Differential Revision: https://reviews.freebsd.org/D34860

2 years agopf: drain Ethernet rules cleanup before starting a new transaction
Kristof Provost [Wed, 6 Apr 2022 15:03:13 +0000 (17:03 +0200)]
pf: drain Ethernet rules cleanup before starting a new transaction

Inactive Ethernet rules get cleaned by a net_epoch callback. This
callback may still be pending when we try to start a new (pf rules)
transaction, causing it to fail.
This is especially likely to occur in scripted scenarios, such as the
regression tests.

Drain the epoch callbacks before starting a new transaction, ensuring
we've had the opportunity to clean up the inactive rules.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D34846

2 years agoif_axgbe: properly release resource in error case
Tong Zhang [Mon, 11 Apr 2022 13:51:53 +0000 (09:51 -0400)]
if_axgbe: properly release resource in error case

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

2 years agoFix ipfw fwd that doesn't work in some cases
Andrey V. Elsukov [Fri, 1 Apr 2022 13:49:25 +0000 (16:49 +0300)]
Fix ipfw fwd that doesn't work in some cases

For IPv4 use dst pointer as destination address in fib4_lookup().
It keeps destination address from IPv4 header and can be changed
when PACKET_TAG_IPFORWARD tag was set by packet filter.

For IPv6 override destination address with address from dst_sa.sin6_addr,
that was set from PACKET_TAG_IPFORWARD tag.

Reviewed by: eugen
MFC after: 1 week
PR: 256828, 261697, 255705
Differential Revision: https://reviews.freebsd.org/D34732

2 years agoipfw: fix matching and setting DSCP value for IPv6
Andrey V. Elsukov [Wed, 6 Apr 2022 18:43:50 +0000 (21:43 +0300)]
ipfw: fix matching and setting DSCP value for IPv6

Matching for DSCP codes has used incorrect bits. Use IPV6_DSCP()
macro for matching opcodes to fix this. Also this leads to always
use value from a mbuf instead of cached value.

Previously different opcodes have used both cached in f_id value
and stored in the mbuf, and it did not always work after setdscp
action, since cached value was not updated.

Update IPv6 flowid value cached in the f_id.flow_id6 when we do
modification of DSCP value in O_SETDSCP opcode, it may be used by
external modules.

Also added logging support for O_SETDSCP opcode.

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34807

2 years agoFix OID format for `vm.swap_reserved` and `vm.swap_total`
Enji Cooper [Mon, 11 Apr 2022 01:17:09 +0000 (18:17 -0700)]
Fix OID format for `vm.swap_reserved` and `vm.swap_total`

The correct OID format for CTLTYPE_U64 is `QU` (`uquad_t`), not `A`
(text expressed via `char *`).

This issue was noticed while doing an sysctl tree walk using a
sysctl(9) consumer that relies on the OID format to intuit what the
type should be for a given sysctl.

MFC after: 1 month
Sponsored by: DellEMC Isilon
Differential Revision: https://reviews.freebsd.org/D34877