Commit graph

286327 commits

Author SHA1 Message Date
Bjoern A. Zeeb
204fb7d853 LinuxKPI: 802.11: make sure bssid for scans (probe_req) is set
In b0f7376822 we added bssid[] to struct cfg80211_scan_request
likely while working on mt76 and did not need it (yet) back then.
iwlwifi started to use the field in Linux f1fec51cda70f (April 2023).
Without it set firmware crashes when trying to send probe requests
((empty) SSID also given to hw_scan).
For now always set the field to the wildcard BSSID.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e1e90be050)
2023-10-04 15:19:18 +00:00
Bjoern A. Zeeb
46e5d2b0c6 LinuxKPI: skbuff: remove assumption about mac_header
It seems the mac_header can be set to offset 0 for frames received.
Remove the warning splattering messages to the console for each packet.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f0e59b6903)
2023-10-04 15:19:18 +00:00
Bjoern A. Zeeb
6104a9f9c5 net80211: introduce two extra ieee80211_notify_scan_done()
We have multiple problems with scanning currently, one being that
an initial scan restarts itself and we are unable to start another
scan.  wpa_supplicant in that case never shows scan results.
Starting wpa_cli you may see: <3>CTRL-EVENT-SCAN-FAILED ret=-1 retry=1
messages.
Add two extra calls to ieee80211_notify_scan_done() at the end of scans
(before possible restarts).  That will get wpa_supplicant to get
scan results and possibly start associating to a BSSID and get us out
of scan.  This is kind-of a bandaid but on short notice may help to
improve the situation for some.

Based on analysis by:	enweiwu
Submitted by:		enweiwu (initial version)
Sponsored by:		The FreeBSD Foundation
Tested by:		cy, (others I cannot find email/PR for anymore)
Reviewed by:		cy
Differential Revision: https://reviews.freebsd.org/D38661

(cherry picked from commit 3f382eb23b)
2023-10-04 15:19:18 +00:00
Bjoern A. Zeeb
b011575ecd net80211: improve ddb output for sta and rate
Add more missing fields to the ddb output of sta (including spares so
people will notice if they use them to adjust ddb as well).
There are still more missing fields (some left as reminder in an
uncompiled __notyet__ block).

Add _db_show_rate() to print iv_rate as well optionally including
function pointers.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 4ed35b7d1e)
2023-10-04 15:19:17 +00:00
Bjoern A. Zeeb
32d951c53f net80211: mark argument to scan_curchan_task() __unused
Mostly as documentation mark an unused argument to scan_curchan_task()
as __unused.  We may possibly want to check all callers in the future
and see if the argument was supposed to be useful or should be entirely
removed.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 778da03b12)
2023-10-04 15:19:17 +00:00
Bjoern A. Zeeb
20ca85c50d net80211: improve scan debugging
While debugging other problems I ran into the case where net80211
was thinking a scan was ongoing and new scans could not be started
but given other logging there was clearly no more scan running.
It was hard after the fact to quickly determine enough state to
reconstruct or validate assumptions.

Improve a MSG_SCAN debug logging and implement _db_show_scan() ddb
output which can be printed along with show com /S or /a.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 33396ec29f)
2023-10-04 15:19:17 +00:00
Bjoern A. Zeeb
76a10a2167 net80211: fix ddb print alignment
Add missing \ts after new lines to properly align output of ddb show
commands.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit c45d05b718)
2023-10-04 15:19:17 +00:00
Bjoern A. Zeeb
5452345203 tools/wlanstats: fix -Wunused-but-set-variable
The "allnodes" code is currently #if 0 so also #if 0 the setting of the
command line option and variable in order to keep wlanstats compiling.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 530c13c540)
2023-10-04 15:19:17 +00:00
Mark Johnston
162787ac49 makefs/zfs tests: Add a test case which appends to a file after import
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit b6da7f2fd1)
2023-10-04 09:42:48 -04:00
Mark Johnston
5175923ef4 makefs/zfs: Ensure that the last block of a file has the right size
When copying a file's contents into the pool, a loop copies blocks of
the maximum size (128KB), allocating space from the vdev for each block.
The space allocator rounds up to the nearest block size, but for files
larger than the maximum size, this can result in the last block having a
smaller logical size than the rest of the blocks belonging to that
dnode.  This violates some ZFS invariants when appending to that file.

Modify fs_populate_file() to use the same block size for the final
block.

Reported by:	cperciva
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ef20cd33d3)
2023-10-04 09:42:37 -04:00
Mark Johnston
0074d0551d makefs/zfs: Remove a nonsensical comment
When populating files, makefs needs to copy their contents into
userspace in order to compute a checksum, so copy_file_range(2) is out
of the question.  Though, it could possibly be used when building other
types of filesystems.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 60c95af88f)
2023-10-04 09:42:23 -04:00
Mark Johnston
ea5173e572 makefs/zfs: Set the objset block pointer fill field correctly
It is supposed to contain the number of objects allocated from the set,
excluding the meta dnode.

Reported by:	mav
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 46402fd216)
2023-10-04 09:42:14 -04:00
Mark Johnston
d4a5d7a155 makefs/zfs tests: Run zdb prior to importing makefs-created pools
zdb contains quite a few assertions that can help catch bugs.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 87534f95dd)
2023-10-04 09:42:07 -04:00
Mark Johnston
1e8737f4e8 hdac: Defer interrupt allocation in hdac_attach()
hdac_attach() registers an interrupt handler before allocating various
driver resources which are accessed by the interrupt handler.  On some
platforms we observe what appear to be spurious interrupts upon a cold
boot, resulting in panics.

Partially work around the problem by deferring irq allocation until
after other resources are allocated.  I think this is not a complete
solution, but is correct and sufficient to work around the problems
reported in the PR.

PR:		268393
Tested by:	Alexander Sherikov <asherikov@yandex.com>
Tested by:	Oleh Hushchenkov <o.hushchenkov@gmail.com>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D41883

(cherry picked from commit 015daf5221)
2023-10-04 09:41:52 -04:00
Mark Johnston
20c494a9d3 unix: Fix a lock order reveral
Running the test suite yields:

lock order reversal:
 1st 0xfffff80004bc6700 unp (unp, sleep mutex) @ sys/kern/uipc_usrreq.c:390
 2nd 0xffffffff81a94b30 unp_link_rwlock (unp_link_rwlock, rw) @ sys/kern/uipc_usrreq.c:2934
lock order unp -> unp_link_rwlock attempted at:
0xffffffff80bc216e at witness_checkorder+0xbbe
0xffffffff80b493a5 at _rw_wlock_cookie+0x65
0xffffffff80c0a8e2 at unp_discard+0x22
0xffffffff80c0a888 at unp_freerights+0x38
0xffffffff80c09fdd at unp_scan+0x9d
0xffffffff80c0f9a7 at uipc_sosend_dgram+0x727
0xffffffff80c00a79 at sousrsend+0x79
0xffffffff80c072d0 at kern_sendit+0x1c0
0xffffffff80c074d7 at sendit+0xb7
0xffffffff80c076f3 at sys_sendmsg+0x63
0xffffffff8104d957 at amd64_syscall+0x6b7
0xffffffff8101f9eb at fast_syscall_common+0xf8

This happens when uipc_sosend_dgram() discards a control message because
the receive socket buffer is full.  The overflow handling frees
internalized file references in the socket buffer before freeing mbufs.
It does this with socket PCBs locked, leading to the LOR.  Defer
handling of file references until the PCBs are unlocked.

Reviewed by:	glebius
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D41884

(cherry picked from commit 61a14ddfe0)
2023-10-04 09:41:38 -04:00
Mark Johnston
b11568083f glabel.8: Warn against using generic labels on a shared device
Also suggest against creating a generic label on a device which already
contains a filesystem.

PR:		264166
Reviewed by:	imp, delphij, Pau Amma <pauamma@gundo.com>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35326

(cherry picked from commit 81f36fbc98)
2023-10-04 09:41:29 -04:00
Martin Matuska
a21cb0234b zfs: merge openzfs/zfs@8015e2ea6 (zfs-2.2-release) into stable/14
Notable upstream pull request merges:
 #15240 e9dc31c74 Update the behavior of mountpoint property
 #15240 c53bc3837 Improve the handling of sharesmb,sharenfs properties
 #15298 0ce1b2ca1 Invoke zdb by guid to avoid import errors
 #15301 0aabd6b48 ZIL: Avoid dbuf_read() in ztest_get_data()
 #15308 9e36c576f Don't allocate from new metaslabs
 #15312 229ca7d73 Fix ENOSPC for extended quota
 #15321 3079bf2e6 Restrict short block cloning requests
 #15322 8015e2ea6 Add '-u' - nomount flag for zfs set
 #15324 b34bf2d5f Tweak rebuild in-flight hard limit
 #15331 608741d06 Report ashift of L2ARC devices in zdb
 #15333 0d870a177 Fix invalid pointer access in trace_dbuf.h

Obtained from:	OpenZFS
OpenZFS commit:	8015e2ea66
2023-10-04 15:03:41 +02:00
Mina Galic
9afc0c849e local-unbound: remove stray config.h.in backup
despite being ignored in our main .gitignore, such files can still be
merged from vendor branches.

Reviewed by:		cy
Fixes:			8f76bb7dad (unbound: Vendor import 1.18.0)
MFC after:		2 weeks
X-MFC with:		8f76bb7dad
Differential Revision:	https://reviews.freebsd.org/D41920

(cherry picked from commit 948e11aaf4)
2023-10-03 18:01:06 -07:00
Cy Schubert
1b5982339c unbound: Vendor import 1.18.0
Release notes at
    https://www.nlnetlabs.nl/news/2023/Aug/30/unbound-1.18.0-released/

Merge commit '401770e05c71ecb5ae61a59d316069b4b78bf622' into main

(cherry picked from commit 8f76bb7dad)
2023-10-03 18:01:06 -07:00
Cy Schubert
36eb0dc68b sqlite3: Vendor import of sqlite3 3.43.1
Release notes at https://www.sqlite.org/releaselog/3_43_1.html.

Obtained from:  https://www.sqlite.org/2023/sqlite-autoconf-3430100.tar.gz

Merge commit 'fa2bb1440e13602676feec708ac7a9a3bb5ce5c8' into main

(cherry picked from commit ec99498144)
2023-10-03 18:01:06 -07:00
Piotr Kubaj
56a2b5d640 ObsoleteFiles.inc: only leave ofwdump.8.gz when WITH_FDT is set
Approved by:	mhorne
Differential Revision: https://reviews.freebsd.org/D41905
MFC after:	3 days

(cherry picked from commit 4cf8075264)
2023-10-04 02:42:32 +02:00
Umer Saleem
8015e2ea66 Add '-u' - nomount flag for zfs set
This commit adds '-u' flag for zfs set operation. With this flag,
mountpoint, sharenfs and sharesmb properties can be updated
without actually mounting or sharing the dataset.

Previously, if dataset was unmounted, and mountpoint property was
updated, dataset was not mounted after the update. This behavior
is changed in #15240. We mount the dataset whenever mountpoint
property is updated, regardless if it's mounted or not.

To provide the user with option to keep the dataset unmounted and
still update the mountpoint without mounting the dataset, '-u'
flag can be used.

If any of mountpoint, sharenfs or sharesmb properties are updated
with '-u' flag, the property is set to desired value but the
operation to (re/un)mount and/or (re/un)share the dataset is not
performed and dataset remains as it was before.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
Closes #15322
2023-10-03 15:41:46 -07:00
Umer Saleem
c53bc3837c Improve the handling of sharesmb,sharenfs properties
For sharesmb and sharenfs properties, the status of setting the
property is tied with whether we succeed to share the dataset or
not. In case sharing the dataset is not successful, this is
treated as overall failure of setting the property. In this case,
if we check the property after the failure, it is set to on.

This commit updates this behavior and the status of setting the
share properties is not returned as failure, when we fail to
share the dataset.

For sharenfs property, if access list is provided, the syntax
errors in access list/host adresses are not validated until after
setting the property during postfix phase while trying to
share the dataset. This is not correct, since the property has
already been set when we reach there.

Syntax errors in access list/host addresses are validated while
validating the property list, before setting the property and
failure is returned to user in this case when there are errors
in access list.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ameer Hamza <ahamza@ixsystems.com>
Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
Closes #15240
2023-10-03 15:41:46 -07:00
Umer Saleem
e9dc31c74e Update the behavior of mountpoint property
There are some inconsistencies in the handling of mountpoint
property. This commit updates the behavior and makes it
consistent.

If mountpoint property is set when dataset is unmounted, this
would update the mountpoint property. The mountpoint could be
valid or invalid in this case. Setting the mountpoint property
would result in success in this case. Dataset would still be
unmounted here.

On the other hand, if dataset is mounted and mountpoint
property is updated to something invalid where mount cannot be
successful, for example, setting the mountpoint inside a readonly
directory. This would unmount the dataset, set the mountpoint
property to requested value and tries to mount the dataset. The
mount operation returns error and this error is treated as
overall failure of setting the property while the property is
actually set.

To make the behavior consistent in case dataset is mounted or
unmounted, we should try to mount the dataset whenever mountpoint
property is updated. This would result in mounting the datasets
if canmount property is set to on, regardless if the dataset was
previously unmounted.

The failure in mount operation while setting the mountpoint
property should not be treated as failure, since the property is
actually set now to user requested value.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ameer Hamza <ahamza@ixsystems.com>
Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
Closes #15240
2023-10-03 15:41:46 -07:00
Dimitry Andric
2d5eb9b95a ObsoleteFiles: remove duplicated and incorrect libclang_rt powerpc64le entries
PR:		273776
MFC after:	3 days

(cherry picked from commit e2d3168d12)
2023-10-03 19:53:44 +02:00
Colin Percival
d9243c1ab3 EC2: Add experimental cloud-init images
Known issues:

1. The ec2-user user is created with a homedir of /usr/home/ec2-user
instead of /home/ec2-user; this appears to be a bug in cloud-init's
FreeBSD support.

2. Cloud-init configures IPv4 networking but not IPv6 networking.

releng/14.0 candidate.

Discussed with:	gjb
Reviewed by:	imp
MFC after:	5 days
Relnotes:	yes
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D41793

(cherry picked from commit 1f4ce7a39f)
2023-10-03 10:28:18 -07:00
Colin Percival
f4576ea0d5 EC2: Split off reusable configuration bits
Split ec2-base.conf into ec2-base.conf and a reusable ec2.conf,
similar to how Vagrant flavours share a common vagrant.conf.

releng/14.0 candidate.

Discussed with:	gjb
MFC after:	5 days
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D41792

(cherry picked from commit fada6e2389)
2023-10-03 10:28:18 -07:00
Colin Percival
a18905a9bf EC2: Flavour existing AMIs as "base"
Using the recently-added "cloudware flavours" mechanism, turn the
existing EC2 AMIs into a new "base" flavour.  The only user-visible
change is that AMI names now include the word "base".

releng/14.0 candidate.

Discussed with:	gjb
Reviewed by:	imp
MFC after:	5 days
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D41791

(cherry picked from commit 7494fb6b7d)
2023-10-03 10:28:18 -07:00
Colin Percival
fec4f6a7c3 release/Makefile.vm: Add support for CW flavours
There are two "Vagrant" images right now: "Vagrant Image for VirtualBox"
and "Vagrant Image for VMWare".  Rather than listing these separately in
a CLOUDWARE list, place "VAGRANT" into a CLOUDWARE_TYPES list and then
use a VAGRANT_FLAVOURS variable to identify the two versions.  Add make
logic to allow defaults (in this case, image format and filesystem) to
be specified once for VAGRANT and inherited by both flavours.

This will make future work to add flavoured EC2 images simpler.

releng/14.0 candidate.

Discussed with:	gjb
Reviewed by:	imp
MFC after:	5 days
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D41790

(cherry picked from commit e6eeac9b71)
2023-10-03 10:28:17 -07:00
Colin Percival
b9013d75c8 release/Makefile.vm: Garbage collect unused bits
The cw*-package targets were introduced in February 2015 as part of
adding support for building GCE images; but GCE support was reworked
in June 2015 and the cw*-package targets were in fact never used.
Remove them.

The *_DISK variables were introduced in February 2015 as part of
adding the cloudware-install target; this was removed in May 2016 as
the cloudware images are published via the respective cloud systems
and not published as disk images via the FreeBSD FTP site.  As such,
the *_DISK variables are not unused; remove them.

releng/14.0 candidate.

Discussed with:	gjb
Reviewed by:	imp
MFC after:	5 days
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D41789

(cherry picked from commit fcbeeb5ff4)
2023-10-03 10:28:17 -07:00
Mark Johnston
1cc968931b release/ec2: Remove references to portsnap
We no longer install a default portsnap.conf, so the sed invocation just
generates an error.

Reviewed by:	cperciva
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42003

(cherry picked from commit 63aa2e9134)
2023-10-03 10:28:17 -07:00
Stoiko Ivanov
b04b13ae79 contrib: debian: drop bashcompletion mangling after install
tested by running:
```
./configure --with-config=user; cp -a contrib/debian .
dpkg-buildpackage -b -uc -us
```
on a Debian 12 based system.

and checking where the completion file got installed.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes #15304
2023-10-03 09:06:07 -07:00
Stoiko Ivanov
7b1d421adf contrib: debian: switch to dh-sequence-dkms
Follows b191f9a13d3005621ead9a727b811892264505ef from Debian's
packaging team at:
https://salsa.debian.org/zfsonlinux-team/zfs/

The previous build-dependency is kept as option, to still be able to
build on older Debian based distros (e.g. Ubuntu 20.04).

Without this building on Debian 12/bookworm does not work, as `dkms`
is a virtual package.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes #15304
2023-10-03 09:06:07 -07:00
Stoiko Ivanov
db5c3b4c76 contrib: bash_completion.d: make install destination vendor dependent
Certain Linux distributions (Debian/Ubuntu at least) expect
bash-completion snippets to be installed in
/usr/share/bash-completion/completions instead of
/etc/bash_completion.d.

This patch sets the bashcompletiondir variable based on the vendor,
inspired by similar settings for initdir and initconfdir.

It seems that commit 612b8dff5b
caused the file to be installed in the first-place (thus the error
when building debian packages only became apparent when testing a
2.2.0-rc4 build)

The change only sets the variable in Makefile context - the
rpm/zfs.spec.in file has the path hardcoded as
%{_sysconfdir}/bash_completion.d/zfs, but since running
```
./configure --sysconfdir=/myetc  ; make rpm
```
also results in all relevant files to be installed in /etc instead of
/myetc I assume this can remain as is.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes #15304
2023-10-03 09:06:07 -07:00
Chunwei Chen
0d870a1775 Fix invalid pointer access in trace_dbuf.h
In dnode_destroy, dn_objset is invalidated. However, it will later call
into dbuf_destroy, in which DTRACE_SET_STATE will try to access spa_name
via dn_objset causing illegal pointer access.

Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@nutanix.com>
Closes #15333
2023-10-03 09:06:07 -07:00
George Amanakis
608741d062 Report ashift of L2ARC devices in zdb
Commit 8af1104f does not actually store the ashift of cache devices in
their label. However, in order to facilitate reporting the ashift
through zdb, we enable this in the present commit. We also document
how the retrieval of the ashift is done.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #15331
2023-10-03 09:06:07 -07:00
Alexander Motin
3079bf2e6c Restrict short block cloning requests
If we are copying only one block and it is smaller than recordsize
property, do not allow destination to grow beyond one block if it
is not there yet.  Otherwise the destination will get stuck with
that block size forever, that can be as small as 512 bytes, no
matter how big the destination grow later.

Reviewed-by: Kay Pedersen <mail@mkwg.de>
Reviewed-by: Rob Norris <rob.norris@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #15321
2023-10-03 09:06:07 -07:00
Brian Behlendorf
b34bf2d5f6 Tweak rebuild in-flight hard limit
Vendor testing shows we should be able to get a little more
performance if we further relax the hard limit which we're hitting.

Authored-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #15324
2023-10-03 09:06:07 -07:00
Alexander Motin
2ed56a7bfe Untie strchrnul() from gdb.
MFC after:	10 days

(cherry picked from commit 2373e704aa)
2023-10-03 09:57:16 -04:00
Alan Somers
c70a4185c6 mprutil: "fix user reply buffer (64)..." warnings
Depending on the card's firmware version, it may return different length
responses for MPI2_FUNCTION_IOC_FACTS.  But the first part of the
response contains the length of the rest, so query it first to get the
length and then use that to size the buffer for the full response.

Also, correctly zero-initialize MPI2_IOC_FACTS_REQUEST.  It only worked
by luck before.

PR:		264848
Reported by:	Julien Cigar <julien@perdition.city>
Sponsored by:	Axcient
Reviewed by:	scottl, imp
Differential Revision: https://reviews.freebsd.org/D38739

(cherry picked from commit 7d154c4dc6)
2023-10-02 19:31:12 -06:00
Alan Somers
13f188ce0b fusefs: fix some bugs updating atime during close
When using cached attributes, we must update a file's atime during
close, if it has been read since the last attribute refresh.  But,

* Don't update atime if we lack write permissions to the file or if the
  file system is readonly.
* If the daemon fails our atime update request for any reason, don't
  report this as a failure for VOP_CLOSE.

PR:		270749
Reported by:	Jamie Landeg-Jones <jamie@catflap.org>
Sponsored by:	Axcient
Reviewed by:	pfg
Differential Revision: https://reviews.freebsd.org/D41925

(cherry picked from commit fb619c94c6)

fusefs: fix unused variables from fb619c94c6

PR:		270749
Reported by:	cy
Sponsored by:	Axcient

(cherry picked from commit e5236d25f2)
2023-10-02 19:10:13 -06:00
Mark Johnston
98504b6471 mlock tests: Add a regression test
The test tries to trigger creation of a superpage mapping in an
mlock()ed region.

MFC after:	2 weeks

(cherry picked from commit 8f26ed01bd)
2023-10-02 08:55:49 -04:00
Bojan Novković
ca79521be1 amd64: Add a leaf PTP when pmap_enter(psind=1) creates a wired mapping
This patch reverts the changes made in D19670 and fixes the original
issue by allocating and prepopulating a leaf page table page for wired
userspace 2M pages.

The original issue is an edge case that creates an unmapped, wired
region in userspace. Subsequent faults on this region can trigger wired
superpage creation, which leads to a panic in pmap_demote_pde_locked()
as the pmap does not create a leaf page table page for the wired
superpage. D19670 fixed this by disallowing preemptive creation of
wired superpage mappings, but that fix is currently interfering with an
ongoing effort of speeding up vm_map_wire for large, contiguous entries
(e.g. bhyve wiring guest memory).

Reviewed by:	alc, markj
Sponsored by:	Google, Inc. (GSoC 2023)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D41132

(cherry picked from commit aa3bcaad51)
2023-10-02 08:55:49 -04:00
Kristof Provost
3ab984bbe0 pf: only create sctp multihome states if we pass the packet
If we've decided to drop the packet we shouldn't create additional
states based off it.

MFC after:	3 days
Sponsored by:	Orange Business Services

(cherry picked from commit 480f62ccd8)
2023-10-02 11:32:14 +02:00
Kristof Provost
bcad901cbf pf: ensure 'off' is always set before use
If we bail out early from pf_test(6)() we still need to clean up/finish
SCTP multihome work, which requires the 'off' value to be set. Set it
early enough.

MFC after:	3 days
Sponsored by:	Orange Business Services

(cherry picked from commit aefda9c92d)
2023-10-02 11:32:14 +02:00
Kristof Provost
35dd8c4e78 pf tests: extend SCTP tests to test state removal through ASCONF
pf can now mark shut down multihomed connections shutting down. Verify
that pf does the right thing.

MFC after:	3 weeks
Sponsored by:	Orange Business Services

(cherry picked from commit 97340b68d1)
2023-10-02 11:32:14 +02:00
Kristof Provost
6d1714a44e pf: mark removed connections within a multihome association as shutting down
Parse IP removal in ASCONF chunks, find the affected state(s) and mark
them as shutting down. This will cause them to time out according to
PFTM_TCP_CLOSING timeouts, rather than waiting for the established
session timeout.

MFC after:	3 weeks
Sponsored by:	Orange Business Services

(cherry picked from commit 4d3af82f78)
2023-10-02 11:32:14 +02:00
Kristof Provost
45f475427d pf: inherit v_tag values to multihomed connections
When we create a new state for an existing SCTP association inherit the
v_tag values from the original connection.

MFC after:	3 weeks
Sponsored by:	Orange Business Services

(cherry picked from commit f1cc29af84)
2023-10-02 11:32:14 +02:00
Kristof Provost
48172aad81 pf: improve SCTP state validation
Only create new states for INIT chunks, or when we're creating a
secondary state for a multihomed association.

Store and verify verification tag.

MFC after:	3 weeks
Sponsored by:	Orange Business Services

(cherry picked from commit 51a78dd276)
2023-10-02 11:32:14 +02:00
Kristof Provost
2537ad522d pf tests: basic SCTP multihoming test
The SCTP server will announce multiple addresses. Block one of them with
pf, connect to the other have the client use the blocked address. pf
is expected to have created state for all of the addresses announced by
the server.

In a separate test case add the secondary (client) IP after the
connection has been established. The intent is to verify the
functionality of the ASCONF chunk parsing.

MFC after:	3 weeks
Sponsored by:	Orange Business Services
Differential Revision:	https://reviews.freebsd.org/D41638

(cherry picked from commit 1a28d5fea7)
2023-10-02 11:32:14 +02:00