]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
21 months agoelf_note_prpsinfo: handle more failures from proc_getargv()
Konstantin Belousov [Fri, 3 Jun 2022 08:21:23 +0000 (11:21 +0300)]
elf_note_prpsinfo: handle more failures from proc_getargv()

Resulting sbuf_len() from proc_getargv() might return 0 if user mangled
ps_strings enough. Also, sbuf_len() API contract is to return -1 if the
buffer overflowed. The later should not occur because get_ps_strings()
checks for catenated length, but check for this subtle detail explicitly
as well to be more resilent.

The end result is that p_comm is used in this situations.

Approved by: so
Security: FreeBSD-SA-22:09.elf
Reported by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: delphij, markj
admbugs: 988
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35391

21 months agorelease: ensure enforce_chs sysctl is 0
Ed Maste [Tue, 19 Jul 2022 20:47:49 +0000 (16:47 -0400)]
release: ensure enforce_chs sysctl is 0

We do not want CHS-based alignment for VM or SD card release images.

(Other images use makefs/mkimg, not kernel gpart and so do not depend
on this sysctl.)

Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week

21 months agoAdd "heard" to the dictionary
Ed Maste [Mon, 8 Aug 2022 18:57:32 +0000 (14:57 -0400)]
Add "heard" to the dictionary

PR: 265671
Reported by: J.R. Oldroyd
MFC after: 3 days

21 months agoAdd the PHY driver for the Marvell 88E1512.
Luiz Souza [Fri, 29 Jul 2022 15:43:56 +0000 (17:43 +0200)]
Add the PHY driver for the Marvell 88E1512.

This driver supports the auto negotiation mode between the copper and fiber
ports.

This PHY has two independent PHYs (one for copper and other for fiber) but in
this case the functionality is presented as a single PHY for easy management.

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

21 months agoif_ovpn tests: remote access test case
Kristof Provost [Thu, 28 Jul 2022 09:55:53 +0000 (11:55 +0200)]
if_ovpn tests: remote access test case

Add a (multi-client) test case where we route traffic beyond the ovpn
server, onto a shared LAN.

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

21 months agonetinet tests: Add test for IPv6 mapped-v4 bind problem
Mike Karels [Tue, 9 Aug 2022 12:08:09 +0000 (07:08 -0500)]
netinet tests: Add test for IPv6 mapped-v4 bind problem

Test fix in 637f317c6d9c, verifying that when ports run out, we get
an EADDRNOTAVAIL error from bind() rather than an EADDRINUSE error
from connect().  Use small port range to exhaust ports and see which
error happens.

Reviewed by: tuexen, glebius, melifaro
Differential Revision: https://reviews.freebsd.org/D36056
MFC after: 3 days (with 637f317c6d9c)

21 months agolibpathconv: bump man page dates
Gordon Bergling [Tue, 9 Aug 2022 08:05:31 +0000 (10:05 +0200)]
libpathconv: bump man page dates

- bump the man page dates to the date of mandoc fixes

Reported by: rpokala
X-MFC with: 094517119c62c23369d545a7475ae982d86330a3

21 months agox86: Remove redundant parentheses
Emmanuel Vadot [Tue, 9 Aug 2022 07:46:50 +0000 (09:46 +0200)]
x86: Remove redundant parentheses

Reported by: avg
Sponsored by: Beckhoff Automation GmbH & Co. KG
MFC after: 1 week
MFC-With: b223c1f1a0ac ("x86: Add another cpuid for Apollo Lake errata APL30")

21 months agox86: Add another cpuid for Apollo Lake errata APL30
Corvin Köhne [Tue, 9 Aug 2022 07:07:59 +0000 (09:07 +0200)]
x86: Add another cpuid for Apollo Lake errata APL30

Sponsored by: Beckhoff Automation GmbH & Co. KG
MFC after: 1 week

21 months agosyslog(3): unbreak log generation using fabricated PID
Eugene Grosbein [Mon, 8 Aug 2022 22:21:02 +0000 (05:21 +0700)]
syslog(3): unbreak log generation using fabricated PID

Recover application ability to supply fabricated PID
embedded into ident that was lost when libc switched
to generation of RFC 5424 log messages, for example:

logger -t "ident[$$]" -p user.notice "test"

It is essential for long running scripts.
Also, this change unbreaks matching resulted entries
by ident in syslog.conf:

!ident
*.* /var/log/ident.log

Without the fix, the log (and matching) was broken:

Aug  1 07:36:58 hostname ident[123][86483]: test

Now it works as expected and worked before breakage:

Aug  1 07:39:40 hostname ident[123]: test

Differential: https://reviews.freebsd.org/D36005
MFC after: 2 weeks

21 months agotests/socket: add accept_filter(9) test
Gleb Smirnoff [Mon, 8 Aug 2022 21:10:18 +0000 (14:10 -0700)]
tests/socket: add accept_filter(9) test

Test basic functionality of accf_data(9) and accf_http(9)

21 months agoapply: clean up error handling.
Dag-Erling Smørgrav [Mon, 8 Aug 2022 19:06:35 +0000 (19:06 +0000)]
apply: clean up error handling.

Sponsored by: Klara, Inc.

21 months agolinuxkpi: io.h: Only exclude armv6 and armv7 for asm/set_memory.h
Emmanuel Vadot [Mon, 8 Aug 2022 18:21:08 +0000 (20:21 +0200)]
linuxkpi: io.h: Only exclude armv6 and armv7 for asm/set_memory.h

Other arches like powerpc* needs it.

Fixes: d387a1b4b1996 ("linuxkpi: io.h: Do not include asm/set_memory.h for armv6 and armv7")
Fixes: 789dbdbb48574 ("linuxkpi: Add arch_io_{reserve,free}_memtype_wc")
Sponsored by: Beckhoff Automation GmbH & Co. KG

21 months agoktls_test: Add a require_toe option similar to require_ifnet.
John Baldwin [Mon, 8 Aug 2022 18:21:54 +0000 (11:21 -0700)]
ktls_test: Add a require_toe option similar to require_ifnet.

This skips tests that send and receive records that do not use TOE TLS.

Sponsored by: Chelsio Communications

21 months agocxgbe TOE TLS: Fix handling of unusual record types.
John Baldwin [Mon, 8 Aug 2022 18:21:54 +0000 (11:21 -0700)]
cxgbe TOE TLS: Fix handling of unusual record types.

This doesn't matter for real traffic but fixes failures in the KTLS
unit tests that use unusual record types.

Sponsored by: Chelsio Communications

21 months agocxgbe TOE TLS: Simplify a few routines.
John Baldwin [Mon, 8 Aug 2022 18:21:54 +0000 (11:21 -0700)]
cxgbe TOE TLS: Simplify a few routines.

Remove a few more remnants from the old pre-KTLS support and instead
assume that each work request sends a single TLS record.

Sponsored by: Chelsio Communications

21 months agocxgbe: Handle requests for TLS key allocations with no TLS key storage.
John Baldwin [Mon, 8 Aug 2022 18:21:54 +0000 (11:21 -0700)]
cxgbe: Handle requests for TLS key allocations with no TLS key storage.

If an adapter advertises support for TLS keys but an empty TLS key
storage area in on-board memory, fail the request rather than invoking
vmem_alloc on an uninitialized vmem.

Sponsored by: Chelsio Communications

21 months agocxgbe: Rename t4_kern_tls.c to t6_kern_tls.c.
John Baldwin [Mon, 8 Aug 2022 18:21:53 +0000 (11:21 -0700)]
cxgbe: Rename t4_kern_tls.c to t6_kern_tls.c.

This implementation of NIC TLS is specific to T6 adapters.

Sponsored by: Chelsio Communications

21 months agozlib: Fix extra field processing bug that dereferences NULL state->head.
Mark Adler [Mon, 8 Aug 2022 17:50:09 +0000 (10:50 -0700)]
zlib: Fix extra field processing bug that dereferences NULL state->head.

The recent commit to fix a gzip header extra field processing bug
introduced the new bug fixed here.

(cherry picked from zlib commit 1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d)

21 months agolinuxkpi: io.h: Do not include asm/set_memory.h for armv6 and armv7
Emmanuel Vadot [Mon, 8 Aug 2022 16:54:23 +0000 (18:54 +0200)]
linuxkpi: io.h: Do not include asm/set_memory.h for armv6 and armv7

They do not have the same pmap api and this cannot work for those arch.

Fixes: 789dbdbb48574 ("linuxkpi: Add arch_io_{reserve,free}_memtype_wc")
Sponsored by: Beckhoff Automation GmbH & Co. KG

21 months agoMerge libcxxrt commit 5d8a15823a103bbc27f1bfdcf2b5aa008fab57dd
Mark Johnston [Mon, 8 Aug 2022 16:30:56 +0000 (12:30 -0400)]
Merge libcxxrt commit 5d8a15823a103bbc27f1bfdcf2b5aa008fab57dd

  Fix two bugs in __cxa_end_cleanup()

  Per the EHABI32 specification, __cxa_end_cleanup must take care to
  preserve registers before calling _Unwind_Resume().  So, libcxxrt uses
  an assembly stub which preserves caller-saved registers around the call
  to __cxa_get_cleanup().  But:
  - it failed to restore them properly,
  - it did not preserve the link register.

  Fix both of these problems.  This is needed to fix exception unwinding
  on FreeBSD with LLVM 14.  Note that r4 is callee-saved but is pushed
  onto the stack to preserve stack pointer alignment.

Sponsored-by: The FreeBSD Foundation
MFC after: 1 week

21 months agolib9p: Remove potential buffer overwrite in l9p_puqids()
Konrad Sewiłło-Jopek [Mon, 8 Aug 2022 16:25:48 +0000 (12:25 -0400)]
lib9p: Remove potential buffer overwrite in l9p_puqids()

Structure l9p_f_wralk reserves at most L9P_MAX_WELEM entries
and that number actually set the maximum we can safely use.

PR: 265385
Reviewed by: markj
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D35907

21 months agothread_create(): call cpu_copy_thread() after td_pflags is zeroed
Konstantin Belousov [Sun, 7 Aug 2022 17:00:02 +0000 (20:00 +0300)]
thread_create(): call cpu_copy_thread() after td_pflags is zeroed

By calling the function too early we might still have the td_pflags
value cached from the previous struct thread use. cpu_copy_thread()
depends on correct value for TDP_KTHREAD at least on x86.

Reported, bisected, and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36069

21 months agopf: stop resolving hosts as dns that use ":" modifier
Franco Fichtner [Mon, 8 Aug 2022 16:31:02 +0000 (18:31 +0200)]
pf: stop resolving hosts as dns that use ":" modifier

When the interface does not exist avoid passing host with special pf
modifiers to DNS resolution as they come up empty anyway.

Reviewed by: kp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35429

21 months agorelease: fix alignment for arm SoCs
Glen Barber [Mon, 8 Aug 2022 14:59:29 +0000 (10:59 -0400)]
release: fix alignment for arm SoCs

MFC after: 3 days
Submitted by: Mark Millard
Sponsored by: Rubicon Communications, LLC ("Netgate")

21 months agoBump __FreeBSD_version after linuxkpi changes.
Emmanuel Vadot [Mon, 8 Aug 2022 13:22:11 +0000 (15:22 +0200)]
Bump __FreeBSD_version after linuxkpi changes.

21 months agolinuxkpi: pm: Add more defines and includes
Emmanuel Vadot [Tue, 2 Aug 2022 08:49:13 +0000 (10:49 +0200)]
linuxkpi: pm: Add more defines and includes

Needed by drm-kmod.

Reviewed By: emaste, hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36024

21 months agolinuxkpi: Include highmem.h in pagemap.h
Emmanuel Vadot [Tue, 2 Aug 2022 08:42:46 +0000 (10:42 +0200)]
linuxkpi: Include highmem.h in pagemap.h

Linux does the same.

Reviewed by: bz, emaste, hselasky
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36023

21 months agolinuxkpi: Add arch_io_{reserve,free}_memtype_wc
Emmanuel Vadot [Tue, 2 Aug 2022 08:27:00 +0000 (10:27 +0200)]
linuxkpi: Add arch_io_{reserve,free}_memtype_wc

Reviewed by: hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36022

21 months agolinuxkpi: Add dev_info_once
Emmanuel Vadot [Tue, 2 Aug 2022 08:22:59 +0000 (10:22 +0200)]
linuxkpi: Add dev_info_once

Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36021

21 months agolinuxkpi: Add smp_mb__before/after_atomic
Emmanuel Vadot [Tue, 2 Aug 2022 08:08:33 +0000 (10:08 +0200)]
linuxkpi: Add smp_mb__before/after_atomic

Reviewed by: hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36020

21 months agolinuxkpi: Add trylock_page and unlock_page
Emmanuel Vadot [Tue, 2 Aug 2022 07:33:47 +0000 (09:33 +0200)]
linuxkpi: Add trylock_page and unlock_page

Simple wrapper around vm_page_trylock and vm_page_unlock.

Reviewed by: hselasky
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36019

21 months agolinuxkpi: Add more notifier defines
Emmanuel Vadot [Wed, 27 Jul 2022 07:55:06 +0000 (09:55 +0200)]
linuxkpi: Add more notifier defines

Needded by drm-kmod.

Reviewed by: bz, emaste, hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36018

21 months agolinuxkpi: errno: Add EHWPOISON
Emmanuel Vadot [Wed, 27 Jul 2022 07:50:25 +0000 (09:50 +0200)]
linuxkpi: errno: Add EHWPOISON

Needed by drm-kmod.

Reviewed by: bz, hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36017

21 months agolinuxkpi: Add compat_ptr and ptr_to_compat
Emmanuel Vadot [Wed, 27 Jul 2022 07:48:32 +0000 (09:48 +0200)]
linuxkpi: Add compat_ptr and ptr_to_compat

Needed by drm-kmod.

Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36016

21 months agolinuxkpi: Add try_cmpxchg and atomic_try_cmpxchg
Emmanuel Vadot [Wed, 27 Jul 2022 07:41:04 +0000 (09:41 +0200)]
linuxkpi: Add try_cmpxchg and atomic_try_cmpxchg

Needed by drm-kmod

Obtain from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36015

21 months agolinuxkpi: Add some memset functions
Emmanuel Vadot [Tue, 26 Jul 2022 09:28:11 +0000 (11:28 +0200)]
linuxkpi: Add some memset functions

Needed by drm-kmod

Obtained from: OpenBSD
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35943

21 months agolinuxkpi: Add io.h
Emmanuel Vadot [Tue, 26 Jul 2022 08:15:45 +0000 (10:15 +0200)]
linuxkpi: Add io.h

out* arguments are different on Linux and the i915 driver uses them.

Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35942

21 months agolinuxkpi: Add pagevec implementation
Emmanuel Vadot [Tue, 26 Jul 2022 08:15:12 +0000 (10:15 +0200)]
linuxkpi: Add pagevec implementation

Needed by drm-kmod.

Reviewed by: hselasky
Obtained from: OpenBSD
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35941

21 months agolinuxkpi: Add linux/nospec.h
Emmanuel Vadot [Tue, 26 Jul 2022 08:13:49 +0000 (10:13 +0200)]
linuxkpi: Add linux/nospec.h

Needed by drm-kmod.

Reviewed by: hselasky
Obtained from: OpenBSD
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35940

21 months agolinuxkpi: Add mapping_clear_unevictable stub
Emmanuel Vadot [Tue, 26 Jul 2022 08:13:16 +0000 (10:13 +0200)]
linuxkpi: Add mapping_clear_unevictable stub

Reviewed by: hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35939

21 months agolinuxkpi: pci: Add more functions needed by drm
Emmanuel Vadot [Tue, 26 Jul 2022 08:07:39 +0000 (10:07 +0200)]
linuxkpi: pci: Add more functions needed by drm

Mostly stubs to satisfy building

Reviewed by: hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35938

21 months agolinuxkpi: math.h: Add mul_u64_u32_div and mul_u64_u32_shr
Emmanuel Vadot [Tue, 26 Jul 2022 08:06:56 +0000 (10:06 +0200)]
linuxkpi: math.h: Add mul_u64_u32_div and mul_u64_u32_shr

Needed by drm-kmod.

Reviewed by: hselasky
Obtained from: OpenBSD
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35937

21 months agolinuxkpi: atomic: Add atomic_fetch_inc
Emmanuel Vadot [Tue, 26 Jul 2022 08:00:42 +0000 (10:00 +0200)]
linuxkpi: atomic: Add atomic_fetch_inc

Reviewed by: hselasky
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35936

21 months agopfctl tests: test case for the POM_STICKYADDRESS fix
Kristof Provost [Mon, 8 Aug 2022 07:30:42 +0000 (09:30 +0200)]
pfctl tests: test case for the POM_STICKYADDRESS fix

In 1e73fbd8b we fixed an issue with POM_STICKYADDRESS being checked in
the wrong struct.
Add a basic test case for this fix.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

21 months agoAdd drive strength setting for RK3568 pinctrl driver.
Ganbold Tsagaankhuu [Mon, 8 Aug 2022 04:42:22 +0000 (04:42 +0000)]
Add drive strength setting for RK3568 pinctrl driver.
Partially from https://reviews.freebsd.org/D36027

Submitted by: sos

21 months agortw88: correct a typo in man page
Andres Ramirez [Sun, 7 Aug 2022 23:06:28 +0000 (23:06 +0000)]
rtw88: correct a typo in man page

s/mmeory/memory/

MFC after: 1 week

21 months agoXHCI: remove a self-assignment
Bjoern A. Zeeb [Sun, 7 Aug 2022 22:46:55 +0000 (22:46 +0000)]
XHCI: remove a self-assignment

x = x is an unneeded operation, remove it.
The value is read and assigned above for real.

MFC after: 4 weeks

21 months agotests: add routing tests for switching between same prefixes
Alexander V. Chernikov [Sat, 6 Aug 2022 10:36:12 +0000 (10:36 +0000)]
tests: add routing tests for switching between same prefixes

Differential Revision: https://reviews.freebsd.org/D36055
MFC after: 2 weeks

21 months agotree.3: explain RB_FIND() and RB_NFIND()
Konstantin Belousov [Mon, 1 Aug 2022 09:43:10 +0000 (12:43 +0300)]
tree.3: explain RB_FIND() and RB_NFIND()

In collaboration with: dougm
Reviewed by: alc
Sponsored by: The FreeBSD Foundation (kib)
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D36001

21 months agotree.3: fix markup
Konstantin Belousov [Tue, 2 Aug 2022 22:26:12 +0000 (01:26 +0300)]
tree.3: fix markup

Reviewed by: alc, dougm
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D36001

21 months agotcp_input: update comment to match reality.
Gleb Smirnoff [Sun, 7 Aug 2022 18:18:30 +0000 (11:18 -0700)]
tcp_input: update comment to match reality.

21 months agomfiutil.8: Fix some mandoc warnings
Gordon Bergling [Sun, 7 Aug 2022 15:24:48 +0000 (17:24 +0200)]
mfiutil.8: Fix some mandoc warnings

- new sentence, new line
- no blank before trailing delimiter

MFC after: 3 days

21 months agolibutil: Fix mandoc warnings
Gordon Bergling [Sun, 7 Aug 2022 14:30:24 +0000 (16:30 +0200)]
libutil: Fix mandoc warnings

- missing comma before name
- possible typo in section name: Sh CAVEAT instead of CAVEATS
- useless macro: Tn
- blank line in fill mode, using .sp
- no blank before trailing delimiter: Dv NULL?

MFC after: 3 days

22 months agovnode(9): Fix a typo in a source code comment
Gordon Bergling [Sun, 7 Aug 2022 14:08:43 +0000 (16:08 +0200)]
vnode(9): Fix a typo in a source code comment

- s/paramater/parameter/

MFC after: 3 days

22 months agodebugnet: Fix a typo in a source code comment
Gordon Bergling [Sun, 7 Aug 2022 14:07:01 +0000 (16:07 +0200)]
debugnet: Fix a typo in a source code comment

- s/paramaters/parameters/

MFC after: 3 days

22 months agoisci(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 7 Aug 2022 14:05:08 +0000 (16:05 +0200)]
isci(4): Fix a typo in a source code comment

- s/paramater/parameter/

MFC after: 3 days

22 months agonet80211(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 7 Aug 2022 14:00:07 +0000 (16:00 +0200)]
net80211(4): Fix a typo in a source code comment

- s/paramaters/parameters/

MFC after: 3 days

22 months agobsd-family-tree: fix a typo for NetBSD 9.3 release date
Sergey A. Osokin [Sun, 7 Aug 2022 13:57:14 +0000 (09:57 -0400)]
bsd-family-tree: fix a typo for NetBSD 9.3 release date

Reported by: Adrian Steinmann <ast@NetBSD.org>
Fixes: a3d933cc4f2300b476151c2dd3fa455882f3aa97
MFC after: 3 days

22 months agoacpi(4): Fix two typos in a source code comments
Gordon Bergling [Sun, 7 Aug 2022 13:58:04 +0000 (15:58 +0200)]
acpi(4): Fix two typos in a source code comments

- s/paramater/parameter/

MFC after: 3 days

22 months agolibpathconv: Fix mandoc warnings in abs2rel(3) and rel2abs(3)
Gordon Bergling [Sun, 7 Aug 2022 12:53:53 +0000 (14:53 +0200)]
libpathconv: Fix mandoc warnings in abs2rel(3) and rel2abs(3)

- cannot parse date, using it verbatim: Dec 15, 1997"
- sections out of conventional order: Sh SEE ALSO
- possible typo in section name: Sh EXAMPLE instead of EXAMPLES
- AUTHORS section without An macro

MFC after: 3 days

22 months agoinet6(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 7 Aug 2022 12:20:52 +0000 (14:20 +0200)]
inet6(4): Fix a typo in a source code comment

- s/Unreachablity/Unreachability/

MFC after: 3 days

22 months agonullfs(5): Fix a typo in a source code comment
Gordon Bergling [Sun, 7 Aug 2022 12:04:53 +0000 (14:04 +0200)]
nullfs(5): Fix a typo in a source code comment

- s/examing/examining/

MFC after: 3 days

22 months agostress2: Added another fsck_ffs test scenario
Peter Holm [Sun, 7 Aug 2022 08:37:17 +0000 (10:37 +0200)]
stress2: Added another fsck_ffs test scenario

22 months agostress2: Do not run a fuzz test as root.
Peter Holm [Sun, 7 Aug 2022 08:35:47 +0000 (10:35 +0200)]
stress2: Do not run a fuzz test as root.

22 months agobsd-family-tree: add NetBSD 9.3
Sergey A. Osokin [Sat, 6 Aug 2022 19:02:42 +0000 (15:02 -0400)]
bsd-family-tree: add NetBSD 9.3

Add NetBSD 9.3, it's been released two days ago.

MFC after: 3 days

22 months agobsd-family-tree: OpenBSD 7.1 and DragonFly BSD 6.2.2
Sergey A. Osokin [Sat, 6 Aug 2022 18:56:22 +0000 (14:56 -0400)]
bsd-family-tree: OpenBSD 7.1 and DragonFly BSD 6.2.2

Add two releases to the tree.

MFC after: 3 days

22 months agoiommu_gas: avoid pointless augmentation
Doug Moore [Sat, 6 Aug 2022 18:26:18 +0000 (13:26 -0500)]
iommu_gas: avoid pointless augmentation

iommu_gas_augment_entry updates a map entry element. Invoked as
RB_AUGMENT in RB tree code, it is applied from the point where the
tree is modified, all the way up to the root, and is also applied when
rotation moves a node down in the tree.

There are several opportunities to invoke it less. The automatic
augmentation with every rotation is a mistake.  Delaying these
augmentations until RB_INSERT_COLOR or RB_REMOVE_COLOR are finishing
allows the augmentation code to be duplicated less, to work when there
is less register pressure, and to be skipped when conditions allow it:

    In the double-rotate case of RB_INSERT_COLOR, augmentation after
    the first rotation is not necessary when the element being moved
    down the tree becomes a leaf. It was in the tree, and was a leaf,
    before the RB_INSERT operation began, and so recomputing
    augmentation for it would do nothing.

    In the final (possibly only) rotation of RB_REMOVE_COLOR, both the
    elements - the one moving up and the one moving down - end up in
    the path from the deletion point to the tree root, so there's no
    need to augment either of them immediately.

    In RB_REMOVE, when the right child of the removed node replaces it
    in tree, it began with a null left child. Replacement creates a
    non-NULL left child, and then rotation may put a NULL node back in
    that place. If that happens, start the augmenting-up-to-root with
    the parent of that node, since augmentation would do nothing.

Adjust to avoid these needless augmentations.

Reviewed by: alc
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D35502

22 months agox86/iommu: Reduce the number of queued invalidation interrupts
Alan Cox [Sun, 31 Jul 2022 19:28:30 +0000 (14:28 -0500)]
x86/iommu: Reduce the number of queued invalidation interrupts

Restructure dmar_qi_task() so as to reduce the number of invalidation
completion interrupts.  Specifically, because processing completed
invalidations in dmar_qi_task() can take quite some time, don't reenable
completion interrupts until processing has completed a first time. Then,
check a second time after reenabling completion interrupts, so that
any invalidations that complete just before interrupts are reenabled
do not linger until a future invalidation might raise an interrupt.
(Recent changes have made checking for completed invalidations cheap; no
locking is required.)

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36054

22 months agopowerpc/booke: Clamp MAXCPU to 32 for Book-E platforms
Justin Hibbits [Sat, 6 Aug 2022 15:35:44 +0000 (11:35 -0400)]
powerpc/booke: Clamp MAXCPU to 32 for Book-E platforms

Since the likelihood of new Book-E PowerPC SoCs being produced is near
zero clamp MAXCPU to around the highest number of cores/threads
available currently, for both 64-bit and 32-bit.  Even though the
current highest core/thread count is 24, the cap is set at 32 in case
there is code that assumes power of 2.

22 months agopfctl: fix FOM_ICMP/POM_STICKYADDRESS clash
Franco Fichtner [Sat, 6 Aug 2022 08:59:56 +0000 (10:59 +0200)]
pfctl: fix FOM_ICMP/POM_STICKYADDRESS clash

pass inet proto icmp icmp-type {unreach}
pass route-to (if0 127.0.0.1/8) sticky-address inet

The wrong struct was being tested. The parser tries to prevent
"sticky-address sticky-address" syntax but was actually cross-rule
enforcing that ICMP filter cannot be before the use of "sticky-address"
in next rule.

MFC after: 2 weeks
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D36050

22 months agofib_algo: set vnet when destroying algo instance
Alexander V. Chernikov [Sat, 6 Aug 2022 12:44:44 +0000 (12:44 +0000)]
fib_algo: set vnet when destroying algo instance

Reported by: Konrad Kręciwilk <konrad.kreciwilk@korbank.pl>
MFC after: 2 weeks

22 months agobce(4): Fix two typos in kernel messages
Gordon Bergling [Sat, 6 Aug 2022 09:32:29 +0000 (11:32 +0200)]
bce(4): Fix two typos in kernel messages

- s/bufferred/buffered/

MFC after: 3 days

22 months agounbound: Update version to 1.16.2
Cy Schubert [Sat, 6 Aug 2022 08:59:22 +0000 (01:59 -0700)]
unbound: Update version to 1.16.2

Chase 790c6b245151 to update the version to 1.16.2.

Reported by: "Herbert J. Skuhra" <herbert@gojira.at>
MFC after: 3 days
X-MFC with: 790c6b245151

22 months agonet80211: Remove tautological state display
Cy Schubert [Tue, 19 Jul 2022 04:10:40 +0000 (21:10 -0700)]
net80211: Remove tautological state display

When printing the current state name and the old state numeric value,
both are always the same. Remove the redundant ostate. It is always
the same as iv_state.

Reviewed by: bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35849

22 months agounbound: Vendor import 1.16.2
Cy Schubert [Sat, 6 Aug 2022 01:44:40 +0000 (18:44 -0700)]
unbound: Vendor import 1.16.2

Security update to unbound.

PR:             265645
Security:       CVE-2022-30698, CVE-2022-30699
Security:       bc43a578-14ec-11ed-856e-d4c9ef517024
MFC after:      3 days

Merge commit '9b76d32f2310b735dbeb896cbf2776cad61f23e8' into main

22 months agobpf: Fix BIOCPROMISC locking
Mark Johnston [Fri, 5 Aug 2022 20:25:05 +0000 (16:25 -0400)]
bpf: Fix BIOCPROMISC locking

BPF might put an interface in promiscuous mode when handling the
BIOCSDLT ioctl.  When this happens, a flag is set in the BPF descriptor
so that the old interface can be restored when the BPF descriptor is
destroyed.

The BIOCPROMISC ioctl can also be used to put a BPF descriptor's
interface into promiscuous mode, but there was nothing synchronizing the
flag.  Fix this by modifying the ioctl handler to acquire the global BPF
mutex, which is used to synchronize ifpromisc() calls elsewhere in BPF.

Reviewed by: kp, melifaro
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36045

22 months agoarm: Clear TTBCR before enabling the MMU
Mark Johnston [Fri, 5 Aug 2022 20:21:09 +0000 (16:21 -0400)]
arm: Clear TTBCR before enabling the MMU

Upon reset, this register is supposed to have a value of zero.  But when
booting certain v7 CPUs in QEMU, we enter the kernel with several bits
set, including the EAE bit, which enables ARM's PAE extension.  I'm not
sure if QEMU is setting it or if it's the uboot loader.  Because FreeBSD
doesn't implement that extension and uses regular 32-bit page tables,
the kernel hangs immediately after enabling the MMU.

Just clear everything in TTBCR before enabling the MMU, to match the
reset value.  FreeBSD doesn't toggle anything in that register.

PR: 251187
Reviewed by: imp
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36041

22 months agounbound: Vendor import 1.16.2
Cy Schubert [Fri, 5 Aug 2022 20:02:55 +0000 (13:02 -0700)]
unbound: Vendor import 1.16.2

Security update to unbound.

PR: 265645
Security: CVE-2022-30698, CVE-2022-30699
Security: bc43a578-14ec-11ed-856e-d4c9ef517024

22 months agoacpi_apei: Add sysctl to mute corrected errors.
Alexander Motin [Fri, 5 Aug 2022 17:45:35 +0000 (13:45 -0400)]
acpi_apei: Add sysctl to mute corrected errors.

Setting hw.acpi.apei.log_corrected to 0 will mute corrected errors logging.

MFC after: 1 week

22 months agomca: Add sysctl to mute corrected errors.
Alexander Motin [Fri, 5 Aug 2022 17:40:57 +0000 (13:40 -0400)]
mca: Add sysctl to mute corrected errors.

Setting hw.mca.log_corrected to 0 will mute corrected errors logging
except ones marked as reaching Yellow threshold by hardware.

MFC after: 1 week

22 months agoRELNOTES: Document ZFS support in makefs
Mark Johnston [Fri, 5 Aug 2022 17:31:14 +0000 (13:31 -0400)]
RELNOTES: Document ZFS support in makefs

Sponsored by: The FreeBSD Foundation

22 months agomakefs: Add ZFS support
Mark Johnston [Fri, 5 Aug 2022 17:07:54 +0000 (13:07 -0400)]
makefs: Add ZFS support

This allows one to take a staged directory tree and create a file
consisting of a ZFS pool with one or more datasets that contain the
contents of the directory tree.  This is useful for creating virtual
machine images without using the kernel to create a pool; "zpool create"
requires root privileges and currently is not permitted in jails.
makefs -t zfs also provides reproducible images by using a fixed seed
for pseudo-random number generation, used for generating GUIDs and hash
salts.  makefs -t zfs requires relatively little by way of machine
resources.

The "zpool_reguid" rc.conf setting can be used to ask a FreeBSD guest to
generate a unique pool GUID upon first boot.

A small number of pool and dataset properties are supported.  The pool
is backed by a single disk vdev.  Data is always checksummed using
Fletcher-4, no redundant copies are made, and no compression is used.
The manual page documents supported pool and filesystem properties.

The implementation uses a few pieces of ZFS support from with the boot
loader, especially definitions for various on-disk structures, but is
otherwise standalone and in particular doesn't depend on OpenZFS.

This feature should be treated as experimental for now, i.e., important
data shouldn't be trusted to a makefs-created pool, and the command-line
interface is subject to change.

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

22 months agobsdinstall: allow setting the root password via env variables
Brad Davis [Fri, 5 Aug 2022 15:10:21 +0000 (09:10 -0600)]
bsdinstall: allow setting the root password via env variables

Reviewed by: 0mp, allanjude, asiciliano, dteske, pauamma, rpokala, sef
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35588

22 months agonvme: Print CRD, M and DNR status bits on errors.
Alexander Motin [Fri, 5 Aug 2022 14:58:19 +0000 (10:58 -0400)]
nvme: Print CRD, M and DNR status bits on errors.

It may help with some issues debugging.

MFC after: 1 week

22 months agoRemove "All rights reserved" where I can in libc
Andrew Turner [Fri, 5 Aug 2022 14:11:39 +0000 (15:11 +0100)]
Remove "All rights reserved" where I can in libc

These all have my copyright so can be removed. Some also have FreeBSD
Foundation copyright so drop from there as has been done for previous
files.

Sponsored by: The FreeBSD Foundation

22 months agoClarify code comments on ASLR default settings
Ed Maste [Fri, 5 Aug 2022 14:01:07 +0000 (10:01 -0400)]
Clarify code comments on ASLR default settings

Sponsored by: The FreeBSD Foundation

22 months agozlib: Fix a bug when getting a gzip header extra field with inflate().
Mark Adler [Sat, 30 Jul 2022 22:51:11 +0000 (15:51 -0700)]
zlib: Fix a bug when getting a gzip header extra field with inflate().

If the extra field was larger than the space the user provided with
inflateGetHeader(), and if multiple calls of inflate() delivered
the extra header data, then there could be a buffer overflow of the
provided space. This commit assures that provided space is not
exceeded.

(cherry picked from zlib commit eff308af425b67093bab25f80f1ae950166bece1)

22 months agopowerpc/fsl_sata: Properly clamp maxio to pessimized size
Justin Hibbits [Fri, 5 Aug 2022 01:28:21 +0000 (21:28 -0400)]
powerpc/fsl_sata: Properly clamp maxio to pessimized size

The CAM 'maxio' is a 'pessimized' size, assuming 4k pages and one page
per segment.  Since there are at most 63 segments in a transaction with
this driver, and one would necessarily be the indirect segment marker,
clamp the maxio to the minimum of maxphys (tunable) or (63 - 1) pages
(248k).

MFC after: 3 days

22 months agorenice: support -- as per POSIX.
Dag-Erling Smørgrav [Thu, 4 Aug 2022 23:50:00 +0000 (01:50 +0200)]
renice: support -- as per POSIX.

Sponsored by: Klara, Inc.
MFC after: 1 week

22 months agoDrop checks with last alternate superblock in fsck_ffs(8).
Kirk McKusick [Thu, 4 Aug 2022 23:06:43 +0000 (16:06 -0700)]
Drop checks with last alternate superblock in fsck_ffs(8).

The fsck_ffs(8) utility made sanity checks of critical superblock
fields by comparing the values of those fields in the standard
superblock againt the values of those fields in the last alternate
superblock. The code for validating a superblock now cover all the
checked fields as well as many more. Further the checks done are
far more comprehensive. So we now drop the alternate superblock
checks as they no longer provide value. Dropping these checks also
eliminates the need to read the alternate superblock.

22 months agolibc: drop "All rights reserved" from Foundation copyrights
Ed Maste [Thu, 4 Aug 2022 20:52:23 +0000 (16:52 -0400)]
libc: drop "All rights reserved" from Foundation copyrights

This has already been done for most files that have the Foundation as
the only listed copyright holder.  Do it now for files that list
multiple copyright holders, but have the Foundation copyright in its own
section.

Sponsored by: The FreeBSD Foundation

22 months ago[libm] Correct comments in s_cbrt[l].c
Steve Kargl [Thu, 4 Aug 2022 17:31:57 +0000 (19:31 +0200)]
[libm] Correct comments in s_cbrt[l].c

Damian McGuckin <damianm at esi dot com dot au> noted that the accuracy
claims in the code for cbrt(3) and cbrtl(3) were incorrect. Fix the
comments to more accurately describe the accuracies.

PR: 265603
MFC after: 3 days

22 months agohier.7: Document /var/db/freebsd-update
Mateusz Piotrowski [Thu, 4 Aug 2022 13:57:18 +0000 (15:57 +0200)]
hier.7: Document /var/db/freebsd-update

MFC after: 3 days
Sponsored by: Klara, Inc.

22 months agobridge tests: Tests using pft_ping.py require scapy
Mark Johnston [Thu, 4 Aug 2022 13:41:52 +0000 (09:41 -0400)]
bridge tests: Tests using pft_ping.py require scapy

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

22 months agofile: Move code to share fdtol structs into kern_descrip.c
Mark Johnston [Thu, 4 Aug 2022 13:39:25 +0000 (09:39 -0400)]
file: Move code to share fdtol structs into kern_descrip.c

This ensures the filedesc-to-leader code is consistently encapsulated in
kern_descrip.c.

No functional change intended.

Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35988

22 months agoqat: Move qat_c2xxx firmware files and build glue into separate dirs
Mark Johnston [Thu, 4 Aug 2022 13:37:55 +0000 (09:37 -0400)]
qat: Move qat_c2xxx firmware files and build glue into separate dirs

Reviewed by: Zdziarski, KrzysztofX <krzysztofx.zdziarski@intel.com>
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36032

22 months agoif_ovpn: fix unused functions with NOINET / NOINET6
Kristof Provost [Thu, 4 Aug 2022 08:13:09 +0000 (10:13 +0200)]
if_ovpn: fix unused functions with NOINET / NOINET6

ovpn_find_peer_by_ip() is not used if INET is not defined. Do not
define the function in that case. Same for ovpn_find_peer_by_ip6().

Fix these warnings:

/usr/src/sys/net/if_ovpn.c:1580:1: warning: unused function 'ovpn_find_peer_by_ip' [-Wunused-function]
ovpn_find_peer_by_ip(struct ovpn_softc *sc, const struct in_addr addr)
^
/usr/src/sys/net/if_ovpn.c:1599:1: warning: unused function 'ovpn_find_peer_by_ip6' [-Wunused-function]
ovpn_find_peer_by_ip6(struct ovpn_softc *sc, const struct in6_addr *addr)
^

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

22 months agohda: Add a patch for ASUS ROG GL553VE.
Gleb Popov [Mon, 1 Aug 2022 11:07:04 +0000 (14:07 +0300)]
hda: Add a patch for ASUS ROG GL553VE.

Summary:
This change enables headset detection on the laptop.

PR: 256169

Approved by: mav

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

22 months agorouting: remove duplicate error message after 5c23343b8c0c.
Alexander V. Chernikov [Thu, 4 Aug 2022 09:51:38 +0000 (09:51 +0000)]
routing: remove duplicate error message after 5c23343b8c0c.

MFC after: 2 weeks