Commit graph

267171 commits

Author SHA1 Message Date
Konstantin Belousov a2a905f4d0 ldconfig: use libexec/rtld-elf/rtld_paths.h
(cherry picked from commit af91158706)
2021-12-01 03:07:19 +02:00
Konstantin Belousov a95dbfaa3d rtld_paths.h: Provide _PATH_ELF32_HINTS string, unconditionally
(cherry picked from commit f340188625)
2021-12-01 03:07:19 +02:00
Konstantin Belousov 46e032b0b1 ldconfig(8): nostd/-s does nothing
(cherry picked from commit b828161d12)
2021-12-01 03:07:19 +02:00
Konstantin Belousov 00558493b7 ldconfig: start of cleanup
(cherry picked from commit 3f2c6f5598)
2021-12-01 03:07:19 +02:00
Konstantin Belousov 998529e594 ldconfig: remove a comment which is another remnant of a.out support
(cherry picked from commit 83511ce5c4)
2021-12-01 03:07:18 +02:00
Sergey A. Osokin 7af8903bf3 ktls.4: fix openssl-devel port name
PR:	259630
(cherry picked from commit b39a93b18e)
2021-11-30 17:45:44 -05:00
John Baldwin 1097f2f40d evdev: Add parentheses around '-' expression in operand of '&'.
This fixes a -Wparentheses error with GCC 9.

Reviewed by:	wulf
Differential Revision:	https://reviews.freebsd.org/D31947

(cherry picked from commit d99c87c8d5)
2021-12-01 00:45:30 +03:00
Wei Hu d11e9de955 Hyper-V: vPCI: Prepopulate device bars
In recent Hyper-V releases on Windows Server 2022, vPCI code does not
initialize the last 4 bit of device bar registers. This behavior change
could result weird problems cuasing PCI code failure when configuring
bars.

Just write all 1's to those bars whose probed values are not the same
as current read ones. This seems to make Hyper-V vPCI and
pci_write_bar() to cooperate correctly on these releases.

Reported by:	khng@freebsd.org
Tested by:	khng@freebsd.org
MFC after:	2 weeks
Sponsored by:	Microsoft

(cherry picked from commit 75412a521f)
2021-11-30 07:43:32 +00:00
Mark Johnston 5b5bbf2e7c sctp: Remove now-unneeded mb_unmapped_to_ext() calls
sctp_delayed_checksum() now handles unmapped mbufs, thanks to m_apply().

No functional change intended.

Reviewed by:	tuexen
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 756bb50b6a)
2021-11-29 20:35:20 -05:00
Mark Johnston 422456ae27 sctp: Use m_apply() to calcuate a checksum for an mbuf chain
m_apply() works on unmapped mbufs, so this will let us elide
mb_unmapped_to_ext() calls preceding sctp_calculate_cksum() calls in
the network stack.

Modify sctp_calculate_cksum() to assume it's passed an mbuf header.
This assumption appears to be true in practice, and we need to know the
full length of the chain.

No functional change intended.

Reviewed by:	tuexen, jhb
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit b4d758a0cc)
2021-11-29 20:35:08 -05:00
Mark Johnston 02e3eb8d48 mbuf: Only allow extpg mbufs if the system has a direct map
Some upcoming changes will modify software checksum routines like
in_cksum() to operate using m_apply(), which uses the direct map to
access packet data for unmapped mbufs.  This approach of course does not
work on platforms without a direct map, so we have to disallow the use
of unmapped mbufs on such platforms.

I believe this is the right tradeoff: we only configure KTLS on amd64
and arm64 today (and one KTLS consumer, NFS TLS, requires a direct map
already), and the use of unmapped mbufs with plain sendfile is a recent
optimization.  If need be, m_apply() could be modified to create
CPU-private mappings of extpg mbuf pages as a fallback.

So, change mb_use_ext_pgs to be hard-wired to zero on systems without a
direct map.  Note that PMAP_HAS_DMAP is not a compile-time constant on
some systems, so the default value of mb_use_ext_pgs has to be
determined during boot.

Reviewed by:	jhb
Discussed with:	gallatin
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit fcaa890c44)
2021-11-29 20:34:54 -05:00
Neel Chauhan 5c50e93e6c ext2fs: check for eh_depth in ext4_ext_check_header()
PR:			259112
Reported by:		Robert Morris <rtm@lcs.mit.edu>
Reviewed by:		fsu (src)
Differential Revision:	https://reviews.freebsd.org/D33030

(cherry picked from commit be60d8f276)
2021-11-29 09:56:42 -08:00
Artem Khramov 23566768d9 syslogd: fix WITHOUT_INET builds
Since 2d82b47 syslogd can't be built with `WITHOUT_INET` or
`WITHOUT_INET6` build variables set, because `iovlist_truncate` is not
defined but used.

This change wraps the problematic `iovlist_truncate` call within ifdef
directive.  It's compiled out in this situation...

Pull Request:	https://github.com/freebsd/freebsd-src/pull/475
Reviewed by:	imp@ (commit message slightly tweaked)

(cherry picked from commit f06fa6f887)

PR:		260098
2021-11-29 10:10:53 -05:00
Ed Maste 3c12222322 src.conf.5: regen 2021-11-29 10:10:53 -05:00
Ed Maste 7cc6e39cb6 Do not build libatf-c++ when WITHOUT_CXX
libatf-c++ requires C++ support.

From jrtc27: bit slightly odd this isn't gated by MK_TESTS (which itself
depends on MK_CXX), but this makes sense given the current behaviour.

Reported by:	Michael Dexter, Build Option Survey
Reviewed by:	imp, jrtc27
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32732

(cherry picked from commit 6ce99625ca)
2021-11-29 10:10:53 -05:00
Ed Maste 8bb7b159b5 src.opts.mk: Add WITHOUT_CXX dependencies
OFED, OPENMP, and PMC depend on C++ support.  Force them off when
building WITHOUT_CXX.

Reported by:	Michael Dexter, Build Option Survey
Reviewed by:	imp, jrtc27
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32730

(cherry picked from commit 0e1c864898)
2021-11-29 10:10:53 -05:00
Ed Maste 8f02234dbd Don't build sanitizer runtimes under WITHOUT_CXX
In the past we built the sanitizer runtimes when building Clang
(and using Clang as the compiler) but 7676b388ad changed this to
be conditional only on using Clang, to make the runtimes available
for external Clang.

They fail to build when WITHOUT_CXX is set though, so add MK_CXX
as part of the condition.

Reported by:	Michael Dexter, Build Option Survey
Reviewed by:	imp, jrtc27
Fixes:		7676b388ad ("Always build the sanitizer runtimes...")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32731

(cherry picked from commit ad09e2c8cf)
2021-11-29 10:10:53 -05:00
Kristof Provost 9bb3c824f5 net tests: basic if_gif(4) test case
MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32836

(cherry picked from commit 6e0755b37b)
2021-11-29 15:44:40 +01:00
Kristof Provost 60c3b9a78a if_gif: fix vnet shutdown panic
If an if_gif exists and has an address assigned inside a vnet when the
vnet is shut down we failed to clean up the address, leading to a panic
when we ip_destroy() and the V_in_ifaddrhashtbl is not empty.

This happens because of the VNET_SYS(UN)INIT order, which means we
destroy the if_gif interface before the addresses can be purged (and
if_detach() does not remove addresses, it assumes this will be done by
the stack teardown code).

Set subsystem SI_SUB_PSEUDO just like if_bridge so the cleanup
operations happen in the correct order.

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

(cherry picked from commit 8ca6c11a7c)
2021-11-29 15:44:39 +01:00
Mark Johnston d364adc09c Hoist cddl prebuild lib dependency definitions out of a MK_ZFS block
The compilation of several libraries under cddl/lib is not conditional
on MK_ZFS = "yes", so their dependency on libspl is not conditional
either.  Unbreak buildworld when WITHOUT_ZFS is set.

Reported by:	bz
Fixes:		9e9c651cac ("cddl: fix missing ZFS library dependencies")

(cherry picked from commit 7b3642da21)
2021-11-29 09:27:49 -05:00
Greg V 4022f3eec4 cddl: fix missing ZFS library dependencies
In 9fae47666 zfsd got a libspl dependency to avoid undefined references.
However that workaround did not help external consumers of libzfs_core.

Fix all missing dependencies lld 13 and the rtld complain about.

Reviewed by:	freqlabs, markj

(cherry picked from commit 9e9c651cac)
2021-11-29 09:26:35 -05:00
Mark Johnston e0cee46f58 amd64: Initialize kernel_pmap's active CPU set to all_cpus
This is in preference to simply filling the cpuset, and allows the
conditional in pmap_invalidate_cpu_mask() to be elided.

Also export pmap_invalidate_cpu_mask() outside of pmap.c for use in a
subsequent commit.

Suggested by:	kib
Reviewed by:	alc, kib
Tested by:	pho
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 71e6e9da22)
2021-11-29 09:17:08 -05:00
Mark Johnston 1556ae1356 vm_page: Remove vm_page_sbusy() and vm_page_xbusy()
They are unused today and cannot be safely used in the face of unlocked
lookup, in which pages may be busied without the object lock held.

Obtained from:	jeff (object_concurrency patches)
Reviewed by:	kib

(cherry picked from commit a2665158d0)
2021-11-29 09:11:37 -05:00
Mark Johnston cb081566cf vm_page: Consolidate page busy sleep mechanisms
- Modify vm_page_busy_sleep() and vm_page_busy_sleep_unlocked() to take
  a VM_ALLOC_* flag indicating whether to sleep on shared-busy, and fix
  up callers.
- Modify vm_page_busy_sleep() to return a status indicating whether the
  object lock was dropped, and fix up callers.
- Convert callers of vm_page_sleep_if_busy() to use vm_page_busy_sleep()
  instead.
- Remove vm_page_sleep_if_(x)busy().

No functional change intended.

Obtained from:	jeff (object_concurrency patches)
Reviewed by:	kib

(cherry picked from commit 87b646630c)
2021-11-29 09:11:29 -05:00
Mark Johnston fdd27db348 vm: Add a mode to vm_object_page_remove() which skips invalid pages
This will be used to break a deadlock in ZFS between the per-mountpoint
teardown lock and page busy locks.  In particular, when purging data
from the page cache during dataset rollback, we want to avoid blocking
on the busy state of invalid pages since the busying thread may be
blocked on the teardown lock in zfs_getpages().

Add a helper, vn_pages_remove_valid(), for use by filesystems.  Bump
__FreeBSD_version so that the OpenZFS port can make use of the new
helper.

PR:		258208
Reviewed by:	avg, kib, sef
Tested by:	pho (part of a larger patch)
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit d28af1abf0)
2021-11-29 09:09:28 -05:00
Justin Hibbits 2949655427 Fix segment size in compressing core dumps
A core segment is bounded in size only by memory size.  On 64-bit
architectures this means a segment can be much larger than 4GB.
However, compress_chunk() takes only a u_int, clamping segment size to
4GB-1, resulting in a truncated core.  Everything else, including the
compressor internally, uses size_t, so use size_t at the boundary here.

This dates back to the original refactor back in 2015 (r279801 /
aa14e9b7).

PR:		260006
Sponsored by:	Juniper Networks, Inc.

(cherry picked from commit 63cb9308a7)
2021-11-29 09:08:11 -05:00
N.J. Mann 141f0db23e pchtherm: Let the driver be compiled into the kernel
PR:		259776

(cherry picked from commit a11983366e)
2021-11-29 09:04:16 -05:00
Rick Macklem b61ed46880 nfsstat: Add output for counts of new RPCs to the "-E" option
Add output to the "-E" option for new RPCs related
to NFSv4.1/4.2. Also, add output of the counts for
allocated layouts and the title for the "Client"
section (which was lost during a previous commit).

(cherry picked from commit 75c666197c)
2021-11-28 15:58:03 -08:00
Mateusz Piotrowski 2b890871f7 style.Makefile.5: Do not require $FreeBSD$ SCM IDs
It's no longer required to have those SCM IDs at the start of makefiles.

MFC after:	3 days

(cherry picked from commit 1ac5586c6d)
2021-11-28 17:45:08 +01:00
Mateusz Piotrowski 98ddcae346 os-release.5: Fix quoting of dots
Dots needs to escaped with \& to be places inside Ql quotes.

MFC after:	3 days

(cherry picked from commit ee7485bef5)
2021-11-28 17:42:37 +01:00
Gordon Bergling 654f47cfc0 ffs_softdep: Fix a typo in a source code comment
- s/conditonally/conditionally/

(cherry picked from commit bebff61587)
2021-11-28 12:43:32 +01:00
Gordon Bergling 18e627e9c7 ppbus(4): Fix a typo in source code comment
- s/quering/querying/

Obtained from:	NetBSD

(cherry picked from commit 975e2e3f84)
2021-11-28 12:43:11 +01:00
Gordon Bergling 43c4228c97 lpr(1): Fix a typo in a source code comment
-s /debuging/debugging/

(cherry picked from commit 840d72371b)
2021-11-28 12:42:53 +01:00
Gordon Bergling 7125ea0f15 firewire(4): Fix a typo in a source code comment
- s/unavailabe/unavailable/

(cherry picked from commit 3e5ddef0fd)
2021-11-28 12:42:33 +01:00
Gordon Bergling f9236943e1 ixl(4): Fix a typo in a sysctl description
(cherry picked from commit d7125850f0)
2021-11-28 12:42:14 +01:00
Gordon Bergling 197f36e000 iscsi(4): Fix a typo in a source code comment
- s/conditon/condition/

(cherry picked from commit 5e21882bb4)
2021-11-28 12:41:52 +01:00
Gordon Bergling c8f21cc79f sched_ule(4): Fix two typo in source code comments
- s/conditons/conditions/
- s/unconditonally/unconditionally/

(cherry picked from commit 15b5c347f1)
2021-11-28 12:41:11 +01:00
Gordon Bergling 03490cedbc TWL: Fix a typo in a source code comment
- s/maxium/maximum/

(cherry picked from commit 8b11850f9d)
2021-11-28 12:40:29 +01:00
Ed Maste 2104a80649 mkimg: zero entry in vhdx_write_metadata
Otherwise _reserved might contain uninitialized data.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 036af1053a)
2021-11-27 19:29:30 -05:00
Ed Maste ee2e925603 Fix coredump_phnum test with ASLR enabled
coredump_phnum intends to generate a core file with many PT_LOAD
segments.  Previously it called mmap() in a loop with alternating
protections, relying on each mapping following the previous, to produce
a core file with many page-sized PT_LOAD segments.  With ASLR on we no
longer have this property of each mmap() following the previous.

Instead, perform a single allocation, and then use mprotect() to set
alternating pages to PROT_READ.

PR:		259970
Reported by:	lwhsu, mw
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33070

(cherry picked from commit 8ec4c5dae3)
2021-11-27 19:27:03 -05:00
Ed Maste 374f859ec0 ng_h4: add deprecation notice
It is already gone in FreeBSD 14.

Sponsored by:	The FreeBSD Foundation
2021-11-27 19:26:38 -05:00
Andriy Gapon f537b30564 icee: allow configuration via hints on FDT-based systems
On-board devices should be configured via the FDT and overlays.
Hints are primarily useful for external and temporarily attached devices.
Adding hints is much easier and faster than writing and compiling
an overlay.

(cherry picked from commit 01e3492337)
2021-11-27 10:47:25 +02:00
Andriy Gapon 83f68b84c2 ds1307: allow configuration via hints on FDT-based systems
On-board devices should be configured via the FDT and overlays.
Hints are primarily useful for external and temporarily attached devices.
Adding hints is much easier and faster than writing and compiling
an overlay.

(cherry picked from commit 27645265c4)
2021-11-27 10:44:16 +02:00
Andriy Gapon a9f6a79b2d sddadone: 'error' gets assigned only errno codes, never MMC_ERR codes
(cherry picked from commit e17b58ecbc)
2021-11-27 10:32:36 +02:00
Rick Macklem 0aa59ac827 pNFS: Add nfsstats counters for number of Layouts
For pNFS, Layouts are issued by the server to indicate
where a file's data resides on the DS(s).  This patch
adds counters for how many layouts are allocated to
the nfsstatsv1 structure, using two reserved fields.

(cherry picked from commit ce9676de86)
2021-11-26 18:20:16 -08:00
Alfredo Dal'Ava Junior c41d129485 ofwfb: fix vga/hdmi console with ASMEDIA during boot on powerpc64(le)
On recent OpenBMC firmware, the onboard ASMEDIA video card framebuffer
address was removed from device tree for security purposes (value is set
to zero to avoid leaking the address).

This patch works around the problem by taking framebuffer base address
from the "ranges" property of a parent node.

Reviewed by:	luporl, jhibbits (on IRC)
MFC after:	2 weeks
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D30626

(cherry picked from commit b042d10cdc)
2021-11-26 20:50:55 -03:00
Kristof Provost 9aa63a8d13 libpfct: be consistent with u_int vs. uint
Always use uint64_t over u_int64_t, for the sake of consistency.

No functional change.

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

(cherry picked from commit 7bb3c927f7)
2021-11-26 04:42:04 +01:00
Kristof Provost 029aed9281 lagg: fix unused-but-set-variable
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 3142d4f622)
2021-11-26 04:40:56 +01:00
Kristof Provost 07b8f5dca1 pf tests: basic test for ridentifier
MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32751

(cherry picked from commit 508161111d)
2021-11-26 04:39:33 +01:00
Kristof Provost cfe9b890d5 pf: Introduce ridentifier
Allow users to set a number on rules which will be exposed as part of
the pflog header.
The intent behind this is to allow users to correlate rules across
updates (remember that pf rules continue to exist and match existing
states, even if they're removed from the active ruleset) and pflog.

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

(cherry picked from commit 76c5eecc34)
2021-11-26 04:39:05 +01:00