]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
10 months agolinuxolator: fix nosys() to not send SIGSYS
Konstantin Belousov [Mon, 25 Sep 2023 16:39:48 +0000 (19:39 +0300)]
linuxolator: fix nosys() to not send SIGSYS

(cherry picked from commit 7acc4240ce00af540093b47ad00be0508310b515)

10 months agonosys(): add kern.signosys tunable/sysctl to control SIGSYS
Konstantin Belousov [Mon, 25 Sep 2023 16:36:04 +0000 (19:36 +0300)]
nosys(): add kern.signosys tunable/sysctl to control SIGSYS

(cherry picked from commit 5804a1623054d865618d77cfac86978f03b8111a)

10 months agosysentvec: add SV_SIGSYS flag
Konstantin Belousov [Mon, 25 Sep 2023 16:33:36 +0000 (19:33 +0300)]
sysentvec: add SV_SIGSYS flag

(cherry picked from commit b82b4ae752501469053979393e33bbfa74fbc9d2)

10 months agosyscalls: fix missing SIGSYS for several ENOSYS errors
Konstantin Belousov [Mon, 25 Sep 2023 16:32:52 +0000 (19:32 +0300)]
syscalls: fix missing SIGSYS for several ENOSYS errors

(cherry picked from commit 39024a89146902ca9aba250130b828ad9aced99d)

10 months agoamd64 cpu_fetch_syscall_args_fallback(): fix whitespace
Konstantin Belousov [Tue, 26 Sep 2023 09:20:30 +0000 (12:20 +0300)]
amd64 cpu_fetch_syscall_args_fallback(): fix whitespace

(cherry picked from commit 6b3bb233cd0c3eeeb70e388a62b142b4f22b62b2)

10 months agonetdump: Check the return value of ifunit_ref()
Mark Johnston [Mon, 2 Oct 2023 12:08:20 +0000 (08:08 -0400)]
netdump: Check the return value of ifunit_ref()

We may fail to match if the specific interface doesn't exist or was
renamed.

PR: 273715
Reported by: grembo
MFC after: 1 week

(cherry picked from commit d94d07d58141dcff48f01c6b3e5a31de9d7a7938)

10 months agoswap_pager: Fix a race in swap_pager_swapoff_object()
Mark Johnston [Mon, 2 Oct 2023 11:49:27 +0000 (07:49 -0400)]
swap_pager: Fix a race in swap_pager_swapoff_object()

When we disable swapping to a device, we scan the full VM object list
looking for objects with swap trie nodes that reference the device in
question.  The pages corresponding to those nodes are paged in.

While paging in, we drop the VM object lock.  Moreover, we do not hold a
reference for the object; swap_pager_swapoff_object() merely bumps the
paging-in-progress counter.  vm_object_terminate() waits for this
counter to drain before proceeding and freeing pages.

However, swap_pager_swapoff_object() decrements the counter before
re-acquiring the VM object lock, which means that vm_object_terminate()
can race to acquire the lock and free the pages.  Then,
swap_pager_swapoff_object() ends up unbusying a freed page.  Fix the
problem by acquiring the lock before waking up sleepers.

PR: 273610
Reported by: Graham Perrin <grahamperrin@gmail.com>
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42029

(cherry picked from commit e61568aeeec7667789e6c9d4837e074edecc990e)

10 months agonvme: Fix memory leak in pt ioctl commands
David Sloan [Thu, 7 Sep 2023 16:22:21 +0000 (10:22 -0600)]
nvme: Fix memory leak in pt ioctl commands

When running nvme passthrough commands through the ioctl interface
memory is mapped with vmapbuf() but not unmapped. This results in leaked
memory whenever a process executes an nvme passthrough command with a
data buffer. This can be replicated with a simple c function (error
checks skipped for brevity):

void leak_memory(int nvme_ns_fd, uint16_t nblocks) {
struct nvme_pt_command pt = {
.cmd = {
.opc = NVME_OPC_READ,
.cdw12 = nblocks - 1,
},
.len = nblocks * 512, // Assumes devices with 512 byte lba
.is_read = 1, // Reads and writes should both trigger leak
}
void *buf;

posix_memalign(&buf, nblocks * 512);
pt.buf = buf;
ioctl(nvme_ns_fd, NVME_PASSTHROUGH_COMMAND, &pt);
free(buf);
}

Signed-off-by: David Sloan <david.sloan@eideticom.com>
PR: 273626
Reviewed by: imp, markj
MFC after: 1 week

(cherry picked from commit 7ea866eb14f8ec869a525442c03228b6701e1dab)

11 months agosbuf.9: Add LIBRARY section
Mateusz Piotrowski [Tue, 3 Oct 2023 17:07:15 +0000 (19:07 +0200)]
sbuf.9: Add LIBRARY section

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

(cherry picked from commit 5a82fc7859f746d95811e43b3a117b8eea297749)

11 months agomprutil: "fix user reply buffer (64)..." warnings
Alan Somers [Wed, 22 Feb 2023 22:06:43 +0000 (15:06 -0700)]
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 7d154c4dc64e61af7ca536c4e9927fa07c675a83)

11 months agofusefs: fix some bugs updating atime during close
Alan Somers [Wed, 20 Sep 2023 21:37:31 +0000 (15:37 -0600)]
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 fb619c94c679e939496fe0cf94b8d2cba95e6e63)

fusefs: fix unused variables from fb619c94c67

PR: 270749
Reported by: cy
Sponsored by: Axcient

(cherry picked from commit e5236d25f2c0709acf3547e6af45f4bb4eec4f02)

11 months agolibfetch: don't rely on ca_root_nss for certificate validation
Michael Osipov [Tue, 3 Oct 2023 05:53:20 +0000 (07:53 +0200)]
libfetch: don't rely on ca_root_nss for certificate validation

Before certctl(8), there was no system trust store, and libfetch
relied on the CA certificate bundle from the ca_root_nss port to
verify peers.

We now have a system trust store and a reliable mechanism for
manipulating it (to explicitly add, remove, or revoke certificates),
but if ca_root_nss is installed, libfetch will still prefer that to
the system trust store.

With this change, unless explicitly overridden, libfetch will rely on
OpenSSL to pick up the default system trust store.

PR: 256902
MFC after: 3 days
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D42059

(cherry picked from commit 09f5c1e118bb4eca77b83a0d08f559b20f60aa59)

11 months agosplit: Further option parsing improvements.
Dag-Erling Smørgrav [Thu, 28 Sep 2023 16:29:52 +0000 (18:29 +0200)]
split: Further option parsing improvements.

* Whenever possible, use strtonum() to parse numeric arguments.
* Improve usefulness and consistency of error messages.
* While here, fix some type and style issues.

Sponsored by: Klara, Inc.
Reviewed by: christos, kevans
Differential Revision: https://reviews.freebsd.org/D42010

(cherry picked from commit d7399551b02861b910b15c7b7a78a2835644aa45)

split: Improve GNU compatibility.

* Like GNU split, turn autoextend back on if given -a0.
* Add a test case that verifies that -a<non-zero> turns autoextend off.
* Add a test case that verifies that -a0 turns autoextend back on.

Sponsored by: Klara, Inc.
Reviewed by: christos, kevans
Differential Revision: https://reviews.freebsd.org/D42011

(cherry picked from commit d9d69a6f6fc1f8d80df9ce6493e8ab9388781615)

11 months agolibc: Rewrite quick_exit() and at_quick_exit() using C11 atomics.
Dag-Erling Smørgrav [Tue, 26 Sep 2023 20:06:27 +0000 (22:06 +0200)]
libc: Rewrite quick_exit() and at_quick_exit() using C11 atomics.

Compiler memory barriers do not prevent the CPU from executing the code
out of order.  Switch to C11 atomics.  This also lets us get rid of the
mutex; instead, loop until the compare_exchange succeeds.

While here, change the return value of at_quick_exit() on failure to
the more traditional -1, matching atexit().

Sponsored by: Klara, Inc.
Reviewed by: Olivier Certner, kevans, kib
Differential Revision: https://reviews.freebsd.org/D41936

(cherry picked from commit 1dc3abb052430279e47c8922d22b30922adcf0f6)

libc: Add a rudimentary test for quick_exit(3).

Sponsored by: Klara, Inc.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D41937

(cherry picked from commit c7dd4601aeebbc1bbe131cbe6747476c124b47fe)

11 months agoglabel.8: Warn against using generic labels on a shared device
Mark Johnston [Thu, 26 May 2022 13:48:17 +0000 (09:48 -0400)]
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 81f36fbc98dd74ca923938e0329919d426811b0c)

11 months agohdac: Defer interrupt allocation in hdac_attach()
Mark Johnston [Wed, 27 Sep 2023 12:23:58 +0000 (08:23 -0400)]
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 015daf5221f7588b9258fe0242cee09bde39fe21)

11 months agovfs cache: garbage collect the fullpathfail2 counter
Mateusz Guzik [Thu, 14 Sep 2023 20:25:54 +0000 (20:25 +0000)]
vfs cache: garbage collect the fullpathfail2 counter

The conditions it checks cannot legally be true (modulo races against
forced unmount), so assert on it instead.

(cherry picked from commit 07f52c4b5a4f7a658bf7ed29eadd5c4d52a4f3b2)

11 months agovfs cache: fix a hang when bumping vnode limit too high
Mateusz Guzik [Sat, 2 Sep 2023 14:27:33 +0000 (14:27 +0000)]
vfs cache: fix a hang when bumping vnode limit too high

Overflow in cache_changesize would make the value flip to 0 and stay
there as 0 << 1 does not do anything.

Note callers limit the outcome to something below u_int.

Also note there entire vnode handling thing both in vfs layer as a whole
and this file can't decide whether to long, u_long or u_int.

(cherry picked from commit 32988c1499f8698b41e15ed40a46d271e757bba3)

11 months agovfs: count how many times vnlru got woken up due to vnode shortage
Mateusz Guzik [Sat, 16 Sep 2023 17:26:39 +0000 (17:26 +0000)]
vfs: count how many times vnlru got woken up due to vnode shortage

(cherry picked from commit 9080190b970c7026695571f90b95fdcf7056ec67)

11 months agovfs: stabilize freevnodes_old
Mateusz Guzik [Sat, 16 Sep 2023 15:41:12 +0000 (15:41 +0000)]
vfs: stabilize freevnodes_old

In face of parallel callers.

(cherry picked from commit ef89b78bb1f60484cc743fa590d623ad896ca8e9)

11 months agovfs: s/u_long vstir/bool vstir/
Mateusz Guzik [Sat, 16 Sep 2023 08:19:24 +0000 (08:19 +0000)]
vfs: s/u_long vstir/bool vstir/

(cherry picked from commit 509d843a982b39a531a558c65794ffffcdf93ae8)

11 months agovfs: group vnode-related sysctls under vfs.vnode
Mateusz Guzik [Fri, 15 Sep 2023 21:08:38 +0000 (21:08 +0000)]
vfs: group vnode-related sysctls under vfs.vnode

Instead of having things scattered through vfs, debug and kern trees.

Old names remain for compatibility.

Sample output of "sysctl vfs.vnode":
vfs.vnode.vnlru.failed_runs: 0
vfs.vnode.vnlru.recycles_free: 0
vfs.vnode.vnlru.recycles: 0
vfs.vnode.stats.alloc_sleeps: 0
vfs.vnode.stats.free: 1310
vfs.vnode.stats.skipped_requeues: 0
vfs.vnode.stats.created: 1686
vfs.vnode.stats.count: 1641
vfs.vnode.param.wantfree: 2097152
vfs.vnode.param.limit: 8388608

(cherry picked from commit d3e6478912431309aad36211b6c39b0d741312dc)

11 months agovfs: retire kern.minvnodes
Mateusz Guzik [Sat, 16 Sep 2023 07:33:36 +0000 (07:33 +0000)]
vfs: retire kern.minvnodes

It was marked as legacy in 2005.

(cherry picked from commit 2a689cadf092a3319d7619c3f4aa242011c20c8e)

11 months agovfs: use vnlru_read_freevnodes for the freevnodes sysctl
Mateusz Guzik [Thu, 14 Sep 2023 23:53:11 +0000 (23:53 +0000)]
vfs: use vnlru_read_freevnodes for the freevnodes sysctl

For a more accurate result.

(cherry picked from commit 03bfee175269960c67cab64d761bbb5eb9ac5878)

11 months agovfs: retire vnlru_under_unlocked
Mateusz Guzik [Thu, 14 Sep 2023 23:05:51 +0000 (23:05 +0000)]
vfs: retire vnlru_under_unlocked

It only looks at the centralized value which in corner cases can end up
being negative.

(cherry picked from commit ba5dc166e0f390c703042910b637a83c705c8af3)

11 months agovfs: fix stale comment about freevnodes management
Mateusz Guzik [Thu, 14 Sep 2023 17:28:32 +0000 (17:28 +0000)]
vfs: fix stale comment about freevnodes management

(cherry picked from commit 9dc0c983b0931f359c2ff10d47ad835ef74e929a)

11 months agovfs: don't kick vnlru if it is already running
Mateusz Guzik [Thu, 14 Sep 2023 16:27:47 +0000 (16:27 +0000)]
vfs: don't kick vnlru if it is already running

Further shaves some lock trips.

(cherry picked from commit 76f1153790b6d2e1a4f0389c3ac24e41d08f9ba6)

11 months agovfs: drop one vnode list lock trip during vnlru free recycle
Mateusz Guzik [Thu, 14 Sep 2023 14:35:40 +0000 (14:35 +0000)]
vfs: drop one vnode list lock trip during vnlru free recycle

vnlru_free_impl would take the lock prior to returning even though most
frequent caller does not need it.

Unsurprisingly vnode_list mtx is the primary bottleneck when recycling
and avoiding the useless lock trip helps.

Setting maxvnodes to 400000 and running 20 parallel finds each with a
dedicated directory tree of 1 million vnodes in total:
before: 4.50s user 1225.71s system 1979% cpu 1:02.14 total
after: 4.20s user 806.23s system 1973% cpu 41.059 total

That's 34% reduction in total real time.

With this the block *remains* the primary bottleneck when running on
ZFS.

(cherry picked from commit 74be676d87745eb727642f6f8329236c848929d5)

11 months agomanpages: Fix use of At macro
Mateusz Piotrowski [Thu, 3 Mar 2022 23:03:44 +0000 (00:03 +0100)]
manpages: Fix use of At macro

The versions for the At macro from 1 to 7 must be prefixed with "v".

MFC after: 3 days

(cherry picked from commit 8b73b57c1b4bae9c9862d7655f86d1610f32f083)

11 months agobasename: fix history
Warner Losh [Mon, 21 Jun 2021 14:23:34 +0000 (08:23 -0600)]
basename: fix history

Basename(1) first appeared in the 7th edition. It was not in the 6th
edition, or PWB releases. It's on all the subsequent descendants.

Dirname(1) first appeared in System III, and was later picked up in
4.3-Reno and 8th edition research unix (though was not in 4.1BSD where
the bulk of 8th edition came from). In System III and V8 it was a shell
script, though the BSD version is in C.

Sponsored by: Netflix

(cherry picked from commit f394c73666ba375cbd6114950b1b1ea5943185a8)

11 months agobanner: Correct history.
Warner Losh [Mon, 21 Jun 2021 14:16:10 +0000 (08:16 -0600)]
banner: Correct history.

Banner appeared in the 6th edition of AT&T Research unit. It was
subsequently on all the Berkeley tapes, as well as PWB, System III and
System V. The PWB/AT&T and BSD banner programs were different, and the
current FreeBSD banner program shares many elements of the 3BSD one,
though the font has changed.

Sponsored by: Netflix

(cherry picked from commit b77e235dd52a682c11ddd93256b3848cdc6f1d72)

11 months agorc.conf.5: Add /etc/rc.conf.d/ to FILES
Mateusz Piotrowski [Thu, 7 Jul 2022 18:07:43 +0000 (20:07 +0200)]
rc.conf.5: Add /etc/rc.conf.d/ to FILES

While here, fix the -width argument.

MFC after: 3 days

(cherry picked from commit a6e734d779b3b5f5679588c1e6f66d0d1533fcbf)

11 months agojail.conf.5: List configuration and example files
Mateusz Piotrowski [Fri, 8 Jul 2022 08:43:37 +0000 (10:43 +0200)]
jail.conf.5: List configuration and example files

MFC after: 3 days

(cherry picked from commit ccee95df52c2477d5580024758ab57ee9775da6a)

11 months agoswapinfo.8: Mention BLOCKSIZE in the ENVIRONMENT section
Felix Johnson [Fri, 8 Jul 2022 19:33:02 +0000 (21:33 +0200)]
swapinfo.8: Mention BLOCKSIZE in the ENVIRONMENT section

Copy the ENVIRONMENT section from df(1) to swapinfo(8), except
that the --si option is removed for swapinfo.

PR: 235225
Reported by: 0mp
MFC after: 3 days

(cherry picked from commit 39ad6e289f062fc8da239c0372f49b21f0911060)

11 months agorc.subr: Fix a typo
Mateusz Piotrowski [Fri, 8 Jul 2022 19:34:34 +0000 (21:34 +0200)]
rc.subr: Fix a typo

MFC after: 3 days

(cherry picked from commit 7f6754d9659183a0c56fe76044d7826ca849675f)

11 months agoclock_gettime.2: Add cross references and fix linter warnings
Mateusz Piotrowski [Fri, 8 Jul 2022 19:51:03 +0000 (21:51 +0200)]
clock_gettime.2: Add cross references and fix linter warnings

MFC after: 3 days

(cherry picked from commit 13a9da7d5550392a754fcc72d8ec74c0ddbec26f)

11 months agovtfontcvt(8): Update usage() to match vtfontcvt.8
Mateusz Piotrowski [Tue, 19 Jul 2022 14:34:29 +0000 (16:34 +0200)]
vtfontcvt(8): Update usage() to match vtfontcvt.8

MFC after: 2 weeks

(cherry picked from commit ef2d0816dd0b28560309612b75b301e7f179db8f)

11 months agovtfontcvt.8: Use D1 instead of Ql for readability
Mateusz Piotrowski [Tue, 19 Jul 2022 14:32:41 +0000 (16:32 +0200)]
vtfontcvt.8: Use D1 instead of Ql for readability

MFC after: 2 weeks

(cherry picked from commit cad64622ca704145f7fe108b3a3f3c52d1796e25)

11 months agovtfontcvt.8: Sort synopsis
Mateusz Piotrowski [Tue, 19 Jul 2022 14:32:26 +0000 (16:32 +0200)]
vtfontcvt.8: Sort synopsis

MFC after: 2 weeks

(cherry picked from commit e0bd2ab2eb4a379e73ebd5ca0fd80c3d6ceee5ee)

11 months agovtfontcvt.8: Improve synopsis and -f documentation
Mateusz Piotrowski [Tue, 19 Jul 2022 14:28:22 +0000 (16:28 +0200)]
vtfontcvt.8: Improve synopsis and -f documentation

MFC after: 2 weeks

(cherry picked from commit b38e3722f5df6260a4ec70c9c3cbc00ecf169129)

11 months agopw.8: Refernece to openssl-passwd(1) and crypt(3)
Mateusz Piotrowski [Thu, 21 Jul 2022 17:59:19 +0000 (19:59 +0200)]
pw.8: Refernece to openssl-passwd(1) and crypt(3)

It may be unclear how to generate an encrypted password hash for -H,
so point users to openssl-passwd(1) and crypt(3).

MFC after: 2 weeks

(cherry picked from commit adf9cd56fa8421ffbf2d9c74ada547bdbfa8b143)

11 months agorelease.7: Remove Subversion references
Mateusz Piotrowski [Thu, 21 Jul 2022 18:25:58 +0000 (20:25 +0200)]
release.7: Remove Subversion references

MFC after: 1 week

(cherry picked from commit d3d60927950be441b05ec9317a23c4cbdd91f3c1)

11 months agorelease.7: Update EMDEDDEDPORTS documentation
Mateusz Piotrowski [Thu, 21 Jul 2022 18:21:44 +0000 (20:21 +0200)]
release.7: Update EMDEDDEDPORTS documentation

EMDEDDEDPORTS does not contain devel/subversion anymore.

Fixes: a03128832c6c In extra_chroot_setup(), use 'uname -U' to determine OSVERSION.
MFC after: 1 week

(cherry picked from commit 6542fd4b959fa2919b39690ea3ea83e55848e091)

11 months agodevelopment.7: Remove CVS and SVN cross-references
Mateusz Piotrowski [Thu, 21 Jul 2022 18:33:47 +0000 (20:33 +0200)]
development.7: Remove CVS and SVN cross-references

Instead, point to the homepages of the projects.

MFC after: 1 week

(cherry picked from commit abfa92dee642a3687aaef107203e69722a16ef8c)

11 months agogmirror.8: Remove references rc.early
Mateusz Piotrowski [Thu, 21 Jul 2022 19:43:14 +0000 (21:43 +0200)]
gmirror.8: Remove references rc.early

The manual page of gmirror describes how gmirror providers can be used
for kernel dumps. Unfortunately, the instruction references
/etc/rc.early, which is no longer a part of rc(8).

Remove references to rc.early and suggest creating an rc(8) service
script instead.

Future work: In the Problem Report on Bugzilla, Lawrence Chen suggested
adding example rc(8) scripts to the gmirror. However, those examples
need to be tested before they become official reference examples in the
base. Also, those scripts should probably land directly to /etc/rc.d,
/usr/share/examples/rc.d, or /usr/share/examples/gmirror instead of the
gmirror manual page.

PR: 178818
Reported by: Lawrence Chen <beastie@tardisi.com>
Fixes: dd2b024a336f Removal of early.sh
MFC after: 1 week

(cherry picked from commit a848315f68047ae46a5d96cbc7a890e645ce646f)

11 months agorc: Start testing the rc(8) framework (beginning with *_oomprotect)
Mateusz Piotrowski [Thu, 7 Jul 2022 18:24:27 +0000 (20:24 +0200)]
rc: Start testing the rc(8) framework (beginning with *_oomprotect)

This change adds 2 tests to make sure that the *_oomprotect variable
sets the protection against OOM killer properly within rc(8) scripts.

This is also adding the first tests for the rc(8) framework. More tests
will be added as we go.

PR: 256148
Approved by: des
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35745

(cherry picked from commit e7437ae907c89bf85a99c5cbb7ddd194a1ff1354)

11 months agoexports.5: Clean up EXAMPLES and STANDARDS
Mateusz Piotrowski [Tue, 16 Aug 2022 13:03:20 +0000 (15:03 +0200)]
exports.5: Clean up EXAMPLES and STANDARDS

There was a missing sentence in the description of the second mount
entry in the example. Fix that and some other bits in the EXAMPLES
section.

Also, make the STANDARDS section a bit more readable.

MFC after: 1 week
Sponsored by: Klara Inc.

(cherry picked from commit f9572577cf5f28d8e7592b4f1fb24c54e8e79783)

11 months agoifconfig.8: Improve readability of vlanproto's description
Mateusz Piotrowski [Fri, 19 Aug 2022 16:17:44 +0000 (18:17 +0200)]
ifconfig.8: Improve readability of vlanproto's description

Sponsored by: Klara Inc.
MFC after: 1 week

(cherry picked from commit 197947e0a3b27b0eb455fdcd29def867efe582e6)

11 months agopowerd.8: Provide a whole path to power_profile for clarity
Mateusz Piotrowski [Sat, 25 Feb 2023 16:28:49 +0000 (17:28 +0100)]
powerd.8: Provide a whole path to power_profile for clarity

MFC after: 3 weeks

(cherry picked from commit 28111ddf9ee6d14eea6941a66168f2aeb361746d)

11 months agodate.1: Examples: Use syntax that is also compatible with csh
Mateusz Piotrowski [Mon, 27 Feb 2023 16:34:00 +0000 (17:34 +0100)]
date.1: Examples: Use syntax that is also compatible with csh

MFC after: 1 month
Sponsored by: Klara Inc.

(cherry picked from commit de7a6b6fd04ee686364883a817a4b707e3567d27)

11 months agodtrace_proc.4: Fix the description of pr_sname
Mateusz Piotrowski [Fri, 3 Mar 2023 10:14:41 +0000 (11:14 +0100)]
dtrace_proc.4: Fix the description of pr_sname

MFC after: 2 weeks
Sponsored by: Klara Inc.
Sponsored by: ELW – Entsorgungsbetriebe der Landeshauptstadt Wiesbaden

(cherry picked from commit 0ea0a371d2e0f821e4bd7e1c90c772781d80975e)

11 months agogve: Make LRO work for jumbo packets
Shailend Chand [Thu, 7 Sep 2023 13:28:26 +0000 (09:28 -0400)]
gve: Make LRO work for jumbo packets

Each Rx descriptor points to a packet buffer of size 2K, which means
that MTUs greater than 2K see multi-descriptor packets. The TCP-hood of
such packets was being incorrectly determined by looking for a flag on
the last descriptor instead of the first descriptor.

Also fixed and progressed the version number.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D41754

(cherry picked from commit 5f62584a9adb7887bae33af617cfa4f43017abf8)

11 months agoxhci: Add support for 64-bit DMA in generic XHCI controller driver
Stephen J. Kiernan [Fri, 11 Aug 2023 16:06:02 +0000 (12:06 -0400)]
xhci: Add support for 64-bit DMA in generic XHCI controller driver

The XHCI controller on 64-bit SoCs need to use 64-bit DMA.
Add a quirk to tell the generic XHCI driver that 32-bit DMA needs
to be used, if there are any that may need to use 32-bit DMA only.

PR: 274237
Reviewed by: andrew
Obtained from: Juniper Networks, Inc.

(cherry picked from commit 332af8c25dfc9857e997817281d7b7fa406783ef)

11 months agolocal-unbound: remove stray config.h.in backup
Mina Galic [Wed, 20 Sep 2023 14:39:37 +0000 (07:39 -0700)]
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 948e11aaf420cd7d493cc2e118cacc06d18653fe)

11 months agounbound: Vendor import 1.18.0
Cy Schubert [Tue, 19 Sep 2023 04:17:09 +0000 (21:17 -0700)]
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 8f76bb7dad48538c6832c2fb466a433d2a3f8cd5)

11 months agosqlite3: Vendor import of sqlite3 3.43.1
Cy Schubert [Tue, 19 Sep 2023 15:06:50 +0000 (08:06 -0700)]
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 ec994981447e8a974426660b5071bc405280af73)

11 months agostyle.Makefile.5: Stop documenting NO_MAN
Mateusz Piotrowski [Mon, 17 Jul 2023 12:50:33 +0000 (14:50 +0200)]
style.Makefile.5: Stop documenting NO_MAN

NO_MAN has been an error since 2020 according to UPDATING.

PR: 231357
MFC after: 3 days

(cherry picked from commit 73fb7a7a7342bb590ba53e406b564df0d90c3304)

11 months agostyle.Makefile.5: Wordsmith .PATH description
Mateusz Piotrowski [Mon, 17 Jul 2023 13:06:02 +0000 (15:06 +0200)]
style.Makefile.5: Wordsmith .PATH description

MFC after: 3 days
Fixes: 1ac5586c6d86 style.Makefile.5: Do not require $FreeBSD$ SCM IDs

(cherry picked from commit 9e850513daf9cd1db7980f1f38ef7051331293fd)

11 months agostyle.Makefile.5: Remove $FreeBSD$ from examples
Mateusz Piotrowski [Mon, 17 Jul 2023 13:01:52 +0000 (15:01 +0200)]
style.Makefile.5: Remove $FreeBSD$ from examples

MFC after: 3 days

(cherry picked from commit 22faf70d7e137f39b6afe7da967679a7cdbe3507)

11 months agoObsoleteFiles: remove duplicated and incorrect libclang_rt powerpc64le entries
Dimitry Andric [Fri, 29 Sep 2023 18:41:52 +0000 (20:41 +0200)]
ObsoleteFiles: remove duplicated and incorrect libclang_rt powerpc64le entries

PR: 273776
MFC after: 3 days

(cherry picked from commit e2d3168d1207561df2e1cf0a2a8d13c198e5f8d3)

11 months agoUntie strchrnul() from gdb.
Alexander Motin [Sun, 24 Sep 2023 03:17:29 +0000 (23:17 -0400)]
Untie strchrnul() from gdb.

MFC after: 10 days

(cherry picked from commit 2373e704aa1a5dcb7609badfdb0be4ceb4966d74)

11 months agocopy_file_range: require CAP_SEEK capability
Mariusz Zaborski [Thu, 28 Sep 2023 13:24:39 +0000 (15:24 +0200)]
copy_file_range: require CAP_SEEK capability

When using copy_file_range(2) with an offset parameter,
the CAP_SEEK capability should be required.
This requirement is similar to the behavior observed with
pread(2)/pwrite(2).

Reported by: theraven
Reviewed by:    emaste, theraven, kib, markj
Approved by: secteam
Differential Revision:  https://reviews.freebsd.org/D41967

(cherry picked from commit 15a51d3abaef27ddea66320cac7caa549738a1a6)

11 months agopf: only create sctp multihome states if we pass the packet
Kristof Provost [Fri, 29 Sep 2023 07:23:43 +0000 (09:23 +0200)]
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 480f62ccd8d998e4db9dc13c354a60f8f5e32a33)

11 months agopf: ensure 'off' is always set before use
Kristof Provost [Thu, 28 Sep 2023 07:04:32 +0000 (09:04 +0200)]
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 aefda9c92da6571d405e1b27c5c68333ad8bbc57)

11 months agopf tests: extend SCTP tests to test state removal through ASCONF
Kristof Provost [Tue, 5 Sep 2023 17:00:49 +0000 (19:00 +0200)]
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 97340b68d18bbbdebf0f73ed900c5a33894061dd)

11 months agopf: mark removed connections within a multihome association as shutting down
Kristof Provost [Tue, 5 Sep 2023 16:30:42 +0000 (18:30 +0200)]
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 4d3af82f78961180149e8a579b481dc382f76eef)

11 months agopf: inherit v_tag values to multihomed connections
Kristof Provost [Mon, 4 Sep 2023 16:00:08 +0000 (18:00 +0200)]
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 f1cc29af84475b800df5eb94ff7d5b9484ddbdac)

11 months agopf: improve SCTP state validation
Kristof Provost [Fri, 1 Sep 2023 11:33:56 +0000 (13:33 +0200)]
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 51a78dd2764beabfd19a58b8a8b04387a547f02e)

11 months agopf tests: basic SCTP multihoming test
Kristof Provost [Wed, 2 Aug 2023 08:44:52 +0000 (10:44 +0200)]
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 1a28d5fea7edf200c37d14f7ed5865910664ec3d)

11 months agopf: support SCTP multihoming
Kristof Provost [Wed, 2 Aug 2023 17:05:00 +0000 (19:05 +0200)]
pf: support SCTP multihoming

SCTP may announce additional IP addresses it'll use in the INIT/INIT_ACK
chunks, or in ASCONF chunks at any time during the connection. Parse these
parameters, evaluate the ruleset for the new connection and if allowed
create the corresponding states.

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

(cherry picked from commit 10aa9ddb4d45ab0c8f56b0e91c7e8de213030c0f)

11 months agoipfilter: Add sysctl flag CTLFLAG_TUN to loader tunable
Zhenlei Huang [Fri, 29 Sep 2023 00:01:43 +0000 (08:01 +0800)]
ipfilter: Add sysctl flag CTLFLAG_TUN to loader tunable

The sysctl variable `net.inet.ipf.large_nat` is actually a loader
tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will
report it correctly.

No functional change intended.

Reviewed by: cy (for #network)
Fixes: a805ffbcbce8 ipfilter: Make LARGE_NAT a tunable
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D42005

(cherry picked from commit ba883e7a5ac43b27a373f2b1b0044fd2eb769d4e)
(cherry picked from commit a9359dcde241f17421a71bc8c96dee08625db9dd)

11 months agoip_mroute: Fix sysctl knobs
Zhenlei Huang [Wed, 27 Sep 2023 16:23:22 +0000 (00:23 +0800)]
ip_mroute: Fix sysctl knobs

The loader tunable `net.inet.ip.mfchashsize` does not have corresponding
sysctl MIB entry. Just add it.

While here, the sysctl variable `net.inet.pim.squelch_wholepkt` is actually
a loader tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T`
will report it correctly.

Reviewed by: kp
Fixes: 443fc3176dee Introduce a number of changes to the MROUTING code
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41997

(cherry picked from commit f549e22901b3a391c76659bee55802b1214112fd)
(cherry picked from commit b0f026435a150933ecb6f2d1359fd1b4898657f1)

11 months agoipfw.8: Adjust section for loader tunables
Zhenlei Huang [Thu, 28 Sep 2023 04:58:44 +0000 (12:58 +0800)]
ipfw.8: Adjust section for loader tunables

Move the descriptions of loader tunables from section 'SYSCTL VARIABLES'
to section 'LOADER TUNABLES'.

See also 49197c391b3d (ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables).

MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D41981

(cherry picked from commit 12349f38898f231ca803dcf526bac88cb1b5cd2b)
(cherry picked from commit bb6f9a95402a6c3ab8167481b81465f8ad5016fc)

11 months agoipfw: Add sysctl flag CTLFLAG_TUN to loader tunables
Zhenlei Huang [Mon, 25 Sep 2023 10:10:47 +0000 (18:10 +0800)]
ipfw: Add sysctl flag CTLFLAG_TUN to loader tunables

The following sysctl variables are actually loader tunables. Add sysctl
flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.

 1. net.inet.ip.fw.enable
 2. net.inet6.ip6.fw.enable
 3. net.link.ether.ipfw

No functional change intended.

Reviewed by: glebius
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41928

(cherry picked from commit 49197c391b3d49a33bcd08471bf64d533cd10f9d)
(cherry picked from commit f5f6da90597cb65ce55c4f17718a200097f6f78f)

11 months agonetinet6: Add sysctl flag CTLFLAG_TUN to loader tunables
Zhenlei Huang [Mon, 25 Sep 2023 10:10:47 +0000 (18:10 +0800)]
netinet6: Add sysctl flag CTLFLAG_TUN to loader tunables

The following sysctl variables are actually loader tunables. Add sysctl
flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.

 1. net.inet6.ip6.auto_linklocal
 2. net.inet6.ip6.accept_rtadv
 3. net.inet6.ip6.no_radr

No functional change intended.

Reviewed by: glebius
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41928

(cherry picked from commit 03dac3e37993801dab4418087bfedacce0526e66)
(cherry picked from commit da2b630c12ec074673dfc646b2055a31b0d8d6d9)

11 months agortsock: Add sysctl flag CTLFLAG_TUN to loader tunable
Zhenlei Huang [Mon, 25 Sep 2023 10:10:46 +0000 (18:10 +0800)]
rtsock: Add sysctl flag CTLFLAG_TUN to loader tunable

The sysctl variable `net.route.netisr_maxqlen` is actually a loader
tunable. Add sysctl flag CTLFLAG_TUN to it so that `sysctl -T` will
report it correctly.

No functional change intended.

Reviewed by: glebius
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41928

(cherry picked from commit 21a722d9593eb477f4ccdad011a2b4df0727fc62)
(cherry picked from commit bffb01eda9bffc3307ea8bf70f91087ed316e01c)

11 months agofreebsd-update: Allow for upper/lowercase y/n
Juraj Lutter [Sun, 17 Sep 2023 16:15:27 +0000 (18:15 +0200)]
freebsd-update: Allow for upper/lowercase y/n

Allow for upper/lowercase y/n in "Does this look right?" question.

Reviewed by: emaste
Approved by: emaste
Differential revision: https://reviews.freebsd.org/D40434

(cherry picked from commit 39f4633b3d2354c01a290d5f422dce7874061769)

11 months agofreebsd-update: handle file -> directory on upgrade
Ed Maste [Wed, 27 Sep 2023 13:36:33 +0000 (09:36 -0400)]
freebsd-update: handle file -> directory on upgrade

Upgrading from FreeBSD 13.2 to 14.0 failed with
  install: ///usr/include/c++/v1/__string exists but is not a directory
because __string changed from a file to a directory with an LLVM
upgrade.

Now, remove the existing file when the type conflicts.  Note that this
is only an interim fix to facilitate upgrades from 13.2 for 14.0 BETA
testing.  This change does not handle the directory -> file case and
further work is needed.

PR: 273661
Reviewed by: dim, gordon
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41893

(cherry picked from commit f6d37c9ca13f8ab0ef32cf5344daecb8122d1e85)

11 months agozfs: merge openzfs/zfs@eb62221ff (zfs-2.1-release) into stable/13
Martin Matuska [Sat, 30 Sep 2023 06:52:40 +0000 (08:52 +0200)]
zfs: merge openzfs/zfs@eb62221ff (zfs-2.1-release) into stable/13

OpenZFS release 2.1.13

Notable upstream pull request merges:
 #14828 d91778e31 Remove duplicate code in l2arc_evict()
 #14939 425f7895d Fix the L2ARC write size calculating logic
 #14954 c12b5829e Fix the L2ARC write size calculating logic (2)
 #14963 f28cd347c Store the L2ARC device ashift in the vdev label
 #14981 ef2156c66 Shorten arcstat_quiescence sleep time
 #14987 cb549c742 Fix memory leak in zil_parse()
 #15000 6e79bcd35 Fix remount when setting multiple properties
 #15039 e01e3a4e1 Fix raw receive with different indirect block size
 #15084 846a4cc08 zed: Fix zed ASSERT on slot power cycle
 #15094 1abf68b7a zed: Reduce log noise for large JBODs

Obtained from: OpenZFS
OpenZFS tag: zfs-2.1.13
OpenZFS commit: eb62221ff0f9efbc2ab826ec6f1388c5f05fb664
Relnotes: yes

11 months agoregcomp: use unsigned char when testing for escapes
Christos Zoulas [Wed, 30 Aug 2023 20:37:24 +0000 (20:37 +0000)]
regcomp: use unsigned char when testing for escapes

- cast GETNEXT to unsigned where it is being promoted to int to prevent
  sign-extension (really it would have been better for PEEK*() and
  GETNEXT() to return unsigned char; this would have removed a ton of
  (uch) casts, but it is too intrusive for now).
- fix an isalpha that should have been iswalpha

PR: 264275, 274032
Reviewed by: kevans, eugen (previous version)
Obtained from: NetBSD

(cherry picked from commit 3fb80f1476c7776f04ba7ef6d08397cef6abcfb0)

11 months agopf: add note about changes ported from OpenBSD after 4.5
Ed Maste [Wed, 27 Sep 2023 17:59:30 +0000 (13:59 -0400)]
pf: add note about changes ported from OpenBSD after 4.5

The last comprehensive sync with OpenBSD's pf corresponds to
OpenBSD 4.5, but many changes have been ported over since then.

Reviewed by: kp, gbe, Kajetan Staszkiewicz <vegeta@tuxpowered.net>
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42002

(cherry picked from commit 3e609fd481c07802fe837ed834c3710b8c19493c)

11 months agovge: correct pause_frames sysctl description
Priit Trees [Fri, 28 Jul 2023 21:41:22 +0000 (21:41 +0000)]
vge: correct pause_frames sysctl description

Reviewed by: emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/806

(cherry picked from commit 0a5d2802b41fd216d9a345f749af1a6ccbe9f382)

11 months agoping: The -C option is also supported for IPv6.
Dag-Erling Smørgrav [Tue, 19 Sep 2023 08:47:11 +0000 (10:47 +0200)]
ping: The -C option is also supported for IPv6.

MFC after: 3 days
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: rscheff, allanjude
Differential Revision: https://reviews.freebsd.org/D41881

(cherry picked from commit a2d1360142f609485c9301df08cc99140743ef2b)

11 months agoRemove mention of defunct mailing list from acl / mac man pages.
Dag-Erling Smørgrav [Fri, 22 Sep 2023 07:42:57 +0000 (09:42 +0200)]
Remove mention of defunct mailing list from acl / mac man pages.

Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D41923

(cherry picked from commit b653faaa19c47a4a7e488e5ead738b7ae44ffe8b)

Fix typos in acl_get_entry(3) manual page.

Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D41924

(cherry picked from commit c34fce8a039935e06ed84db1395d7d2c551e5a7c)

11 months agovfs_remount_ro(): mnt_lockref should be only accessed after vfs_op_enter()
Konstantin Belousov [Wed, 20 Sep 2023 03:42:31 +0000 (06:42 +0300)]
vfs_remount_ro(): mnt_lockref should be only accessed after vfs_op_enter()

PR: 273953

(cherry picked from commit c584bb9cac16bc200ac45cc8b709e7e7e99e24bb)

11 months agodevfs: add integrity asserts for cdevp_list
Jason A. Harmening [Tue, 19 Sep 2023 13:44:34 +0000 (08:44 -0500)]
devfs: add integrity asserts for cdevp_list

It's possible for misuse of cdev KPIs or for bugs in devfs itself to
result in e.g. a cdev object's container being freed while still on the
global list used to populate each devfs mount; see PR 273418 for a
recent example.

Since a node may be marked inactive well before it is reaped from the
list, add a new flag solely to track list membership, and employ it in
some basic list integrity assertions to catch bad actors.

Discussed with: kib, mjg

(cherry picked from commit 67864268da53b792836f13be10299de8cd62997e)

11 months agosocket tests: Avoid a buffer leak
Mark Johnston [Wed, 27 Sep 2023 12:30:50 +0000 (08:30 -0400)]
socket tests: Avoid a buffer leak

Reported by: Coverity
Fixes: 38426b32e106 ("socket tests: Add a regression test for MSG_WAITALL")

(cherry picked from commit a3074ff2122faf0eaba7d3f989e916b1c7f21912)

11 months agodtrace: Fix a kernel panic in printm()
Domagoj Stolfa [Wed, 6 Sep 2023 13:25:00 +0000 (09:25 -0400)]
dtrace: Fix a kernel panic in printm()

When using printm(), one should always pass a scratch pointer to it.
This is achieved by calling printm with memref

  BEGIN { printm(fixed_len, memref(ptr, var_len)); }

which will return a pointer to the DTrace scratch space of size
sizeof(uintptr_t) * 2. However, one can easily call printm() as follows

  BEGIN { printm(10, (void *)NULL); }

and panic the kernel as a result. This commit does two things:

  (1) adds a new macro DTRACE_INSCRATCHPTR(mstate, ptr, howmany) which
      checks if a certain pointer is in the DTrace scratch space;
  (2) uses DTRACE_INSCRATCHPTR() to implement a check on printm()'s DIFO
      return value in order to avoid the panic and sets CPU_DTRACE_BADADDR
      if the address is not in the scratch space.

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

(cherry picked from commit 8527bb2aee6ca9013c34445de88217a954b6628d)

11 months agosocket tests: Add a regression test for MSG_WAITALL
Mark Johnston [Thu, 31 Aug 2023 17:29:29 +0000 (13:29 -0400)]
socket tests: Add a regression test for MSG_WAITALL

PR: 212716
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 38426b32e106cf251520259b29779372eda7a5f8)

11 months agosockets: re-check socket state after call to pr_rcvd()
Greg Becker [Sat, 9 Sep 2023 23:38:24 +0000 (18:38 -0500)]
sockets: re-check socket state after call to pr_rcvd()

Socket state may have changed after dropping the receive
buffer lock in order to call pr_rcvd().  If the buffer is
empty, re-check the state after reaquiring the lock and
skip calling sbwait() if the socket is in error or the
peer has closed.

PR: 212716
Reviewed by: markj, glebius
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41783

(cherry picked from commit f44102411e1b16363e91a074c9c403069c550e4d)

11 months agoipfilter: Avoid allocating a new ipf token when not needed
Cy Schubert [Tue, 12 Sep 2023 20:29:29 +0000 (13:29 -0700)]
ipfilter: Avoid allocating a new ipf token when not needed

Only allocate a new ipftoken_t if one cannot be found. This eliminates
allocating unnecessary token structures that will never be used when
performing simple lookups for existing token structures.

(cherry picked from commit 7f5e3b9fa3d159b7f061b4d01a767cbe5d0527f3)

11 months agoports(7): Update the default setting of MASTER_SITE_INDEX
Li-Wen Hsu [Sun, 24 Sep 2023 02:58:33 +0000 (10:58 +0800)]
ports(7): Update the default setting of MASTER_SITE_INDEX

MFC after: 3 days

(cherry picked from commit 855e0457396c7addb1df6fc1d14200cc8de286c0)

11 months agolibprocstat: use elf_getphdrnum rather than deprecated elf_getphnum
John Hein [Thu, 21 Sep 2023 23:43:05 +0000 (17:43 -0600)]
libprocstat: use elf_getphdrnum rather than deprecated elf_getphnum

PR:             273966
Reviewed by: emaste

(cherry picked from commit 633094c27f0ac1b1001d5bd24a883240b4bce1dc)
(cherry picked from commit fd8bf2ecc05af841aa7e8369a43861cdc122d404)

11 months agoswitch groff parameter -man to -mandoc for new groff release 1.23.0
Wolfram Schneider [Thu, 7 Sep 2023 14:59:12 +0000 (14:59 +0000)]
switch groff parameter -man to -mandoc for new groff release 1.23.0

PR: 273565

(cherry picked from commit cd89fe3923e92ab090cbdff7eb215c2d85b51718)

11 months agoswitch groff parameter -man to -mandoc
Wolfram Schneider [Thu, 7 Sep 2023 06:28:24 +0000 (06:28 +0000)]
switch groff parameter -man to -mandoc

groff 1.23.0 changed the semantics of the -man parameter, and many
manual pages are not rendered. The -mandoc parameter brings back
the old behavior, as in groff 1.22.4 and earlier.

PR: 273565, 273245

Reviewed by: emaste, bapt
MFC after: 1 week for all supported branches (stable/12, 13, 14)
Differential Revision: https://reviews.freebsd.org/D41737

(cherry picked from commit 035f7c9a3653d91564a5513f1311aa3b6e14a17e)

11 months agoaxge: Skip dummy packet headers
Damien Broka [Wed, 13 Sep 2023 08:23:47 +0000 (09:23 +0100)]
axge: Skip dummy packet headers

Newer versions of the AX88179 interweave dummies alongside valid
packet headers in bulk IN transfer data. This was probably done for
backward compatibility with existing drivers.

However current driver records these dummy headers as dropped frames,
leading to stats misreporting one Ierr per Ipkt.

This skips those dummy headers silently, thereby not generating Ierrs
for them.

Reviewed by: emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/842

(cherry picked from commit 70fbcd451b68b7f6038d8a602cd8d5e1bb890f1d)

11 months agobuf.h: Fix declaration of unmapped_buf
Sebastian Huber [Tue, 19 Jul 2022 18:09:43 +0000 (20:09 +0200)]
buf.h: Fix declaration of unmapped_buf

For architectures with a small-data area, the __read_mostly section must
present at the object declaration.

(emaste note: This does not appear to have an affect within FreeBSD, but
may be needed by downstream projects that handle __read_mostly /
__section(".data.read_mostly") differently.)

Pull Request: https://github.com/freebsd/freebsd-src/pull/608

(cherry picked from commit ede6c6c0434a266a1712ffe807f4e31e229948df)

11 months agoRemove "All Rights Reserved" from Foundation copyrights
Ed Maste [Thu, 30 Jun 2022 14:52:29 +0000 (10:52 -0400)]
Remove "All Rights Reserved" from Foundation copyrights

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 7fde0187cc443468561f0a30d589ff0cfe45eef5)
(cherry picked from commit 560e22c8fe460e00d16e5268fe1fbb316ad81101)
(cherry picked from commit 5b5fa75acff11d871d0c90045f8c1a58fed85365)

11 months agopf: fix state leak
Kristof Provost [Wed, 6 Sep 2023 07:58:07 +0000 (09:58 +0200)]
pf: fix state leak

If we hit the csfailed case in pf_create_state() we may have allocated
a state, so we must also free it. While here reduce the amount of
duplicated cleanup code.

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

(cherry picked from commit b6ce41118bb11d3db86eae8fbebc8c198e8b330d)

11 months agoarm64: Fix errata workarounds that depend on smccc
Andrew Turner [Mon, 18 Sep 2023 16:34:51 +0000 (17:34 +0100)]
arm64: Fix errata workarounds that depend on smccc

Some arm64 errata depend on calling into the firmware via the SMCCC
interface. This needs to happen after the psci driver has attached
as they share the interface.

Fix this by allowing the workarounds to mark when they depend on
device drivers attaching.

This is only an issue on CPU 0 as the workarounds are applied later
for the non-boot CPUs.

Reviewed by: emaste
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41916

(cherry picked from commit c643e82dba0b17b2716de4c9d44a3c9c547cbbd5)
(cherry picked from commit 843bea18711d726cd2f0a3c3f9144b218e4de3e8)