]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 months agobhyve: make use of helper to read PCI IDs from bhyve config
Corvin Köhne [Mon, 6 Feb 2023 10:13:56 +0000 (11:13 +0100)]
bhyve: make use of helper to read PCI IDs from bhyve config

For compatibilty reasons, the old config values are still supported.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D38403

(cherry picked from commit b72e06b13ee08b94a3e74ac2473e889aeb7a3d1a)

15 months agobhyve: add helper to read PCI IDs from bhyve config
Corvin Köhne [Mon, 6 Feb 2023 10:43:49 +0000 (11:43 +0100)]
bhyve: add helper to read PCI IDs from bhyve config

Changing the PCI IDs is valuable in some situations. The Intel GOP
driver requires that some PCI IDs of the LPC bridge are aligned with the
physical values of the host LPC bridge. Another use case are oracles
virtio driver. They require different subvendor ID than the default one.
For that reason, create a helper which makes it easy to read PCI IDs
from bhyve config. Additionally, this helper ensures that all emulation
devices are using the same config keys.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D38402

(cherry picked from commit ffaed739a80319a56d0b1dfd6cedeb3d194ff42c)

15 months agopci: add tunable hw.pci.enable_mps_tune
Corvin Köhne [Mon, 6 Feb 2023 09:26:33 +0000 (09:26 +0000)]
pci: add tunable hw.pci.enable_mps_tune

If the tunable is set to 0, the tuning of the MPS (maximum payload size)
is disabled and the default MPS values set by the BIOS are used. In this
case the system may use a lower speed or operate in a less optimized
state, but it can resolve issues with stability and compatibility. With
specific devices the tuning of the mps, can lead to a complete freeze of
the system.

Reviewed by: manu
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D38397

(cherry picked from commit 48d70503bcae816eea6109c30ba79261eb47c9d0)

15 months agoAlways install llvm-objdump as objdump
Ed Maste [Fri, 18 Nov 2022 20:47:13 +0000 (15:47 -0500)]
Always install llvm-objdump as objdump

Instead of providing no /usr/bin/objdump when LLVM_BINUTILS is false.

PR: 267854 [exp-run]
Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37445

(cherry picked from commit 86edb11e7491e657e6c75ef6814867021665c377)

15 months agoAdd myself (cc) as a src commiter.
Cheng Cui [Fri, 31 Mar 2023 10:06:52 +0000 (06:06 -0400)]
Add myself (cc) as a src commiter.

Summary: Adding mentor relationships for cc when committing new diffs.

Reviewed by: rscheff (mentor), tuexen (mentor)
Approved by: rscheff (mentor), tuexen (mentor)
Differential Revision: https://reviews.freebsd.org/D39368

(cherry picked from commit 95940a2d2442c4ae47013b8ddb5bfb8bb5e40b39)

15 months agoMFV: xz 5.4.2.
Xin LI [Mon, 20 Mar 2023 02:30:08 +0000 (19:30 -0700)]
MFV: xz 5.4.2.

(cherry picked from commit c917796c041664a04153af24c2e68cc963fe52bc)

15 months agohv_hid: Hyper-V HID driver
Yuri [Sun, 5 Feb 2023 15:32:08 +0000 (18:32 +0300)]
hv_hid: Hyper-V HID driver

Hyper-V HID driver using hidbus/hms.

Reviewed by: wulf
MFC after: 1 week
PR: 221074
Differential revision: https://reviews.freebsd.org/D38140

(cherry picked from commit e4d3f1e40ab3327e4ff6f689f54a64bd2ebc0568)

15 months agodevd.conf.5: Fix a typo in the manual page
Gordon Bergling [Sun, 26 Mar 2023 07:43:58 +0000 (09:43 +0200)]
devd.conf.5: Fix a typo in the manual page

- s/deteted/detected/

(cherry picked from commit 328ebd4680563d62d79c724ab6bbeaadafba7997)

15 months agovnode_pager_input: return runningbufspace back
Konstantin Belousov [Fri, 24 Mar 2023 21:12:21 +0000 (23:12 +0200)]
vnode_pager_input: return runningbufspace back

(cherry picked from commit 28f957b8b3a22086927451fee89789fdf596260b)

15 months agofdesc_allocvp(): fix potential use after free
Konstantin Belousov [Tue, 21 Mar 2023 21:24:06 +0000 (23:24 +0200)]
fdesc_allocvp(): fix potential use after free

(cherry picked from commit 51b8ffb95c4fe45f6825d551bd093889820a8115)

15 months agofdescfs: remove useless XXX comment, unwrap line
Konstantin Belousov [Tue, 21 Mar 2023 21:28:16 +0000 (23:28 +0200)]
fdescfs: remove useless XXX comment, unwrap line

(cherry picked from commit fa3ea81b77e41e3f33a611e51fd8bcbb2f4c8a95)

15 months agoSupport compilation with llvm 15
Mateusz Guzik [Thu, 30 Mar 2023 14:53:33 +0000 (14:53 +0000)]
Support compilation with llvm 15

This is a direct bare minimum commit.

15 months agorarpd(8): Fix a typo in a source code comment
Gordon Bergling [Mon, 27 Mar 2023 06:45:30 +0000 (08:45 +0200)]
rarpd(8): Fix a typo in a source code comment

- s/combinataion/combination/

Obtained from: NetBSD

(cherry picked from commit 107597fbd4dcd6d0a6ec09913642af151635b77a)

15 months agoRewrite function definitions with identifier lists.
Kirk McKusick [Wed, 22 Mar 2023 22:57:26 +0000 (15:57 -0700)]
Rewrite function definitions with identifier lists.

A few functions snuck in with K&R style definitions.

Also add some missing memory frees.

(cherry picked from commit e5d0d1c5fbbc0ce44fdc720a35b499056fe60b06)

15 months agopf: remove pd_refs from pfsync
Kristof Provost [Fri, 24 Mar 2023 06:04:56 +0000 (07:04 +0100)]
pf: remove pd_refs from pfsync

It only served to complicate cleanup, and added no value.

While here drop packets in pfsync_defer_tmo() if we don't have a syncif,
rather than just leaving them on the queue.

Reviewed by: markj
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D39248

(cherry picked from commit 27b23cdec9d1255e014ea0decac42a5be8d00735)

15 months agopfsync: hold b_mtx for callout_stop(pd_tmo)
Kristof Provost [Wed, 22 Mar 2023 13:46:25 +0000 (14:46 +0100)]
pfsync: hold b_mtx for callout_stop(pd_tmo)

The pd_tmo callout has an associated mutex, which we must hold while
calling callout_stop().

Reported by: markj
Reviewed by: markj
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D39223

(cherry picked from commit 01194da28a2123a2aa09808319f152fa115f60f1)

15 months agoamd64 wakeup: recalculate mitigations after APICs are woken
Konstantin Belousov [Tue, 28 Mar 2023 23:51:44 +0000 (02:51 +0300)]
amd64 wakeup: recalculate mitigations after APICs are woken

PR: 270489
Approved by: re (cperciva)

(cherry picked from commit cd137909c3097fe223ce2b49075eed42a4933bb5)

15 months agoxhci(4): Describe Fresco Logic FL1009 USB 3.0 controller
Zhenlei Huang [Mon, 20 Mar 2023 04:00:59 +0000 (12:00 +0800)]
xhci(4): Describe Fresco Logic FL1009 USB 3.0 controller

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D38922

(cherry picked from commit 082895ebecb55f342dec918c555309c11e3fe17f)

15 months agouhci(4): Add IDs for Zhaoxin USB controller
Dmitry Luhtionov [Tue, 17 Jan 2023 10:43:24 +0000 (11:43 +0100)]
uhci(4): Add IDs for Zhaoxin USB controller

Tested by: Weitao Wang <WeitaoWang-oc@zhaoxin.com>
MFC after: 1 week
Sponsored by: NVIDIA Networking
Differential Revision: https://reviews.freebsd.org/D38924

(cherry picked from commit 986c7be472bd8b29bb280e72b57e6cbf1851b26f)
(cherry picked from commit b754d7faafd3536889bb6078b9fd11ef2e7717d7)

15 months agoehci(4): Add IDs for for Zhaoxin USB 2.0 controller
Dmitry Luhtionov [Tue, 17 Jan 2023 10:43:33 +0000 (11:43 +0100)]
ehci(4): Add IDs for for Zhaoxin USB 2.0 controller

Tested by: Weitao Wang <WeitaoWang-oc@zhaoxin.com>
MFC after: 1 week
Sponsored by: NVIDIA Networking
Differential Revision: https://reviews.freebsd.org/D38923

(cherry picked from commit f9237e1937a4e399e08ca8e5bd88a60910e74be6)
(cherry picked from commit 95b2d16b38a720108a51f9e8ce0685244e3e3ea4)

15 months agoxhci(4): Add IDs for Zhaoxin USB 3.0 controllers
Dmitry Luhtionov [Tue, 17 Jan 2023 10:43:40 +0000 (11:43 +0100)]
xhci(4): Add IDs for Zhaoxin USB 3.0 controllers

Reviewed by: hselasky
Tested by: Weitao Wang <WeitaoWang-oc@zhaoxin.com>
MFC after: 1 week
Sponsored by: NVIDIA Networking
Differential Revision: https://reviews.freebsd.org/D38921

(cherry picked from commit 0d7064d58f897c95c3bd319b497f70c8177e0de6)
(cherry picked from commit f50f53931edb24c5f30434603f5d1d3043effc0c)

15 months agopath_test: Add a test case for openat(O_EMPTY_PATH) in capability mode
Mark Johnston [Wed, 22 Mar 2023 12:51:58 +0000 (08:51 -0400)]
path_test: Add a test case for openat(O_EMPTY_PATH) in capability mode

MFC after: 1 week

(cherry picked from commit e5e1d9c7b781470b2eb31d80f40927481e0053b8)

15 months agocontrib/tzdata: import tzdata 2023c
Philip Paeps [Wed, 29 Mar 2023 01:09:54 +0000 (09:09 +0800)]
contrib/tzdata: import tzdata 2023c

Changes: https://github.com/eggert/tz/blob/2023c/NEWS

The tzdata 2023c release reverts all changes made in 2023b other than
commentary, as that appears to be the best of a bad set of short-notice
choices for modeling this week's daylight saving chaos in Lebanon.

(cherry picked from commit 9fbeeb6e38310b4f42a14c4b043bbee82c5e4752)

15 months agoUpdates to UFS/FFS superblock integrity checks when reading a superblock.
Kirk McKusick [Tue, 28 Mar 2023 22:49:49 +0000 (15:49 -0700)]
Updates to UFS/FFS superblock integrity checks when reading a superblock.

Back out MFC commit 4660b60a00c3120ddecd94b3f308d39bcb6d085a as it has
had reported problems.

15 months agonetmap: get rid of save_if_input for emulated adapters
Vincenzo Maffione [Tue, 14 Mar 2023 21:59:23 +0000 (21:59 +0000)]
netmap: get rid of save_if_input for emulated adapters

The save_if_input function pointer was meant to save the previous
value of ifp->if_input before replacing it with the emulated
adapter hook.
However, the same pointer value is already stored in the if_input
field of the netmap_adapter struct, to be used for host TX ring processing.

Reuse the netmap_adapter if_input field to simplify the code
and save some space.

MFC after: 14 days

(cherry picked from commit 6c9fe357435db6408ec6b01221b9ff9e7e9b0ff1)

15 months agoCorrect several bugs in fsck_ffs(8) triggered by corrupted filesystems.
Kirk McKusick [Tue, 7 Mar 2023 23:12:37 +0000 (15:12 -0800)]
Correct several bugs in fsck_ffs(8) triggered by corrupted filesystems.

If a directory entry has an illegal inode number (less than zero
or greater than the last inode in the filesystem) the entry is removed.
If a directory '.' or '..' entry had an illegal inode number they
were being removed. Since fsck_ffs knows what the correct value is
for these two entries fix them rather deleting them.

Add much more extensive cylinder group checks and use them to be
more careful about rebuilding a cylinder group.

Check for out-of-range block numbers before trying to free them.

When a directory is deleted also remove its cache entry created
in pass1 so that later passes do not try to operate on a deleted
directory.

Check for ctime(3) returning NULL before trying to use its return.

When freeing a directory inode, do not try to interpret it as a
directory.

Reserve space in the inostatlist to have room to allocate a
lost+found directory.

If an invalid block number is found past the end of an inode simply
remove it rather than clearing and removing the inode.

Modernize the inoinfo structure to use queue(3) LIST rather than a
handrolled linked list implementation.

Reported by:  Bob Prohaska, John-Mark Gurney, and Mark Millard
Tested by:    Peter Holm
Reviewed by:  Peter Holm
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38668

(cherry picked from commit 52f9710412ee6a5bfacae125e24399634d71288d)

15 months agoUpdates to UFS/FFS superblock integrity checks when reading a superblock.
Kirk McKusick [Mon, 27 Mar 2023 23:45:59 +0000 (16:45 -0700)]
Updates to UFS/FFS superblock integrity checks when reading a superblock.

Have to add a check that the computed cylinder group size does not
exceed the block size of the filesystem.

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

(cherry picked from commit 0eabe33087d8cb69ae800daae322f12a8f16bd10)

15 months agopanic(9): some updates
Mitchell Horne [Mon, 20 Mar 2023 19:55:55 +0000 (16:55 -0300)]
panic(9): some updates

 - Better description of what the panic() function does
 - Document KERNEL_PANICKED()
 - Add a section describing panic execution context
 - Add SEE ALSO

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

(cherry picked from commit d5e105bf7e4cb7e80eb4a4f8960bd6dd12fc4885)

15 months agoKASSERT(9): some updates
Mitchell Horne [Mon, 20 Mar 2023 19:54:11 +0000 (16:54 -0300)]
KASSERT(9): some updates

 - Add a little bit of introductory text
 - Improve the existing example: ANSI C, use a better assertion than a
   NULL check (which is discouraged)
 - Document the widely used MPASS macro in this page
 - Drop the cross-reference to config(8)

Reviewed by: kib, markj, rpokala, Pau Amma <pauamma@gundo.com>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39131

(cherry picked from commit 87132d1dce4b61c782871f450c17b818bf991ff6)

15 months agocritical(9): small updates
Mitchell Horne [Mon, 20 Mar 2023 19:50:50 +0000 (16:50 -0300)]
critical(9): small updates

 - Document CRITICAL_ASSERT() in this man page.
 - Clarify that a thread may also handle interrupts in a critical
   section, not only faults/exceptions.
 - Note the negative effects of critical section abuse
 - Some other minor clarifications
 - Add short SEE ALSO

Reviewed by: kib, markj, rpokala, Pau Amma <pauamma@gundo.com>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39130

(cherry picked from commit 43db15b16aa6ee24613d0b25cbf50f2aef5850d1)

15 months agopkg-stage.sh: update port trailing version information
Glen Barber [Mon, 20 Mar 2023 14:36:51 +0000 (10:36 -0400)]
pkg-stage.sh: update port trailing version information

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

(cherry picked from commit e4e139b828a2278b44496653c1cd5e6298afb3c6)

15 months agobhyve: Sleep briefly in the VMEXIT_DEBUG handler
Mark Johnston [Wed, 22 Mar 2023 13:02:54 +0000 (09:02 -0400)]
bhyve: Sleep briefly in the VMEXIT_DEBUG handler

As of commit 0bda8d3e9f7a ("vmm: permit some IPIs to be handled by
userspace") and commit 9cc9abf409cc ("bhyve: create all vcpus on
startup"), we have a misbehaviour where AP vCPU threads spin until they
receive a SIPI.  In particular, since they are "suspended", they simply
call the VMEXIT_DEBUG handler in a loop, but the handler is a no-op by
default.

This is tricky to fix since the gdb stub isn't aware of whether a given
vCPU is supposed to be running.  For 13.2's sake, introduce a simple
workaround wherein the VMEXIT_DEBUG handler sleeps for a short period.
This ensures that host CPU usage remains sane when VMs are starting
without penalizing users of VMEXIT_DEBUG too much.

Reviewed by: corvink, jhb
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39174

(cherry picked from commit ef0ac973dbc8c54214ac8c61891abd832cd5b700)

15 months agonetgraph tests: Serialize
Mark Johnston [Sat, 18 Mar 2023 14:57:36 +0000 (10:57 -0400)]
netgraph tests: Serialize

Some tests share names for netgraph nodes, so they cannot be run in
parallel.

MFC after: 1 week

(cherry picked from commit bad8f86843fa34bf4d4d2bfb8183331c02ced87f)

15 months agovmrun: Expose bhyve's -G option
Mark Johnston [Mon, 20 Mar 2023 20:23:26 +0000 (16:23 -0400)]
vmrun: Expose bhyve's -G option

MFC after: 1 week

(cherry picked from commit b59f9d03cd87b721e22e1d2b37876d3d2a86a3f1)

15 months agolibdtrace: fix indendation in dt_printd()
Christos Margiolis [Mon, 20 Mar 2023 13:34:20 +0000 (09:34 -0400)]
libdtrace: fix indendation in dt_printd()

No functional change.

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39145

(cherry picked from commit 3afba490c1266200e9fd899f2494aa47f71c6095)

15 months agonetipsec tests: Serialize
Mark Johnston [Mon, 20 Mar 2023 16:15:32 +0000 (12:15 -0400)]
netipsec tests: Serialize

The tunnel mode tests use VNET jails and reuse jail names.  Until this
is addressed, serialize them.

MFC after: 1 week

(cherry picked from commit cc9158d74d306fdbee2f5f014e5d267eca0aa6d1)

15 months agopf tests: try to trigger locking issues in pfsync_timeout()
Kristof Provost [Mon, 20 Mar 2023 13:58:34 +0000 (14:58 +0100)]
pf tests: try to trigger locking issues in pfsync_timeout()

PR: 268246
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC (Netgate)

(cherry picked from commit a6719858a48019aa54e1ea3be57d17fa88b080c6)

15 months agopfsync: add missing unlock in pfsync_defer_tmo()
Kristof Provost [Mon, 20 Mar 2023 13:26:33 +0000 (14:26 +0100)]
pfsync: add missing unlock in pfsync_defer_tmo()

The callout for pfsync_defer_tmo() is created with
CALLOUT_RETURNUNLOCKED, because while the callout framework takes care
of taking the lock we want to run a few operations outside of the lock,
so we unlock ourselves.

However, if `sc->sc_sync_if == NULL` we return without releasing the
lock, and leak the lock, causing later deadlocks.
Ensure we always release the bucket lock when we exit pfsync_defer_tmo()

PR: 268246
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC (Netgate)

(cherry picked from commit 844ad2828a35c434b893af4274b1f6c50332dd70)

15 months agopfsync: fix pfsync_undefer_state() locking
Kristof Provost [Mon, 20 Mar 2023 13:29:55 +0000 (14:29 +0100)]
pfsync: fix pfsync_undefer_state() locking

pfsync_undefer_state() takes the bucket lock, but could get called from
places (e.g. from pfsync_update_state() or pfsync_delete_state()) where
we already held the lock.

As it can also be called from places where we don't yet hold the lock
create new locked variant for use when the lock is already held. Keep
using pfsync_undefer_state() where the lock must still be taken.

PR: 268246
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC (Netgate)

(cherry picked from commit 53247cdf12449e90f6736ae563e4cce8315c923f)

15 months agovmm: fix missing ipi statistic
Vitaliy Gusev [Fri, 17 Mar 2023 09:17:22 +0000 (10:17 +0100)]
vmm: fix missing ipi statistic

ipi counters are missing in bhyvectl's output because vm_maxcpu is 0
when initializing them. That's because vmm_stat_register is executed
before vmm_init.

Instead of directly fixing it, there's a better solution in illumos
which is cherry picked:
https://github.com/illumos/illumos-gate/commit/65a3bc83734e5fb0fc2c19df3e5112b87dcdc3f8

It replaces the matrix statistic by two counters per vcpu. One for
counting the ipis to the vcpu and one counting the ipis received by the
vcpu. This has several advantages:

- A matrix statistic becomes huge when using many vcpus.
- A matrix statistic easily reaches the MAX_VMM_STAT_ELEMS limit.
- Two counters are enough in most cases. DTrace can be used for more
  advanced debugging purposes.
- A matrix statistic wastes memory. The matrix size is determined by
  vm_maxcpu regardless of the number of vcpus assigned to the vm.

Reviewed by: corvink, markj
Fixes: ee98f99d7a68b284a669fefb969cbfc31df2d0ab ("vmm: Convert VM_MAXCPU into a loader tunable hw.vmm.maxcpu.")
MFC after: 1 week
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D39038

(cherry picked from commit 94a3876d7e18ada9596464623829d37d186da856)

15 months agobhyve: add cmdline option to enable qemu's fwcfg
Corvin Köhne [Wed, 18 Aug 2021 07:31:59 +0000 (09:31 +0200)]
bhyve: add cmdline option to enable qemu's fwcfg

Let the user decide if he wants to use bhyve's fwctl or qemu's fwcfg. He
can set the interface by adding a fwcfg option to bootrom:

-l bootrom,<path/to/rom>,fwcfg=bhyve
-l bootrom,<path/to/rom>,fwcfg=qemu

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D38337

(cherry picked from commit d85147f3d6811c04e250bfb4597783d8844de315)

15 months agobhyve: add helper for adding fwcfg files
Corvin Köhne [Wed, 11 Aug 2021 08:04:36 +0000 (10:04 +0200)]
bhyve: add helper for adding fwcfg files

Fwcfg items without a fixed index are reported by the file_dir. They
have an index of 0x20 and above. This helper simplifies the addition of
such fwcfg items. It selects a new free index, assigns it to the fwcfg
items and creates an proper entry in the file_dir.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D38336

(cherry picked from commit 6f9ebb3d0fed2b0ae604dd6daf17f1fe1d8df216)

15 months agocontrib/tzdata: import tzdata 2023b
Philip Paeps [Fri, 24 Mar 2023 04:45:24 +0000 (12:45 +0800)]
contrib/tzdata: import tzdata 2023b

Changes: https://github.com/eggert/tz/blob/2023b/NEWS

(cherry picked from commit 2084f6a496cefb5da9dbdabad5aa99342e2fc163)

15 months agoping: Avoid magic numbers
Jose Luis Duran [Fri, 17 Mar 2023 13:24:44 +0000 (09:24 -0400)]
ping: Avoid magic numbers

The sizeof(struct ip) is 20.
The sizeof(struct in_addr) is 4.

No functional change intended.

Reviewed by: asomers, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39125

(cherry picked from commit 491263d7a640a85a6be40fd0c0a9397d072f0847)

15 months agoprintf(9): add MLINKS for vlog(9) and vprintf(9)
Mitchell Horne [Sun, 12 Feb 2023 18:58:50 +0000 (14:58 -0400)]
printf(9): add MLINKS for vlog(9) and vprintf(9)

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 84a44625a50fc548aae43af9e9738c1934b3e611)

15 months agoCross-reference coretemp(4) and amdtemp(4)
Mitchell Horne [Tue, 31 Jan 2023 16:41:32 +0000 (12:41 -0400)]
Cross-reference coretemp(4) and amdtemp(4)

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 005b7c5790ef913bb8053f890d9653228e577185)

15 months agovcount.9: remove obsolete man page
Mitchell Horne [Mon, 20 Mar 2023 19:49:59 +0000 (16:49 -0300)]
vcount.9: remove obsolete man page

These functions, vcount() and count_dev(), no longer exist in the source
tree.

Reviewed by: rpokala
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39128

(cherry picked from commit b54391a1f83169f847e5f28e29d1938a154d54e0)

15 months agoarm64: limit EFI excluded regions to physical memory types
Mitchell Horne [Wed, 15 Mar 2023 15:26:57 +0000 (12:26 -0300)]
arm64: limit EFI excluded regions to physical memory types

Consolidate add_efi_map_entry() and exclude_efi_map_entry() into a
single function, handle_efi_map_entry(), so that the exact set of entry
types handled is the same in the addition or exclusion cases. Before,
exclude_efi_map_entry() had a 'default' case that would exclude all
entry types that were not listed explicitly in the switch statement.

Logically, we do not need to exclude a range that could not possibly be
added to physmem, and we do not need to exclude bus ranges that are not
physical memory, for example EFI_MD_TYPE_IOMEM.

Since physmem's ram0 device will reserve bus memory resources for its
owned ranges, this was preventing attachment of the watchdog device on
the RPI4B. For some reason its region of memory-mapped I/O appeared in
the EFI memory map (with the aforementioned EFI_MD_TYPE_IOMEM type).
This change fixes the attachment issue, as we prevent the physmem API
from messing with this range of bus space.

PR: 270044
Reported by: karels, Mark Millard
Reviewed by: andrew, karels, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39003

(cherry picked from commit 8937bd37d07c5c75995e01457aec00fb0a05c462)

15 months agoarm64/machdep: Add parameter to the EFI table walking code
Warner Losh [Wed, 30 Nov 2022 23:28:01 +0000 (16:28 -0700)]
arm64/machdep: Add parameter to the EFI table walking code

It would be nice to be able to pass an arbitrary pointer to the callback
code. Add one, and pass NULL in all the places that we do that today.
As noted by andrew@, we should likely refactor this into MI code and use
it here and amd64, but for the future.

Sponsored by: Netflix
Reviewed by: rpokala
Differential Revision: https://reviews.freebsd.org/D37439

(cherry picked from commit 6849950da7d770fa6531b915922799c20e960d42)

15 months agoarm64: Remove unused typedef
Warner Losh [Wed, 24 Aug 2022 12:27:01 +0000 (06:27 -0600)]
arm64: Remove unused typedef

We don't use EFI_MEMORY_DESCRIPTOR that's typedef'd here. We use the one
from sys/efi.h instead. Remove the clutter here as these two are subtly
different (though wind up with the same layout due to alignment rules).

Sponsored by: Netflix

(cherry picked from commit 211053f952d8ac91dab239f6c4845dd5badd0d95)

15 months agocap_*(2): Document ENOSYS behavior.
Xin LI [Fri, 10 Mar 2023 02:10:50 +0000 (18:10 -0800)]
cap_*(2): Document ENOSYS behavior.

Summary:
All cap_* system calls would fail when capability mode support is
not present.

Reviewed by: emaste, pauamma
Differential Revision: https://reviews.freebsd.org/D38976

(cherry picked from commit 75798f9b01055261881938326a5c77e55f79c7f7)

15 months agombuf: Fix an offset calculation in m_apply_extpg_one()
Mark Johnston [Wed, 10 Nov 2021 21:57:12 +0000 (16:57 -0500)]
mbuf: Fix an offset calculation in m_apply_extpg_one()

We were not including the requested starting offset in the page offset.

Reviewed by: jhb
Fixes: 3c7a01d773ac ("Extend m_apply() to support unmapped mbufs.")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32922

(cherry picked from commit ac2b54441742b3148de72e3b29aa0f00d29bb825)

15 months agocontrib/tzdata: import tzdata 2023a
Philip Paeps [Thu, 23 Mar 2023 01:33:45 +0000 (09:33 +0800)]
contrib/tzdata: import tzdata 2023a

Changes: https://github.com/eggert/tz/blob/2023a/NEWS

(cherry picked from commit 259e2ad76d1da961cc34c2903cb5f72f28503eb8)

15 months agovfs cache: return ENOTDIR for not_a_dir/{.,..} lookups
Mateusz Guzik [Thu, 23 Mar 2023 19:19:48 +0000 (19:19 +0000)]
vfs cache: return ENOTDIR for not_a_dir/{.,..} lookups

Reported by: Oliver Kiddle
PR: 270419
MFC: 3 days

(cherry picked from commit c16c4ea6d399332d4a023df6e423be61fdb875a5)

15 months agoktls: Remove the KERN_TLS option from the i386 and amd64 LINT-NOIP kernel configurations.
Hans Petter Selasky [Sat, 11 Jun 2022 19:29:42 +0000 (21:29 +0200)]
ktls: Remove the KERN_TLS option from the i386 and amd64 LINT-NOIP kernel configurations.

Kernel TLS depends on INET or INET6 being enabled.

Reported by: bz@
MFC after: 1 week
Sponsored by: NVIDIA Networking

(cherry picked from commit 9fd0d9b16e93ff2a3bd375a98763dca0150dcee0)

15 months agopkgbase: report errors via metalog reader exit status
Ed Maste [Wed, 23 Nov 2022 21:40:22 +0000 (16:40 -0500)]
pkgbase: report errors via metalog reader exit status

Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37482

(cherry picked from commit f93d92f43d984c1d927c7c12d06ae1497d12deea)

15 months agocsh: install hard link with same mode as target
Ed Maste [Wed, 23 Nov 2022 17:14:18 +0000 (12:14 -0500)]
csh: install hard link with same mode as target

Previously when using NO_ROOT we recorded METALOG entries for the /.cshrc
hard link with a different file mode than the link target, which is not
permitted.

We cannot just set LINKMODE here as it would also apply to the hard link
for the tcsh binary.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37499

(cherry picked from commit 67d2aaf078e967bb626cf50c53d679aad71aeaf9)

15 months agopam.d: install hard link with same mode as target
Ed Maste [Wed, 23 Nov 2022 15:34:58 +0000 (10:34 -0500)]
pam.d: install hard link with same mode as target

Previously when using NO_ROOT we recorded a METALOG entry for the
pam.d/ftp hard link with a different file mode than the link target
pam.d/ftpd, which is not permitted.

This change is similar to 1dbb9994d4dd for .profile

Sponsored by: The FreeBSD Foundation

(cherry picked from commit f2865d7d550161bf4058425a6677a839c065bde4)

15 months agodwatch: install hard links with same mode as target
Ed Maste [Wed, 23 Nov 2022 15:44:41 +0000 (10:44 -0500)]
dwatch: install hard links with same mode as target

Previoulsy when using NO_ROOT we recorded METALOG entries for dwatch
hard links with different file modes than their link targets, which is
not permitted.

Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37477

(cherry picked from commit 7543a9c0280a0f4262489671936a6e03b9b2c563)

15 months agosh: install hard link with same mode as target
Ed Maste [Wed, 23 Nov 2022 15:20:49 +0000 (10:20 -0500)]
sh: install hard link with same mode as target

Previously when using NO_ROOT we recorded a METALOG entry for the
/.profile hard link with a different mode than the link target, which is
not permitted.

Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37476

(cherry picked from commit 1dbb9994d4dd44357976daedcac7d280e8327382)

15 months agoCI: Run pkgbase METALOG lint script
Ed Maste [Wed, 16 Nov 2022 21:24:19 +0000 (16:24 -0500)]
CI: Run pkgbase METALOG lint script

tools/pkgbase/metalog_reader.lua checks for errors in METALOG (for
pkgbase staging), such as hard links with differing modes, duplicate
entries, etc.  Run it as part of the Cirrus-CI job to prevent
regressions.

Reviewed by: manu, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37521

(cherry picked from commit 2ed0305bc3f24258b977d640d3399d07c47e1b42)

15 months agoetdump: exit on error if section header or entry offset is OOB
Ed Maste [Tue, 3 May 2022 20:13:37 +0000 (16:13 -0400)]
etdump: exit on error if section header or entry offset is OOB

PR: 263663
Reported by: Robert Morris <rtm@lcs.mit.edu>
Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35868

(cherry picked from commit ddf77ec392717e7eaf278c0f201b561afac97b87)

15 months agolorder: add deprecation notice
Ed Maste [Tue, 21 Mar 2023 14:20:42 +0000 (10:20 -0400)]
lorder: add deprecation notice

lorder has not been used by the base system since 0e1e341b486c and
hasn't really been necessary for a very long time.

PR: 259254 [exp-run]
Reviewed by: arichardson (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30080

(cherry picked from commit 68a930d8ee35dd6ecc16254667a07e5be0a6f841)

15 months agogvinum: correct assertions
Ed Maste [Mon, 12 Dec 2022 17:08:39 +0000 (12:08 -0500)]
gvinum: correct assertions

Pointer addresses are always >= 0.  Assert that the value is >= 0
instead.

PR: 207855, 207856
Reviewed by: imp
Reported by: David Binderman
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37677

(cherry picked from commit 87bb53cb538059a3085db1fa4295dde5fcba55fe)

15 months agoldd: clarify format options
Ed Maste [Tue, 21 Mar 2023 14:14:03 +0000 (10:14 -0400)]
ldd: clarify format options

-f may be specified zero, one, or two times.  Make this clear in the
usage.

Reviewed by: markj, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34733

(cherry picked from commit e9f8723c30fc390f1282f5286d57c090ed9e5925)

15 months agoSwitch to GCC 9 for the GCC tinderbox.
John Baldwin [Fri, 20 May 2022 17:16:18 +0000 (10:16 -0700)]
Switch to GCC 9 for the GCC tinderbox.

This also adds arm and riscv to the GCC tinderbox.

Reviewed by: emaste (older version)
Differential Revision: https://reviews.freebsd.org/D26202

(cherry picked from commit 9dfbda254c20cb04dba5038cae4ce6c0d90739ca)

15 months ago_endian.h: Include sys/cdefs.h for visibility macros
Warner Losh [Wed, 22 Mar 2023 02:25:58 +0000 (20:25 -0600)]
_endian.h: Include sys/cdefs.h for visibility macros

BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN will be required by the
forthcoming POSIX Issue 8. In addition, they are provided in the BSD
compilation environments. However, depending on the order includes
happend, sys/cdefs.h may or may not be included when endian.h is
included. Include it here so we can safely test __BSD_VISIBLE.  Add
visibility when we're compiling in the future for issue 8, but since the
date number for issue 8 hasn't been fixed, use strictly greater than the
issue 7 date.of 200809.

This had the side effect of sometimes (in the traditional BSD
compliation environment)
 #if BYTE_ORDER == LITTLE_ENDIAN
and
 #if BYTE_ORDER == BIG_ENDIAN
both being true because none of these were defined. This fixes
that. It also fixes including it after <stdio.h> but not before.

PR: 269249
MFC After: 1d (build related)
Reviewed by: kib, emaste
Differential Revision: https://reviews.freebsd.org/D39176

Sponsored by: Netflix

(cherry picked from commit ed52baf51bd142b5e32701842346452a7ebe37a5)

15 months agoFix kernel memory disclosures in mpr and mps
Alan Somers [Wed, 1 Mar 2023 18:53:46 +0000 (11:53 -0700)]
Fix kernel memory disclosures in mpr and mps

In every mpr and mps ioctl that copies kernel data to userland, validate
that the requested length does not exceed the size of the kernel's
buffer.

Note that all of these ioctls already required root access.

Sponsored by: Axcient
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D38842

(cherry picked from commit 72aad3f9028af12e6c56a3a461b46a153abd7b24)

15 months agoif_epair: Use ANSI C definition
Li-Wen Hsu [Tue, 15 Feb 2022 13:45:22 +0000 (21:45 +0800)]
if_epair: Use ANSI C definition

This fixes -Werror=strict-prototypes from gcc9

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 7442b6323127a349d5465fa18ce5fe4be0600970)

15 months agoDisable -Wunused-function for {ed,x}25519_ref10.c in libsodium.
John Baldwin [Wed, 2 Feb 2022 20:25:16 +0000 (12:25 -0800)]
Disable -Wunused-function for {ed,x}25519_ref10.c in libsodium.

(cherry picked from commit 63b7c2df8ec41bf9ac33ccaf9b9d16c7dc28ea0c)

15 months agoAdd missing file to sys/conf/files after 469884cf04a9b92677c7c83e229ca6b8814f8b0a .
Hans Petter Selasky [Mon, 2 Aug 2021 06:24:22 +0000 (08:24 +0200)]
Add missing file to sys/conf/files after 469884cf04a9b92677c7c83e229ca6b8814f8b0a .

Found by: vishwin@
Differential Revision: https://reviews.freebsd.org/D29921
MFC after: 1 week
Sponsored by: NVIDIA Networking

(cherry picked from commit 9340ebd404efad7068b5a45fd3b3d8bb21187b91)

15 months agoLinuxKPI: Make FPU sections thread-safe and use the NOCTX flag.
Hans Petter Selasky [Sat, 31 Jul 2021 13:32:52 +0000 (15:32 +0200)]
LinuxKPI: Make FPU sections thread-safe and use the NOCTX flag.

Reviewed by: kib
Submitted by: greg@unrelenting.technology
Differential Revision: https://reviews.freebsd.org/D29921
MFC after: 1 week
Sponsored by: NVIDIA Networking

(cherry picked from commit 469884cf04a9b92677c7c83e229ca6b8814f8b0a)

15 months agolinuxkpi: Use a proper declaration for pm_suspend_via_firmware.
John Baldwin [Sat, 28 Jan 2023 03:29:39 +0000 (19:29 -0800)]
linuxkpi: Use a proper declaration for pm_suspend_via_firmware.

Reported by: GCC -Wstrict-prototypes

(cherry picked from commit 4d77927e2af3a991c5b07071b7fe18673d7742f2)

15 months agoStop adding -Wredundant-decls to CWARNFLAGS.
John Baldwin [Mon, 7 Feb 2022 20:47:51 +0000 (12:47 -0800)]
Stop adding -Wredundant-decls to CWARNFLAGS.

clang doesn't implement it, and Linux doesn't enforce it.  As a
result, new instances keep cropping up both in FreeBSD's code and in
upstream sources from vendors.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D34144

(cherry picked from commit c227269e2f9dc2695d00be9e5a72b5fdeec5712a)

15 months agomakefs: Ignore some sign comparison warnings from GCC.
John Baldwin [Wed, 23 Nov 2022 18:38:29 +0000 (10:38 -0800)]
makefs: Ignore some sign comparison warnings from GCC.

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

(cherry picked from commit abb9a940bb48716f8eb06980f02eec04e0921448)

15 months agoRemove the MK_LIBCPLUSPLUS option
Alex Richardson [Sat, 30 Jan 2021 17:56:35 +0000 (17:56 +0000)]
Remove the MK_LIBCPLUSPLUS option

This option has been equivalent to any form of C++ support since libstdc++
was removed. Therefore, replace all MK_LIBCPLUSPLUS uses with MK_CXX.

Reviewed By: emaste
Differential Revision: https://reviews.freebsd.org/D27974

(cherry picked from commit 5cf6f1c4bc281ac45ced086bc2e393f732f2fcc2)

15 months agolibicp: Link with -z noexecstack for ld.bfd.
John Baldwin [Tue, 22 Nov 2022 16:37:12 +0000 (08:37 -0800)]
libicp: Link with -z noexecstack for ld.bfd.

The assembly source files do not contain GNU-stack annotations, so
ld.bfd defaults to using an executable stack.

(cherry picked from commit 7e3e70ce214d042e202828b0665904840928a002)

15 months agolibcrypto padlock.so: Link with -z noexecstack for ld.bfd.
John Baldwin [Tue, 22 Nov 2022 16:37:04 +0000 (08:37 -0800)]
libcrypto padlock.so: Link with -z noexecstack for ld.bfd.

The assembly source files do not contain GNU-stack annotations, so
ld.bfd defaults to using an executable stack.

(cherry picked from commit 99df55bbb711150e7e3515f5c5a2c4d44654c278)

15 months agocsu: Add missing GNU-stack annotations to note object files.
John Baldwin [Fri, 18 Nov 2022 20:20:14 +0000 (12:20 -0800)]
csu: Add missing GNU-stack annotations to note object files.

ld.bfd marks the stack as executable for the crt objects due to the
missing annotations which raises a fatal warning starting with version
2.39.

(cherry picked from commit 74ad8d607ddbd530935524d53cc9f6f9d5517609)

15 months agokerneldump: Inline dump_savectx() into its callers
Mark Johnston [Mon, 20 Mar 2023 18:16:00 +0000 (14:16 -0400)]
kerneldump: Inline dump_savectx() into its callers

The callers of dump_savectx() (i.e., doadump() and livedump_start())
subsequently call dumpsys()/minidumpsys(), which dump the calling
thread's stack when writing the dump.  If dump_savectx() gets its own
stack frame, that frame might be clobbered when its caller later calls
dumpsys()/minidumpsys(), making it difficult for debuggers to unwind the
stack.

Fix this by making dump_savectx() a macro, so that savectx() is always
called directly by the function which subsequently calls
dumpsys()/minidumpsys().

This fixes stack unwinding for the panicking thread from arm64
minidumps.  The same happened to work on amd64, but kgdb reports the
dump_savectx() calls as coming from dumpsys(), so in that case it
appears to work by accident.

Fixes: c9114f9f86f9 ("Add new vnode dumper to support live minidumps")
Reviewed by: mhorne, jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39151

(cherry picked from commit c3179891f897d840f578a5139839fcacb587c96d)

15 months agotcp_rack.4: Correct a link in the SEE ALSO section
Gordon Bergling [Sun, 19 Mar 2023 08:49:33 +0000 (09:49 +0100)]
tcp_rack.4: Correct a link in the SEE ALSO section

The PDF at arxiv.org is only accessible when
retrieving it via the website.

(cherry picked from commit d37cca6570e9b42fae46ed9ae3a5af5d065f4440)

15 months agoReserve u2f group for FIDO/U2F key support (SSH, etc.)
Ed Maste [Fri, 18 Feb 2022 18:13:20 +0000 (13:13 -0500)]
Reserve u2f group for FIDO/U2F key support (SSH, etc.)

We have FIDO/U2F support in the base system now, so reserve a group ID
for it (maching the security/u2f-devd port).

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

(cherry picked from commit d0f1f38202c4176af277185a3b973098bb03fe6d)

15 months agomakefs: do not call brelse if bread returns an error
Ed Maste [Mon, 13 Mar 2023 20:51:51 +0000 (16:51 -0400)]
makefs: do not call brelse if bread returns an error

If bread returns an error there is no bp to brelse.  One of these
changes was taken from NetBSD commit 0a62dad69f62 ("This works well
enough to populate..."), the rest were found by looking for the same
pattern.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39069

(cherry picked from commit bc33c99234a676c41cde63cce389dd6b8b70adfc)

15 months agoCI: update QEMU command line to avoid deprecated option format
Ed Maste [Tue, 7 Mar 2023 16:38:01 +0000 (11:38 -0500)]
CI: update QEMU command line to avoid deprecated option format

> warning: short-form boolean option 'readonly' deprecated
> Please use readonly=on instead

Sponsored by: The FreeBSD Foundation

(cherry picked from commit a2de35e1a460126b99f63b6cdc3759157cc15860)

15 months agosmbfs.5: Us .An -nosplit for the AUTHORS section
Gordon Bergling [Sat, 18 Mar 2023 09:02:59 +0000 (10:02 +0100)]
smbfs.5: Us .An -nosplit for the AUTHORS section

Use .An -nosplit for the AUTHORS section, so that
it renders without an unnecessary newline.

No .Dd bump since it isn't a content change.

(cherry picked from commit ac6bc808f51654414cb7a72f6849b3e61b1fb172)

15 months agonetinet: Tighten checks for unspecified source addresses
Mark Johnston [Mon, 6 Mar 2023 20:06:00 +0000 (15:06 -0500)]
netinet: Tighten checks for unspecified source addresses

The assertions added in commit b0ccf53f2455 ("inpcb: Assert against
wildcard addrs in in_pcblookup_hash_locked()") revealed that protocol
layers may pass the unspecified address to in_pcblookup().

Add some checks to filter out such packets before we attempt an inpcb
lookup:
- Disallow the use of an unspecified source address in in_pcbladdr() and
  in6_pcbladdr().
- Disallow IP packets with an unspecified destination address.
- Disallow TCP packets with an unspecified source address, and add an
  assertion to verify the comment claiming that the case of an
  unspecified destination address is handled by the IP layer.

Reported by: syzbot+9ca890fb84e984e82df2@syzkaller.appspotmail.com
Reported by: syzbot+ae873c71d3c71d5f41cb@syzkaller.appspotmail.com
Reported by: syzbot+e3e689aba1d442905067@syzkaller.appspotmail.com
Reviewed by: glebius, melifaro
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D38570

(cherry picked from commit 713264f6b8bc5f927dd52cf8ffcccfa397034fec)

15 months agosendfile tests: Mount filesystems under the test workdir
Mark Johnston [Sun, 12 Mar 2023 18:50:14 +0000 (14:50 -0400)]
sendfile tests: Mount filesystems under the test workdir

Otherwise they can't be run in parallel as they share a mount point.

MFC after: 1 week

(cherry picked from commit 683853a92477a18f19b29d6bd8dd71ebe5553f89)

15 months agosmr: Remove the return value from smr_wait()
Mark Johnston [Tue, 7 Feb 2023 21:38:07 +0000 (16:38 -0500)]
smr: Remove the return value from smr_wait()

This is supposed to be a blocking version of smr_poll(), so there's no
need for a return value.  No functional change intended.

MFC after: 1 week

(cherry picked from commit cd133525fad197ac8cbbd4bd68860a4dd51a561f)

15 months agoepair: Remove unneeded includes and sort some of the rest
Mark Johnston [Mon, 13 Mar 2023 13:27:47 +0000 (09:27 -0400)]
epair: Remove unneeded includes and sort some of the rest

No functional change intended.

MFC after: 1 week

(cherry picked from commit 29c9b1673305406dc64161aa7b565a296526fa67)

15 months agoreadelf: fix -wR option, memory leaks, and -wf minor bug
Christos Margiolis [Mon, 6 Mar 2023 17:50:13 +0000 (12:50 -0500)]
readelf: fix -wR option, memory leaks, and -wf minor bug

Reviewed by: markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38419

(cherry picked from commit cec2d0b1c7ac3196613813c0b07a2387916a8ccd)

15 months agoudp: Fix a memory leak in udp6_send()
Mark Johnston [Tue, 14 Mar 2023 14:26:29 +0000 (10:26 -0400)]
udp: Fix a memory leak in udp6_send()

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

(cherry picked from commit e9ea690ae8486b74d6eeca62e316bf591d8aea4e)

15 months agonetbsd-tests: Remove some pointless sleeps from message queue tests
Mark Johnston [Fri, 10 Mar 2023 22:06:46 +0000 (17:06 -0500)]
netbsd-tests: Remove some pointless sleeps from message queue tests

- In the msgctl tests, there is no point in sleeping after a fork().
  Just block immediately in wait().
- In non-blocking send/recv tests, just wait for the child to exit once
  it's reached a message limit.  If a bug prevents the child from
  exiting promptly, the test will time out.

MFC after: 1 week

(cherry picked from commit 478de7f8e25849ce0b3a37b4baaf9c69e0b34072)

15 months agonetbsd-tests: Serialize message queue tests
Mark Johnston [Fri, 10 Mar 2023 22:07:06 +0000 (17:07 -0500)]
netbsd-tests: Serialize message queue tests

They can fail when run in parallel since they all share a global queue
key.

MFC after: 1 week

(cherry picked from commit e1ccf64b884a1a47c48a2fb7d71e7eb18347c6d6)

15 months agopf tests: test IPv6 fragmentation with link-local addresses
Kristof Provost [Sun, 12 Mar 2023 15:08:31 +0000 (16:08 +0100)]
pf tests: test IPv6 fragmentation with link-local addresses

We've observed a panic after pf_refragment6() with link-local addresses,
because pf_refragment6() calls ip6_forward() even for a simple output
case.
That results in us entering ip6_forward() with an mbuf with a NULL
m->m_pkthdr.rcvif, which can cause a NULL deref (but seemingly not for
GUAs.

Test sending fragmented link-local packets to pf.

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

(cherry picked from commit 225e85513fd7a5e31f649e35f0b99454bb725776)

15 months agoacpi_wakeup.c: apply the reviewer' editorial corrections to the comment text.
Konstantin Belousov [Sat, 18 Mar 2023 15:45:49 +0000 (17:45 +0200)]
acpi_wakeup.c: apply the reviewer' editorial corrections to the comment text.

(cherry picked from commit 2b4b3789f877918e9e89a217d3b25d854d1a2267)

15 months agoamd64: properly recalculate mitigations knobs after resume
Konstantin Belousov [Fri, 17 Mar 2023 13:02:03 +0000 (15:02 +0200)]
amd64: properly recalculate mitigations knobs after resume

(cherry picked from commit 02904a06c76be857307b78184863654b9e7b88ab)

15 months agoamd64 acpi_wakeup.c: fix typo
Konstantin Belousov [Fri, 17 Mar 2023 12:42:26 +0000 (14:42 +0200)]
amd64 acpi_wakeup.c: fix typo

(cherry picked from commit ff6d60946a0e9e0ade3045b734ed4bea08e20938)

15 months agoFFS/UFS snapshots: improve documentation for removal (deletion) and unlinking.
Kirk McKusick [Wed, 8 Mar 2023 06:02:07 +0000 (22:02 -0800)]
FFS/UFS snapshots: improve documentation for removal (deletion) and unlinking.

Clarification of the size of the snapshot file.

Suggested by: Matteo Riondato
PR:           266358
Differential Revision: https://reviews.freebsd.org/D38817

(cherry picked from commit 129ea078cd16b768a1100b497282fd9359e8dfea)

15 months agoFFS/UFS snapshots: improve documentation for removal (deletion) and unlinking.
Kirk McKusick [Tue, 7 Mar 2023 05:43:32 +0000 (21:43 -0800)]
FFS/UFS snapshots: improve documentation for removal (deletion) and unlinking.

Minor clarification.

(cherry picked from commit 7741a5c4dc5e318dcaabf5e336dfa9cf3f3b6805)

15 months agoFFS/UFS snapshots: improve documentation.
Kirk McKusick [Mon, 6 Mar 2023 05:37:23 +0000 (21:37 -0800)]
FFS/UFS snapshots: improve documentation.

This update provides a more detailed description of FFS/UFS snapshots
and adds links to useful man pages.

Requested by: Graham Perrin
Submitted by: darius-dons.net.au
Reviewed by:  Ravi Pokala
PR:           266358
Differential Revision: https://reviews.freebsd.org/D38817

(cherry picked from commit 528d8e55c8d338e78fa4e6c9f182e8975f75199a)