Commit Graph

271073 Commits

Author SHA1 Message Date
Alfredo Dal'Ava Junior
8d1ab5ad84 powerpc: kernel config style
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Reviewed by:	imp
2021-12-14 21:01:25 -03:00
Mark Johnston
88642d978a vm_fault: Fix vm_fault_populate()'s handling of VM_FAULT_WIRE
vm_map_wire() works by calling vm_fault(VM_FAULT_WIRE) on each page in
the rage.  (For largepage mappings, it calls vm_fault() once per large
page.)

A pager's populate method may return more than one page to be mapped.
If VM_FAULT_WIRE is also specified, we'd wire each page in the run, not
just the fault page.  Consider an object with two pages mapped in a
vm_map_entry, and suppose vm_map_wire() is called on the entry.  Then,
the first vm_fault() would allocate and wire both pages, and the second
would encounter a valid page upon lookup and wire it again in the
regular fault handler.  So the second page is wired twice and will be
leaked when the object is destroyed.

Fix the problem by modify vm_fault_populate() to wire only the fault
page.  Also modify the error handler for pmap_enter(psind=1) to not test
fs->wired, since it must be false.

PR:		260347
Reviewed by:	alc, kib
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33416
2021-12-14 15:10:46 -05:00
Wenfeng Liu
509f1a0f40 ipsec: fix a logic error in key_do_getnewspi 2021-12-14 19:30:42 +00:00
John Baldwin
253ecb389e RELNOTES: Note support for KTLS RX for TLS 1.3.
Sponsored by:	Netflix
2021-12-14 11:02:45 -08:00
John Baldwin
7ffc9b15ba ktls: Update documentation for software backends.
KTLS no longer supports multiple software backends.  Instead, it
always uses OCF for software crypto.  In particular, the ktls_ocf.ko
module no longer exists.  The OCF bits for KTLS are compiled into th
kernel instead.

Sponsored by:	Netflix
2021-12-14 11:01:05 -08:00
John Baldwin
05a1d0f5d7 ktls: Support for TLS 1.3 receive offload.
Note that support for TLS 1.3 receive offload in OpenSSL is still an
open pull request in active development.  However, potential changes
to that pull request should not affect the kernel interface.

Reviewed by:	hselasky
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D33007
2021-12-14 11:01:05 -08:00
Alexander Motin
483e464ed4 isp(4): Allow more than 2 ports to read WWNs from NVRAM.
It appears at least on QLE2694L cards 3rd and 4th ports follow the
same NVRAM addressing logic as the first two.  In lack of proper
documentation this guess is as good as it can be.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.
2021-12-14 13:26:44 -05:00
John Baldwin
27bb8830d5 SSL_sendfile: Replace ERR_raise_data with SYSerr.
ERR_raise_data is only present in OpenSSL 3.0 and later.

Reviewed by:	jkim
Obtained from:	CheriBSD
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D33363
2021-12-14 10:07:38 -08:00
Adrian Chadd
05860ffdb4 cpufreq: Support operating-mode-v2 tables with no voltages
Summary:

The linux device tree documentation for this states that
for v1 voltages are required, but for v2 voltages are optional.

So, handle that here - if there's no regulator/supply provided
for a v1 opmode then error out; but keep it optional for v2.
Then just don't both doing any regulator calls if it's not configured.

This isn't the best/final solution - mmel@ has suggested that
this should be flipped around a bit and print warnings if
we get an opp-microvolt property but we don't have a regulator.

Subscribers: imp
Reviewed by: mmel, jrtc27, manu

Test Plan: * IPQ4018, with no voltage tables; the freq set is called appropriately.

Differential Revision: https://reviews.freebsd.org/D33140
2021-12-14 09:49:17 -08:00
Gleb Smirnoff
185e659c40 inpcb: use locked variant of prison_check_ip*()
The pcb lookup always happens in the network epoch and in SMR section.
We can't block on a mutex due to the latter.  Right now this patch opens
up a race.  But soon that will be addressed by D33339.

Reviewed by:		markj, jamie
Differential revision:	https://reviews.freebsd.org/D33340
Fixes:			de2d47842e
2021-12-14 09:38:52 -08:00
Konstantin Belousov
0e6b06d5c8 x86: add a comment providing source for numbers in legacy XSAVE area layout
Suggested by:	Michael Pratt <mpratt@google.com>
Reviewed by:	Michael Pratt <mpratt@google.com>, emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D33423
2021-12-14 19:14:40 +02:00
Mateusz Guzik
af40f9bfa6 socket: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-14 17:12:53 +00:00
Mateusz Guzik
35273e2099 iwm: plug some of set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-14 17:06:56 +00:00
Andrew Turner
e3ccf4f9de Fix dtrace fbt return probes on arm64
As with arm and riscv fix return fbt probes on arm64. arg0 should be
the offset within the function of the return instruction and arg1
should be the return value.

Reviewed by:	kp, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33440
2021-12-14 16:32:12 +00:00
Mateusz Guzik
06c95f1fac bhnd: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-14 14:59:09 +00:00
Mateusz Guzik
3c39566d65 mbuf: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-14 14:54:02 +00:00
Mateusz Guzik
b2835fa22a kobj: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-14 14:52:25 +00:00
Mateusz Guzik
a90b85dd5a ktls: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-14 14:44:37 +00:00
Mateusz Guzik
88646c4e5f virtio: plug some of set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-14 14:38:42 +00:00
Mateusz Guzik
17ad5b249d sis: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-14 14:31:10 +00:00
Mateusz Guzik
4472999abe ral: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-14 14:24:21 +00:00
Cy Schubert
a6fb9bbea7 ipfilter userland: Replace sprintf with range checking version (snprintf)
MFC after:	1 week
2021-12-14 06:19:21 -08:00
Cy Schubert
9a563c5e48 ipfilter: radix_ipf is a kernel source file
Remove duplicate radix_ipf.* files. They live in sys/.

MFC after:	1 week
2021-12-14 06:19:21 -08:00
Cy Schubert
8f945ad25f ipfilter: Replace sprintf with range checking version (snprintf)
MFC after:	1 week
2021-12-14 06:19:20 -08:00
Cy Schubert
e263821fea ipfilter radix_ipf: name is only valid with RDX_DEBUG
ipf_rdx_node.name is only vaild when RDX_DEBUG is defined.

MFC after:	1 week
2021-12-14 06:19:20 -08:00
Cy Schubert
8d2a8d243e ipfilter: The SNPRINTF macro doesn't exist, remove it
MFC after:	1 week
2021-12-14 06:19:20 -08:00
Cy Schubert
0da2c91e64 hostapd: Fix wlan interfaces not UP/RUNNING
Like wpa_supplicant, hostapd does not automatically UP the interface
when configured. The fix is similar to 5fcdc19a81.

Reported by:	avg
Tested by:	avg
MFC after:	1 week
2021-12-14 06:18:37 -08:00
Mateusz Guzik
4d78ef3e81 virtio console: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-14 14:14:34 +00:00
Mateusz Guzik
94b098882f vmx: plug set-but-not-used var
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-14 14:12:35 +00:00
Mateusz Guzik
7aa51c9621 sdhci: plug set-but-not-unused vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-14 14:08:35 +00:00
Mateusz Guzik
0d3b2bd7e6 vtnet: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-14 14:08:28 +00:00
Mateusz Guzik
2b0d3ee9ec sk: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-12-14 14:08:17 +00:00
Mike Karels
6ccff5c045 Add genet.4 for RPi 4 Ethernet
Add new man page for genet(4) Ethernet on Raspberry Pi 4B, based on
several other Ethernet man pages.  Hook into build.

Note, this could potentially be added as an aarch64 man page; not
sure if that matters now.  Include if_genet(4) link as for other
network devices.

Copyright notice cloned from a recent FreeBSD Foundation copyright.

MFC after:	3 days
Reviewed by:	imp bcr #manpages
Differential Revision: https://reviews.freebsd.org/D33360
2021-12-14 07:46:13 -06:00
Franco Fichtner
1de20ebc46 dummynet: drop unused definitions
Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D33429
2021-12-14 13:01:15 +01:00
Mariusz Zaborski
f45ca435bd cap_net: fix verification of bind permission
MFC after:	5 days
2021-12-14 12:02:40 +01:00
Mariusz Zaborski
88910b8b7b cap_net: plug memory leak
MFC after:	5 days
2021-12-14 12:02:40 +01:00
Andrew Turner
6238905c5b Only change DMAP props on DMAP covered memory
When changing memory properties in the arm64 pmap we need to keep both
the kernel address and DMAP mappings in sync.

To keep the kernel and DMAP memory in sync we recurse when updating the
former to also update the latter. There was insuffucuent checking around
this recursion. It would check if the virtual address is not within the
DMAP region, but not if the physical address is covered.

Add the missing check as without it the recursion may return an error.

Sponsored by:	The FreeBSD Foundation
2021-12-14 10:38:19 +00:00
Warner Losh
0630a06b2a loader/kboot: minor style nit
Kill trailing white space.

Sponsored by:		Netflix
2021-12-13 16:55:39 -07:00
наб
f291fa658e t/z_diff/socket, zfs: main: fix unused argument warnings, ARGSUSED tags
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12829
2021-12-13 15:50:47 -08:00
наб
b7ef2340c2 libzfs: diff: simplify superfluous stdio
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12829
2021-12-13 15:50:38 -08:00
наб
9bdf0c592b libzfs: diff: print_what() can return the symbol => get_what()
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12829
2021-12-13 15:50:29 -08:00
наб
a72129edcb libzfs: diff: stream_bytes: use fputc, %hho formats chars
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12829
2021-12-13 15:50:20 -08:00
наб
1cfb6ef36e libzfs: zpool_set_vdev_prop: remove unused vprop
Found by clang 14 with -Wunused-but-set-variable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12829
2021-12-13 15:50:09 -08:00
наб
9e184b7c35 linux: libspl: getmntany: remove unused argument
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12829
2021-12-13 15:49:59 -08:00
наб
344bbc82e7 zfs, libzfs: diff: accept -h/ZFS_DIFF_NO_MANGLE, disabling path escaping
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12829
2021-12-13 15:49:40 -08:00
Mark Johnston
3aa0bc89c6 libdwarf: Add a weak uncompress() symbol
This works around brokenness in buildworld's bootstrapping logic: it
uses the source tree's metadata to collect dependency info (such as,
"libdwarf depends on libz") but links against static host libraries.
If these two are out of sync, as is the case if one builds a commit
prior to the introduction of the libz dependency, then the build fails
when trying to statically link nm(1).

Mitigate the problem by defining a weak uncompress() symbol which simply
returns an error.  This ensures that the build won't fail when
statically linking libdwarf without zlib.  The downside is that any
tools using libdwarf without zlib will now hit a runtime error if they
attempt to decode compressed sections, but at least they'll fail
deterministically, and compressed debug info is only enabled by default
in main.

In particular, this fixes building of branches lacking commit
dbf05458e3, such as releng branches, stable/12 and 13 and old
revisions of main.  Previously the nm(1) build would fail with:

ld: error: undefined symbol: uncompress
>>> referenced by libdwarf_elf_init.c:233
>>> (/usr/src/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c:233)
>>>               libdwarf_elf_init.o:(_dwarf_elf_init) in archive
>>> /usr/lib/libdwarf.a

Reported by:	dim, ler, krion
Reviewed by:	imp, emaste
Fixes:		dbf05458e3 ("libdwarf: Support consumption of compressed ELF sections")
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33419
2021-12-13 18:47:15 -05:00
Mark Johnston
c983ec6428 libdwarf: Fix error handling in _dwarf_elf_init()
We were not setting "ret" before jumping to the error path, so the
function returned success even when it had failed.

Reviewed by:	emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33420
2021-12-13 18:46:59 -05:00
Rick Macklem
fe04c91184 nfscl: add a filesize limit check to nfs_allocate()
As reported in PR#260343, nfs_allocate() did not check
the filesize rlimit. This patch adds that check.

PR:	260343
Reviewed by:	asomers
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D33422
2021-12-13 15:32:19 -08:00
Rick Macklem
c302f889e2 nfsd: Limit parsing of layout errors to maxcnt bytes
This patch decrements maxcnt by the appropriate
number of bytes during parsing and checks to see
if there is data remaining.  If not, it just returns
from nfsrv_flexlayouterr() without further processing.
This prevents the tl pointer from running off the end
of the error data pointed at by layp, if there are
flaws in the data.

Reported by:	rtm@lcs.mit.edu
Tested by:	rtm@lcs.mit.edu
PR:	260293
MFC after:	2 weeks
2021-12-13 15:21:31 -08:00
Bjoern A. Zeeb
e448ff6f0e rc: network.subr improve network6_getladdr()
In network6_getladdr() we are iterating over inet6 lines and are not
interested in any others.  So tell ifconfig to limit output to "inet6"
as much as possible.
This is probably a micro-optimisation but was noticed while looking
at other IPv6-related boot-time improvements.

MFC after:	1 week
2021-12-13 22:12:44 +00:00