]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 months agoif_epair: also remove vlan metadata from mbufs
Kristof Provost [Mon, 10 Apr 2023 11:02:55 +0000 (13:02 +0200)]
if_epair: also remove vlan metadata from mbufs

We already remove mbuf tags from packets transitting an if_epair, but we
didn't remove vlan metadata.
In certain configurations this could lead to unexpected vlan tags
turning up on the rx side.

PR: 270736
Reviewed by: markj
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D39482

(cherry picked from commit c69ae8419734829404bdb47d694d105c85f9835e)

14 months agoarm: Remove a double word in a comment in setjmp
Gordon Bergling [Thu, 13 Apr 2023 18:37:25 +0000 (20:37 +0200)]
arm: Remove a double word in a comment in setjmp

- s/number number/number/

(cherry picked from commit 26713ad9cf18b6ecd37f862182c84c1e57aee091)

14 months agokern: remove a double word in a KASSERT in subr_trap
Gordon Bergling [Thu, 13 Apr 2023 18:03:37 +0000 (20:03 +0200)]
kern: remove a double word in a KASSERT in subr_trap

- s/with with/with/

(cherry picked from commit c159f76713d7c1cbfdfc0c81dd91a5483096cf6f)

14 months agotmpfs: MFC: unbreak module build outside of kernel build environment
Eugene Grosbein [Sat, 15 Apr 2023 04:00:03 +0000 (11:00 +0700)]
tmpfs: MFC: unbreak module build outside of kernel build environment

(cherry picked from commit 5ee1c90e50ce8832c79aa61c8c2bbb71bd097799)

14 months agoarm64: nexus code tidy-up
Mitchell Horne [Fri, 10 Feb 2023 14:26:53 +0000 (10:26 -0400)]
arm64: nexus code tidy-up

Make a pass at the various nexus implementations, fixing some very minor
style issues, obsolete comments, etc.

The method declaration section has become unwieldy in many respects.
Attempt to tame it by:
 - Using generated method typedefs
 - Grouping methods roughly by category, and then alphabetically.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D38495

(cherry picked from commit e582d4a2b09e679baae457b50c7270b4a9f501bf)

14 months agoarm: nexus code tidy-up
Mitchell Horne [Mon, 6 Feb 2023 15:57:33 +0000 (11:57 -0400)]
arm: nexus code tidy-up

Make a pass at the various nexus implementations, fixing some very minor
style issues, obsolete comments, etc.

The method declaration section has become unwieldy in many respects.
Attempt to tame it by:
 - Using generated method typedefs
 - Grouping methods roughly by category, and then alphabetically.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D38495

(cherry picked from commit c650e1949558c1993d7486859ad9804fd582129e)

14 months agopowerpc: nexus code tidy-up
Mitchell Horne [Fri, 10 Feb 2023 14:37:08 +0000 (10:37 -0400)]
powerpc: nexus code tidy-up

Make a pass at the various nexus implementations, fixing some very minor
style issues, obsolete comments, etc.

Update the top-level comment to be closer to other nexus
implementations.

The method declaration section has become unwieldy in many respects.
Attempt to tame it by:
 - Using generated method typedefs
 - Grouping methods roughly by category, and then alphabetically.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D38495

(cherry picked from commit c514686aa06a08a97df051a75da9ea7964a74fb0)

14 months agoriscv: nexus code tidy-up
Mitchell Horne [Mon, 6 Feb 2023 15:53:09 +0000 (11:53 -0400)]
riscv: nexus code tidy-up

Make a pass at the various nexus implementations, fixing some very minor
style issues, obsolete comments, etc.

The method declaration section has become unwieldy in many respects.
Attempt to tame it by:
 - Using generated method typedefs
 - Grouping methods roughly by category, and then alphabetically.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D38495

(cherry picked from commit abe3309e71b94527e937f034dd81ca7d6afdeb67)

14 months agox86: nexus code tidy-up
Mitchell Horne [Fri, 10 Feb 2023 14:52:38 +0000 (10:52 -0400)]
x86: nexus code tidy-up

Make a pass at the various nexus implementations, fixing some very minor
style issues, obsolete comments, etc.

The method declaration section has become unwieldy in many respects.
Attempt to tame it by:
 - Using generated method typedefs
 - Grouping methods roughly by category, and then alphabetically.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D38495

(cherry picked from commit 99bd5c1fe32272ce6e8d9b2d575b42dd94593b25)

14 months agoofwbus: only allow unit number zero
Mitchell Horne [Mon, 13 Feb 2023 17:44:03 +0000 (13:44 -0400)]
ofwbus: only allow unit number zero

ofwbus has always been the root of attachment for OFW/FDT platforms. It
may have simplebus children, but we expect only one instance of the
ofwbus driver, added directly by nexus. We may as well ensure this
remains the case.

Reviewed by: jhb
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D38493

(cherry picked from commit afca197f5240ce2c2c7abfe5c9fbc50ba55f178b)

14 months agoofwbus: remove arm64 ifdefs
Mitchell Horne [Mon, 13 Feb 2023 17:43:25 +0000 (13:43 -0400)]
ofwbus: remove arm64 ifdefs

Rather than using the DEVICE_IDENTIFY method, let's have other
ofwbus-using platforms add ofwbus0 explicitly in nexus, like arm64. This
gives them the same flexibility, e.g. if riscv starts supporting ACPI,
and cleans up the #ifdefs.

We were doing this already on riscv, but adjust the 'order' parameters.

Reviewed by: andrew, jhb
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D38492

(cherry picked from commit 53d5e65eead0f713c5e256018d46edbec0a96c11)

14 months agoofwbus: remove handling of resources from ofwbus
Elliott Mitchell [Wed, 8 Feb 2023 20:17:03 +0000 (16:17 -0400)]
ofwbus: remove handling of resources from ofwbus

The architecture nexus should handle allocation and release of memory and
interrupts. This is to ensure that system-wide resources such as these
are available to all devices, not just children of ofwbus0.

On powerpc this moves the ownership of these resources up one level,
from ofwbus0 to nexus0. Other architectures already have the required
logic in their nexus implementation, so this eliminates the duplication
of resources. An implementation of nexus_adjust_resource() is added for
arm, arm64, and riscv.

As noted by ian@ in the review, resource handling was the main bit of
logic distinguishing ofwbus from simplebus. With some attention to
detail, it should be possible to merge the two in the future.

Co-authored by: mhorne
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D30554

(cherry picked from commit f9bdaab95ec469738fbfc1f0edd3e8c744b7f71f)

14 months agophysmem: add ram0 pseudo-driver
Mitchell Horne [Thu, 27 May 2021 14:27:40 +0000 (11:27 -0300)]
physmem: add ram0 pseudo-driver

Its purpose is to reserve all I/O space belonging to physical memory
from nexus, preventing it from being handed out by bus_alloc_resource()
to callers such as xenpv_alloc_physmem(), which looks for the first
available free range it can get. This mimics the existing pseudo-driver
on x86.

If needed, the device can be disabled with hint.ram.0.disabled="1" in
/boot/device.hints.

Reviewed by: imp
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D32343

(cherry picked from commit e6cf1a0826c9d7f229e41224ec7b783501636528)

14 months agoarm: add an interrupt rman to nexus
Mitchell Horne [Sun, 5 Dec 2021 15:27:50 +0000 (11:27 -0400)]
arm: add an interrupt rman to nexus

Allow the nexus bus to own and manage interrupt resources. Currently,
interrupt resources on this architecture are managed completely by
ofwbus, but it is desirable that system-wide memory and interrupt
resources be managed by the top-level bus.

This is a pre-requisite to moving this resource management out of
ofwbus.

Reviewed By: ian, Elliott Mitchell <ehem+freebsd@m5p.com>
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D32357

(cherry picked from commit 1d03c3578d05b011dc714ec0735a5783c421530b)

14 months agoofw: fix memory leak in ofwbus_attach()
Christos Margiolis [Mon, 10 Apr 2023 15:31:46 +0000 (15:31 +0000)]
ofw: fix memory leak in ofwbus_attach()

PR: 269509
Reported by: Jaroslaw Pelczar <jarek@jpelczar.com>
Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D38903

(cherry picked from commit 38594ff9c0c9568b5082ba3273103904a6afd38e)

14 months agoawk: errror on printf format strings lacking conversion specifier
Ed Maste [Fri, 14 Apr 2023 14:49:05 +0000 (10:49 -0400)]
awk: errror on printf format strings lacking conversion specifier

Reported by: phk
Reviewed by: imp, markj
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39573

(cherry picked from commit 5dbd073b045c8e98730c025a4acf2279be26c33e)

14 months agoiicbus(4): Use the existing CTLFLAG_RWTUN flag definition
Zhenlei Huang [Wed, 12 Apr 2023 04:20:38 +0000 (12:20 +0800)]
iicbus(4): Use the existing CTLFLAG_RWTUN flag definition

Use it when possible, instead of separated flags.

No functional change intended.

Reviewed by: hselasky, erj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39466

(cherry picked from commit deac4c7f0753841de8da4d7f37d7e49620b3bbb4)

14 months agobxe(4): Use CTLFLAG_RDTUN flag definition
Zhenlei Huang [Wed, 12 Apr 2023 04:20:38 +0000 (12:20 +0800)]
bxe(4): Use CTLFLAG_RDTUN flag definition

sysctl variables rx_budget and max_aggregation_size are read-only loader
tunable. Mark them with CTLFLAG_RD flag.

No functional change intended.

Reviewed by: hselasky, erj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39466

(cherry picked from commit 8bd9afe9e1821368f4bb0d39c8c6703bf5007fd1)

14 months agoice(4): Use the existing CTLFLAG_RWTUN flag definition
Zhenlei Huang [Wed, 12 Apr 2023 04:20:38 +0000 (12:20 +0800)]
ice(4): Use the existing CTLFLAG_RWTUN flag definition

Use it when possible, instead of separated flags.

No functional change intended.

Reviewed by: hselasky, erj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39466

(cherry picked from commit 5ff8018108278d06e024676c539e9f60f8189e83)

14 months agocam iosched: Use the existing CTLFLAG_RDTUN and CTLFLAG_RWTUN flag definitions
Zhenlei Huang [Wed, 12 Apr 2023 04:20:38 +0000 (12:20 +0800)]
cam iosched: Use the existing CTLFLAG_RDTUN and CTLFLAG_RWTUN flag definitions

Use them when possible, instead of separated flags.

No functional change intended.

Reviewed by: hselasky, erj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39466

(cherry picked from commit 69cb72b8728ba605d6cc8758480eca3fc6fd2ed6)

14 months agopowerpc: Use the existing CTLFLAG_RDTUN and CTLFLAG_RWTUN flag definitions
Zhenlei Huang [Wed, 12 Apr 2023 04:20:38 +0000 (12:20 +0800)]
powerpc: Use the existing CTLFLAG_RDTUN and CTLFLAG_RWTUN flag definitions

Use them when possible, instead of separated flags.

No functional change intended.

Reviewed by: hselasky, erj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39466

(cherry picked from commit dc1c5138c3255cc9004a3842001ed6c5db8f4ea3)

14 months agovimage.8: Remove a double word
Gordon Bergling [Thu, 13 Apr 2023 18:22:25 +0000 (20:22 +0200)]
vimage.8: Remove a double word

- s/are are/are/

(cherry picked from commit e0c2f93029850968712a4fb4ab3630579d8812d3)

14 months agofs/cd9660: add header include guards
Ed Maste [Thu, 30 Mar 2023 16:49:40 +0000 (12:49 -0400)]
fs/cd9660: add header include guards

Diff reduction against NetBSD files in sys/fs/cd9660/ and OpenBSD files
in usr.sbin/makefs/cd9660/.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit d33cdf16df52050102931ee3b37ce173e449c9c1)

14 months agollvm-objcopy: link man page as strip.1 when WITH_LLVM_BINUTILS is set
Ed Maste [Wed, 5 Apr 2023 15:07:14 +0000 (11:07 -0400)]
llvm-objcopy: link man page as strip.1 when WITH_LLVM_BINUTILS is set

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

(cherry picked from commit 5cb402cc89c01e0a1f18f8c6a4c7d9cfc10d26ab)

14 months agortld: fixes for handling of the grouped options
Konstantin Belousov [Thu, 13 Apr 2023 04:47:23 +0000 (07:47 +0300)]
rtld: fixes for handling of the grouped options

(cherry picked from commit 7cdfe51f30965a365e3e7c829396a56e2a7e5141)

14 months agopkru.3: fix markup
Konstantin Belousov [Fri, 14 Apr 2023 23:29:45 +0000 (02:29 +0300)]
pkru.3: fix markup

(cherry picked from commit dcc19c6701ea789ac109a132df032c61feacf9ea)

14 months agoRegen
Konstantin Belousov [Tue, 4 Apr 2023 13:24:11 +0000 (16:24 +0300)]
Regen

14 months agoChange kqueue1() to be compatible with NetBSD
Konstantin Belousov [Fri, 31 Mar 2023 22:31:41 +0000 (01:31 +0300)]
Change kqueue1() to be compatible with NetBSD

(cherry picked from commit 54579376c05e7a039cde5f424c641fa29348835f)

14 months agoRename kqueue1(2) to kqueuex(2) to avoid compat issues with NetBSD
Konstantin Belousov [Fri, 31 Mar 2023 22:27:00 +0000 (01:27 +0300)]
Rename kqueue1(2) to kqueuex(2) to avoid compat issues with NetBSD

(cherry picked from commit dac310248826c37b60306c1b25fb94c35802196d)

14 months agokqueue1(2): document
Konstantin Belousov [Sat, 25 Mar 2023 23:41:21 +0000 (01:41 +0200)]
kqueue1(2): document

(cherry picked from commit f2ec444be523d3d00808ff82a7c690c75defe953)

14 months agokqueue1(2): export the symbol from libc
Konstantin Belousov [Sat, 25 Mar 2023 23:40:39 +0000 (01:40 +0200)]
kqueue1(2): export the symbol from libc

(cherry picked from commit 375732cc6e462ca160654886f0411d2950768a8b)

14 months agoAdd kqueue1() syscall
Konstantin Belousov [Sat, 25 Mar 2023 23:39:02 +0000 (01:39 +0200)]
Add kqueue1() syscall

(cherry picked from commit 61194e9852e641d1533cd04a5679d6042ff975d3)

14 months agoDEBUG_VFS_LOCKS: restore diagnostic for the witness use case
Konstantin Belousov [Mon, 10 Apr 2023 08:52:43 +0000 (11:52 +0300)]
DEBUG_VFS_LOCKS: restore diagnostic for the witness use case

(cherry picked from commit c53e990b8d0444b5ad59ddb18742a71434e30ee2)

14 months agoAdd witness_is_owned(9)
Konstantin Belousov [Mon, 10 Apr 2023 15:54:58 +0000 (18:54 +0300)]
Add witness_is_owned(9)

(cherry picked from commit 75fc6f86c38807f1fb305c065c6affcf7617b029)

14 months agoDEBUG_VFS_LOCKS: use witness if available
Konstantin Belousov [Sat, 8 Apr 2023 06:15:00 +0000 (09:15 +0300)]
DEBUG_VFS_LOCKS: use witness if available

(cherry picked from commit 7b6fe2428a97921e8df882d0a24b87094c37b468)

14 months agoMerge commit 'd84e570b54961e8874bbd8de25635eb96be0977e'
Simon J. Gerraty [Tue, 21 Feb 2023 06:13:27 +0000 (22:13 -0800)]
Merge commit 'd84e570b54961e8874bbd8de25635eb96be0977e'

This unbreaks the build for WITH_BEARSSL=1 on stable/13.

(cherry picked from commit 9c474dc51b0b09ff81339caee6772e454dd470e4)

14 months agoMerge bearssl-20220418
Simon J. Gerraty [Mon, 18 Apr 2022 21:47:09 +0000 (14:47 -0700)]
Merge bearssl-20220418

Main change is a callback for checking validity period of certificates.

Merge commit 'f6acb9b9f81c96ae7c9592bee1bb89c4357cc3e5'

Add -DHAVE_BR_X509_TIME_CHECK to libsecureboot/Makefile.inc

(cherry picked from commit cc9e6590773dba57440750c124173ed531349a06)

14 months agoarcmsr(4): Fix reading buffer empty length error.
黃清隆 [Sat, 1 Apr 2023 05:43:43 +0000 (22:43 -0700)]
arcmsr(4): Fix reading buffer empty length error.

(cherry picked from commit 285d85f4f96bf3b5aecccad865a8855724241c32)

14 months agobsd-family-tree: add FreeBSD 13.2
Sergey A. Osokin [Tue, 11 Apr 2023 14:32:53 +0000 (10:32 -0400)]
bsd-family-tree: add FreeBSD 13.2

(cherry picked from commit eed92455e60016258277f395fddf6433f290c0ba)

14 months agobsd-family-tree: add OpenBSD 7.3
Sergey A. Osokin [Mon, 10 Apr 2023 22:12:29 +0000 (18:12 -0400)]
bsd-family-tree: add OpenBSD 7.3

(cherry picked from commit 7f8953991fac3dec6554298625d4692833bb2ab7)

14 months agomakefs: use %s and __func__ in printf messages
Ed Maste [Tue, 11 Apr 2023 15:19:06 +0000 (11:19 -0400)]
makefs: use %s and __func__ in printf messages

For diff reduction against NetBSD.

Obtained from: NetBSD 0c4125e1a19f
Sponsored by: The FreeBSD Foundation

(cherry picked from commit af7624ed314574d6da1eb45b9fddbd2ad503fea4)

14 months agomakefs: set the validation entry system type
Ed Maste [Thu, 30 Mar 2023 14:31:45 +0000 (10:31 -0400)]
makefs: set the validation entry system type

Obtained from: NetBSD c3cb4dcc9c43
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 22db5e5d03278471c46799016c177abf95f273cb)

14 months agomakefs: use size_t or ssize_t where appropriate
Ed Maste [Thu, 30 Mar 2023 02:04:16 +0000 (22:04 -0400)]
makefs: use size_t or ssize_t where appropriate

Obtained from: NetBSD af7bc97830ac

(cherry picked from commit 1d1ffa2efd2a54c435b7977dc1cfd21dce248671)

14 months agomakefs: simplify filename conversion handling
Ed Maste [Fri, 31 Mar 2023 13:05:52 +0000 (09:05 -0400)]
makefs: simplify filename conversion handling

Obtained from: OpenBSD 4095a2e01d18
Sponsored by: The FreeBSD Foundation

(cherry picked from commit c02e6ca7c22aa340fb261233f4f9c4438fee301a)

14 months agomakefs: remove some unused cd9660 types and defines
Ed Maste [Thu, 30 Mar 2023 23:31:41 +0000 (19:31 -0400)]
makefs: remove some unused cd9660 types and defines

Obtained from: OpenBSD
Sponsored by: The FreeBSD Foundation

(cherry picked from commit d73acb32d3343d14c29a995160c007aeadfa79f3)

14 months agomakefs: avoid uninitialized memory in root directory date
Ed Maste [Thu, 6 Apr 2023 16:53:00 +0000 (12:53 -0400)]
makefs: avoid uninitialized memory in root directory date

Move date setting into cd9660_populate_iso_dir_record so there is no
path that leaves it unset.

PR: 203531
Reported by: Thomas Schmitt <scdbackup@gmx.net>
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39258

(cherry picked from commit 7bc4ccf3aea935dde8ffc3e7c287884e22f87646)

14 months agomakefs: remove CD9660MAXPATH #define
Ed Maste [Fri, 31 Mar 2023 16:57:15 +0000 (12:57 -0400)]
makefs: remove CD9660MAXPATH #define

It was used only in constructing the host path that contains file
content, which is not related to anything CD9660-specific.  PATH_MAX is
the appropriate limit.  See OpenBSD commit 299d8950f319.

Obtained from: OpenBSD
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 2f11df63374d279238e4836125a81fa2c5234730)

14 months agomakefs: improve some cd9660 error messages
Ed Maste [Thu, 30 Mar 2023 23:36:37 +0000 (19:36 -0400)]
makefs: improve some cd9660 error messages

Obtained from: OpenBSD
Sponsored by: The FreeBSD Foundation

(cherry picked from commit c6ed8694ac58c8b81a5e4944cb96c2fa19b6ca79)

14 months agomakefs: #define Apple Partition bits
Ed Maste [Thu, 30 Mar 2023 16:45:18 +0000 (12:45 -0400)]
makefs: #define Apple Partition bits

NetBSD defines these in sys/bootblock.h, which we don't have.  Add local
defintions in cd9660_eltorito.c (as OpenBSD did) to reduce diffs between
the three makefs implementations.

Obtained from: OpenBSD
Sponsored by: The FreeBSD Foundation

(cherry picked from commit f0bef3d20eb6e28cf66a42c6d34fdfe80a784365)

14 months agomakefs: correct "filname" typo
Ed Maste [Thu, 30 Mar 2023 14:14:56 +0000 (10:14 -0400)]
makefs: correct "filname" typo

Obtained from: NetBSD cd9660.c r1.58

(cherry picked from commit efe6a1574ec0a1b41a5729a478c6243002da60c9)

14 months agomakefs: Whitespace cleanup to sync with NetBSD
Ed Maste [Thu, 30 Mar 2023 14:31:14 +0000 (10:31 -0400)]
makefs: Whitespace cleanup to sync with NetBSD

(cherry picked from commit 52c68e1625e418e384b6d2d118a22bc3e4529f64)

14 months agomakefs: remove vestigial '?' cases from top-level getopt(3) loop
Ed Maste [Thu, 30 Mar 2023 01:33:39 +0000 (21:33 -0400)]
makefs: remove vestigial '?' cases from top-level getopt(3) loop

getopt(3) returns '?' when it encounters a flag not present in the in
the optstring or if a flag is missing its option argument.  We can
handle this case with the "default" failure case with no loss of
legibility.

Obtained from: OpenBSD makefs.c 1.22

(cherry picked from commit cc4adc4c4e473d47b687d2ac2757157abd728c81)

14 months agomakefs: do not pass mode to open() call lacking O_CREAT
Ed Maste [Thu, 30 Mar 2023 01:42:44 +0000 (21:42 -0400)]
makefs: do not pass mode to open() call lacking O_CREAT

Obtained from: OpenBSD ffs.c 1.35

(cherry picked from commit 45e405603b7f4d33372f32c80453ab5cd0d8fdcf)

14 months agomakefs: spelling
Ed Maste [Thu, 30 Mar 2023 01:40:07 +0000 (21:40 -0400)]
makefs: spelling

Obtained from: OpenBSD msdosfs_fat.c 1.7

(cherry picked from commit 1fb7d2cf999e52e3682174d0c2f20cb3baf414f3)

14 months agoveriexec(4): Fix a compiler error
Mina Galić [Thu, 23 Feb 2023 11:14:41 +0000 (12:14 +0100)]
veriexec(4): Fix a compiler error

When building WITH_BEARSSL=1 veriexec(4) failes to compile.
So update the function prototype so that veriexec(4)
compiles again.

Reported by: gbe
Reviewed by: mjg, gbe
Approved by: mjg
Pull Request: https://github.com/freebsd/freebsd-src/pull/657

(cherry picked from commit 7e2af4f90bb1dca907ce024324b1e64c48ca4472)

14 months agolib/libsecureboot: Fix some typos
Elyes HAOUAS [Mon, 22 Mar 2021 17:16:06 +0000 (18:16 +0100)]
lib/libsecureboot: Fix some typos

Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Pull Request: https://github.com/freebsd/freebsd-src/pull/544
(cherry picked from commit cb25444c05071463d7f690590ed6288b015ec0fb)

14 months agoAdd -S option to veriexec
Simon J. Gerraty [Tue, 19 Jul 2022 15:59:53 +0000 (08:59 -0700)]
Add -S option to veriexec

During software installation, use veriexec -S to strictly
enforce certificate validity checks (notBefore, notAfter).

Otherwise ignore certificate validity period.
It is generally unacceptible for the Internet to stop working
just because someone did not upgrade their infrastructure for a decade.

Sponsored by: Juniper Networks, Inc.

Reviewed by: sebastien.bini_stormshield.eu
Differential Revision: https://reviews.freebsd.org/D35758

(cherry picked from commit ab4f0a15188087e407426aac2a720035fd2a3b0a)

14 months agolibsecureboot: Do not propagate empty string
Wojciech Macek [Wed, 29 Jun 2022 08:50:23 +0000 (10:50 +0200)]
libsecureboot: Do not propagate empty string

If Trust Anchors are provided by UEFI and not compiled into
libsecureboot the segmentation fault occurs due to empty
or NULL string usage.

Obtained from: Semihalf
Reviewed by: sjg
Differential revision: https://reviews.freebsd.org/D35120

(cherry picked from commit e6ef5042e485f74e7233a9974010b16a7316167e)

14 months agoUpdate libsecureboot
Simon J. Gerraty [Mon, 18 Apr 2022 19:53:53 +0000 (12:53 -0700)]
Update libsecureboot

Preparation for updating bearssl, pull in updates to libsecureboot.

o fix handling of some out-of-memory cases

o allow more control over reporting of Verified/Unverified files.
  this helps boot time when console output is slow

  o recheck verbose/debug level after reading any unverified file

o more debug support for vectx

o hash_string to support fake stat for tftp

o tests/tvo add -v to simply verify signatures

o vets.c allow for HAVE_BR_X509_TIME_CHECK which will greatly simplify
  verification in loader

o report date when certificate fails validity period checks

Reviewed by: stevek
Sponsored by: Juniper Networks, Inc.

(cherry picked from commit 666554111a7e6b4c1a9a6ff2e73f12cd582573bb)

14 months agoMove ve_check_hash prototype to libsecureboot-priv.h
Simon J. Gerraty [Sun, 19 Dec 2021 00:34:58 +0000 (16:34 -0800)]
Move ve_check_hash prototype to libsecureboot-priv.h

Reviewed by: stevek

(cherry picked from commit 623ecf23325691a0cc13991e160b5f5d11471830)

14 months agoImprove parameters handling in veriexec
Hubert Mazur [Wed, 29 Jun 2022 08:55:51 +0000 (10:55 +0200)]
Improve parameters handling in veriexec

Provide more robust parameter parsing in veriexec. Do a little cleanup as well.

Differential revision: https://reviews.freebsd.org/D33246
Obtained from: Semihalf
Reviewed by: sjg, sebastien.bini_stormshield.eu

(cherry picked from commit b439f64ac1b953936a89167f0201d0d53cc90197)

14 months agoveriexec(8): explain that only a unique prefix is required
Simon J. Gerraty [Mon, 14 Feb 2022 21:52:40 +0000 (13:52 -0800)]
veriexec(8): explain that only a unique prefix is required

When setting or querying state it is sufficient to
provide only enough of the state name to be unambiguous.

(cherry picked from commit a8189e9bd4ddd134f20c0e39a586fddf520cacf7)

14 months agoveriexec: Fix veriexec -i's confusion between loaded and locked states
Stephane Rochoy [Thu, 23 Sep 2021 08:53:56 +0000 (10:53 +0200)]
veriexec: Fix veriexec -i's confusion between loaded and locked states

Calling veriexec -i locked return the state of loaded and vice-versa.

Differential revision: https://reviews.freebsd.org/D30952
Reviewed by: sjg,imp
Obtained from: Stromshield

(cherry picked from commit 492bf4fdad4dbb96b82d88e12918e61042f71661)

14 months agosbin/veriexec: fixed parameter parsing of option -x
sebastien.bini [Tue, 20 Oct 2020 14:52:16 +0000 (16:52 +0200)]
sbin/veriexec: fixed parameter parsing of option -x

The -x parameter doesn't take any arguments. It says that all further
arguments are paths to check.

Reviewed by: imp@
Sponsored by: Netflix
Pull Request: https://github.com/freebsd/freebsd-src/pull/443/files

(cherry picked from commit e5be21d19b41e4d42ffea5c7978d7e64a5cec4fc)

14 months agoimgact_binmisc: MFC: unbreak module build outside of kernel build environment
Eugene Grosbein [Tue, 11 Apr 2023 10:31:34 +0000 (17:31 +0700)]
imgact_binmisc: MFC: unbreak module build outside of kernel build environment

(cherry picked from commit 37f4cb29bdafa33ec46f505fb5b769bafddcac74)

14 months agotelnet.1: Fix a typo in the manual page
Gordon Bergling [Tue, 11 Apr 2023 08:42:37 +0000 (10:42 +0200)]
telnet.1: Fix a typo in the manual page

- s/addreess/address/

(cherry picked from commit d2e0204ec0ace5a65e688a35a960e949624f3cb2)

14 months agoarm64/gicv3: correct the size of the distributor resource
Mitchell Horne [Fri, 31 Mar 2023 15:32:39 +0000 (12:32 -0300)]
arm64/gicv3: correct the size of the distributor resource

Use the GICD_SIZE macro (0x10000), which is half the size of the current
fixed-sized mapping (128 * 1024 == 0x20000).

In ARM64 Hyper-V instances, it seems the Distributor's registers are
located immediately preceding a range of physical memory in the bus
address space. Thus, when ram0 is attaching and attempts to reserve
SYS_RES_MEMORY resources corresponding to its physmem ranges, it fails,
because the first 0x10000 bytes of this range are already owned by gic0.

PR: 270415
Reported by: whu
Tested by: whu
Differential Revision: https://reviews.freebsd.org/D39260

(cherry picked from commit 3462c371c2562a8144f4245f9967df99874e505f)

14 months agonetmap: Handle packet batches in generic mode
Mark Johnston [Wed, 5 Apr 2023 20:52:41 +0000 (16:52 -0400)]
netmap: Handle packet batches in generic mode

ifnets are allowed to pass batches of multiple packets to if_input,
linked by the m_nextpkt pointer.  iflib_rxeof() sometimes does this, for
example.  Netmap's generic mode did not handle this and would only
deliver the first packet in the batch, leaking the rest.

PR: 270636
Reviewed by: vmaffione
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39426

(cherry picked from commit 5f6d37787f1e6aaf9b18392e8cff65ed4e094f2c)

14 months agomakefs(8): do not print comma after the last super-block
Christos Margiolis [Wed, 5 Apr 2023 22:25:19 +0000 (18:25 -0400)]
makefs(8): do not print comma after the last super-block

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

(cherry picked from commit f21faa67ab6bfe1acb0073287396b232fb11d05e)

14 months agonetisr: Remove the now-unused NETISR_EPAIR queue index
Mark Johnston [Wed, 5 Apr 2023 15:40:45 +0000 (11:40 -0400)]
netisr: Remove the now-unused NETISR_EPAIR queue index

No functional change intended.

Fixes: 3dd5760aa5f8 ("if_epair: rework")
MFC after: 1 week
Sponsored by: Klara, Inc.

(cherry picked from commit 03276e338a1b6ee0b36797071720ae0645a59811)

14 months agolibdtrace: Do not set SHF_ALLOC on SUNW_dof relocation sections
Mark Johnston [Tue, 4 Apr 2023 15:21:51 +0000 (11:21 -0400)]
libdtrace: Do not set SHF_ALLOC on SUNW_dof relocation sections

The section will contain static relocations which do not need to be
preserved after linking, and moreover these relocations may reference
symbols that end up getting removed.

Do not set SHF_ALLOC and instead let the linker decide what needs to be
done.

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

(cherry picked from commit 27f35b7dd418a82cf2f5bb618bd4bb7e81253f3a)

14 months agoarm64: Move the initial kernel stack out of the init_pagetables section
Mark Johnston [Fri, 31 Mar 2023 15:04:37 +0000 (11:04 -0400)]
arm64: Move the initial kernel stack out of the init_pagetables section

init_pagetables is mapped into the segment containing the BSS, but does
not get zeroed by locore.  It is used for bootstrap page table pages.

It happens that the bootstrap kernel stack is also placed in that
section, but there's no reason it shouldn't live in the BSS, so move it
there.  No functional change intended.

Reviewed by: andrew
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D39367

(cherry picked from commit 1a3cb489e5aac260eb9f48567dd6c086d62a8ea7)

14 months agoarm64: Ensure that thread0's PCB flags are initialized
Mark Johnston [Fri, 31 Mar 2023 13:50:34 +0000 (09:50 -0400)]
arm64: Ensure that thread0's PCB flags are initialized

On arm64, the PCB is stored at the top of the thread stack.  For thread0
this comes from the static "initstack" region, which is placed in the
.init_pagetable section, which is not part of the BSS and thus doesn't
get zeroed by locore.  (See the comment in ldscript.arm64.)  It is thus
possible for the pcb_flags field to be uninitialized, which can result
in PCB_SINGLE_STEP being set.

Fix this by simply initializing the field.  A separate commit will move
initstack out of the .init_pagetable section, since it has no reason to
be there, but it is preferable to explicitly initialize PCB fields
anyway.  In particular, regular kernel stacks are not zeroed upon
allocation, so we should be consistent here.

Reviewed by: andrew
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D39343

(cherry picked from commit a54370f4abb6bc4e3ef25da97adb3262bacb5a4b)

14 months agorelease/oci: add Oracle Cloud image builder
Dave Cottlehuber [Sun, 27 Nov 2022 11:12:02 +0000 (11:12 +0000)]
release/oci: add Oracle Cloud image builder

Provides an OCI (Oracle Cloud Infrastructure) release target for
Oracle's KVM-based VM implementation. Tested using 13.1-RELEASE,
primarily on Ampere CPU on A1.Flex VM shapes, but also works on
amd64 shapes.

- supports cloud-init and custom scripts
- provides a freebsd@ sudo-enabled user
- root user disabled over ssh & console

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Sponsored by:   SkunkWerks, GmbH
Technical assistance from:  Oracle
Differential Revision: https://reviews.freebsd.org/D34746

(cherry picked from commit 0af49f00b3096a5809f992d87b416cc0f70435ea)

14 months agoMFC: bcm5874: Add opt_usb.h for module dependency
Warner Losh [Tue, 5 Apr 2022 19:44:50 +0000 (13:44 -0600)]
MFC: bcm5874: Add opt_usb.h for module dependency

(cherry picked from commit 56cc89585d392d8c8f120b2e4b8faa7df236b4ea)

14 months agobhyve: add QEMU_FWCFG_INDEX_NB_CPUS item
Corvin Köhne [Mon, 27 Jun 2022 09:05:42 +0000 (11:05 +0200)]
bhyve: add QEMU_FWCFG_INDEX_NB_CPUS item

Requested-by: OVMF (qemu)
Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39316

(cherry picked from commit e46be58cca6bd180dadfb36e98a673ae6d8d2cd1)

bhyve: add missing include to qemu_fwcfg.c

Fixes: e46be58cca6bd180dadfb36e98a673ae6d8d2cd1 ("bhyve: add QEMU_FWCFG_INDEX_NB_CPUS item")
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 76fa62b5232e67ef10476cf1329aaceb9cbc2ff5)

14 months agokbdcontrol.c: make pre-Unicode compatibility conditional
Stefan Eßer [Tue, 14 Feb 2023 12:27:27 +0000 (13:27 +0100)]
kbdcontrol.c: make pre-Unicode compatibility conditional

Support for the full range of Unicode character codes has been added
to the main keymap back in 2009, with compatibility shims added in
2011 (to support an older kbdcontrol command on a new kernel during
an upgrade from FreeBSD-8 to FreeBSD-9).

Unicode support for accented characters that are reached via dead key
combinations has been added just recently, again with compatibility
shims to allow all combinations of old/new kernel and old/new
kbdcontrol command to load and display the keymaps including the dead
key table. (But full Unicode in the dead key table requires both a new
kernel and kbdcontrol command.)

This commit makes the compatibility shims depend on the respective
compatibility ioctls (OGIO_KEYMAP, OPIO_KEYMAP, OGIO_DEADKEYMAP, and
OPIO_DEADKEYMAP) being defined in sys/kbio.h. This is true for all of
them in 13-STABLE, none in 12-STABLE (as of now), and will become
optional due to a follow-up commit to sys/kbio.h in -CURRENT.

This commit is the only part of review D38465 that should be merged
back to 12-STABLE and 13-STABLE.

(cherry picked from commit b4eab621f2462574d1836c199dc84c5bdb4f60f7)

14 months agomakefs: emit NM records for all directory entries
Ed Maste [Fri, 24 Mar 2023 17:53:59 +0000 (13:53 -0400)]
makefs: emit NM records for all directory entries

We previously attempted to emit Rock Ridge NM records only when the name
represented by the Rock Ridge extensions would actually differ. We would
omit the record for an all-upper-case directory name, however Linux (and
perhaps other operating systems) map names with no NM record to
lowercase.

This affected only directories, as file names have an implicit ";1"
version number appended and thus always differ.  To solve, just emit NM
records for all entries other than DOT and DOTDOT .

We could continue to omit the NM record for directories that would avoid
mapping (for example, one named 1234.567) but this does not seem worth
the complexity.

PR: 203531
Reported by: Thomas Schmitt <scdbackup@gmx.net
Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39258

(cherry picked from commit 978013a0945d4c6b7ab3ee798dc13c74e913762a)

14 months agomakefs: correct El Torito bood record
Ed Maste [Thu, 23 Mar 2023 17:02:44 +0000 (13:02 -0400)]
makefs: correct El Torito bood record

The boot catalog pointer is a DWord, but we previously populated it via
cd9660_bothendian_dword which overwrote four unused bytes following it.
See El Torito 1.0 (1995) Figure 7 for details.

PR: 203531, 203646
Reported by: Coverity Scan
Reported by: Thomas Schmitt <scdbackup@gmx.net>
Reviewed by: kevans
CID: 977470
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39231

(cherry picked from commit 9f2a525360473a778f91021e3be58fd4bfd72ee5)

14 months agomakefs: correct iso9660 Rock Ridge NM values
Ed Maste [Thu, 23 Mar 2023 12:35:34 +0000 (08:35 -0400)]
makefs: correct iso9660 Rock Ridge NM values

These are not actually used by makefs (yet), but ought to match the
spec.

See RRIP 4.1.4 Description of the "NM" System Use Entry for details.

PR: 203531
Sponsored by: The FreeBSD Foundation

(cherry picked from commit c3ec19359e05c3b609e461896aa6ab4d6ad8121f)

14 months agomakefs: correct iso9660 Rock Ridge TF timestamps
Ed Maste [Wed, 22 Mar 2023 23:42:45 +0000 (19:42 -0400)]
makefs: correct iso9660 Rock Ridge TF timestamps

The bit definitions for the TF_* timestamp bits (TF_MODIFY, etc.) were
incorrect, and timestamps were written in the wrong order.

See RRIP 4.1.6 Description of the "TF" System Use Entry for details.

PR: 203531
Reported by: Thomas Schmitt <scdbackup@gmx.net>
Reviewed by: jrtc27, kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39221

(cherry picked from commit c65c969bd5d4ae7c52dedafb3c39b7e933079d4a)

14 months agosetkey(8): add -e option to take script from the command line
Konstantin Belousov [Mon, 3 Apr 2023 01:03:50 +0000 (04:03 +0300)]
setkey(8): add -e option to take script from the command line

(cherry picked from commit 3cb808226c1f62ed5c726480073eb9035a24d2cc)

14 months agoifconfig: Fix configuring if_bridge with additional operating parameters
Zhenlei Huang [Fri, 7 Apr 2023 14:25:41 +0000 (22:25 +0800)]
ifconfig: Fix configuring if_bridge with additional operating parameters

For clone create and rename operations, the interface name get back can be
different from the one passed to ioctl(). Use the interface name we get back
so that ifconfig will not return unexpected ENXIO.

PR: 270618
Reviewed by: kp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39396

(cherry picked from commit 09e5e3d598604167c1fb05e5cd0f41ed83314517)

14 months agoifconfig: Improve VLAN identifier parsing
Zhenlei Huang [Sun, 2 Apr 2023 17:54:31 +0000 (01:54 +0800)]
ifconfig: Improve VLAN identifier parsing

VLAN identifier 0xFFF is reserved. It must not be configured or
transmitted.

Also validate during parsing to prevent potential integer overflow.

Reviewed by: #network, melifaro
Fixes: c7cffd65c5d85 Add support for stacked VLANs (IEEE 802.1ad, AKA Q-in-Q)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39282

(cherry picked from commit 28b498e65ab40975ea12393498bacd6249b7204c)

14 months agoinfiniband: Widen NET_EPOCH coverage
Zhenlei Huang [Sun, 2 Apr 2023 16:51:49 +0000 (00:51 +0800)]
infiniband: Widen NET_EPOCH coverage

From static code analysis, some device drivers (cxgbe, mlx4, mthca, and qlnx)
do not enter net epoch before lagg_input_infiniband(). If IPoIB interface is a
member of lagg(4) interface, and after returning from lagg_input_infiniband()
the receiving interface of mbuf is set to lagg(4) interface, then when
concurrently destroying the lagg(4) interface, there is a small window that the
interface gets destroyed and becomes invalid before infiniband_input() re-enter
net epoch, thus leading use-after-free.

Widen NET_EPOCH coverage to prevent use-after-free.

Thanks hselasky@ for testing with mlx5 devices.

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

(cherry picked from commit 90820ef121b38479f2479c03c12c69f940f5fa33)

14 months agolagg(4): Tap traffic after protocol processing
Zhenlei Huang [Sun, 2 Apr 2023 17:01:51 +0000 (01:01 +0800)]
lagg(4): Tap traffic after protocol processing

Different lagg protocols have different means and policies to process incoming
traffic. For example, for failover protocol, by default received traffic is only
accepted when they are received through the active port. For lacp protocol, LACP
control messages are tapped off, also traffic will be dropped if they are
received through the port which is not in collecting state or is not joined to
the active aggregator. It confuses if user dump and see inbound traffic on
lagg(4) interfaces but they are actually silently dropped and not passed into
the net stack.

Tap traffic after protocol processing so that user will have consistent view of
the inbound traffic, meanwhile mbuf is set with correct receiving interface and
bpf(4) will diagnose the right direction of inbound packets.

PR: 270417
Reviewed by: melifaro (previous version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39225

(cherry picked from commit 5f3d0399e903573e9648385ea6585e54af4d573f)

14 months agolacp: Use C99 bool for boolean return value
Zhenlei Huang [Fri, 31 Mar 2023 17:48:36 +0000 (01:48 +0800)]
lacp: Use C99 bool for boolean return value

This improves readability.

No functional change intended.

MFC after: 1 week

(cherry picked from commit 5a8abd0a298e6e7a8bf938a7eb171b647b1860cd)

14 months agolagg(4): Do not enter net epoch recursively
Zhenlei Huang [Wed, 29 Mar 2023 16:25:16 +0000 (00:25 +0800)]
lagg(4): Do not enter net epoch recursively

This saves a little resources.

No functional change intended.

Reviewed by: kp
Fixes: b8a6e03fac92 Widen NET_EPOCH coverage
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39267

(cherry picked from commit d4a80d21b3d32a2de02d1820cc1f38dba1f127cb)

14 months agolagg(4): Refactor out some lagg protocol input routines into a default one
Zhenlei Huang [Wed, 29 Mar 2023 16:16:21 +0000 (00:16 +0800)]
lagg(4): Refactor out some lagg protocol input routines into a default one

Those input routines are identical.

Also inline two fast paths.

No functional change intended.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39251

(cherry picked from commit dbe86dd5de18fdf61e1300f6575e0f50785bf6b3)

14 months agolagg(4): Make lagg_list and lagg_detach_cookie static
Zhenlei Huang [Wed, 29 Mar 2023 16:13:02 +0000 (00:13 +0800)]
lagg(4): Make lagg_list and lagg_detach_cookie static

They are used internally only.

No functional change intended.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39250

(cherry picked from commit fcac5719a1833ad865ac0a7960ff18319a40dfff)

14 months agolagg: Various style fixes
Zhenlei Huang [Fri, 24 Mar 2023 09:55:15 +0000 (17:55 +0800)]
lagg: Various style fixes

MFC after: 1 week

(cherry picked from commit dcd7f0bd02f407952de42d96e1c2c01ee3460702)

14 months agodaemon: reformat longopts
Kyle Evans [Thu, 23 Mar 2023 02:39:10 +0000 (21:39 -0500)]
daemon: reformat longopts

Use a single tab instead of eight spaces, these aren't line
continuations.

(cherry picked from commit b84aaf143c5097e6b2481b9afec66c90deec627f)

14 months agodaemon: decouple init logic from main loop
Ihor Antonov [Thu, 23 Mar 2023 02:37:12 +0000 (21:37 -0500)]
daemon: decouple init logic from main loop

main() func contained both initialization and main loop logic.
This made certain operations like restarting problematic and
required dirty hacks in form of goto jumps.

This commit moves the main loop logic into daemon_eventloop(),
cleans up main, and makes restart logic clear: daemon_mainloop()
is run in a loop with a restart condition checked at the end.

Reviewed by: kevans

(cherry picked from commit 4c41f4a0d67fc93cfb07ad5287f02d024d19ef5a)

14 months agodaemon: move signal setup into a function
Ihor Antonov [Tue, 21 Mar 2023 04:40:04 +0000 (23:40 -0500)]
daemon: move signal setup into a function

No functional change intended.

Reviewed by: kevans

(cherry picked from commit 9ee1faeebab594712ed302ea51949410c9744920)

14 months agopkill: use an ARG_MAX size buffer for argument matching
Kyle Evans [Mon, 20 Mar 2023 19:19:35 +0000 (14:19 -0500)]
pkill: use an ARG_MAX size buffer for argument matching

Right now pkill/pgrep cut off at _POSIX2_LINE_MAX (2048), but argument
strings can be much larger (ARG_MAX is 256K/512K).  Stop arbitrarily
cutting the search off at 2K, rather than documenting the limit.

Reviewed by: allanjude (earlier version), des
Sponsored by: Klara, Inc.

(cherry picked from commit 3610bffd2888b65389a46e8d075ce8e1fc83af4c)

14 months agodaemon: kill off some stray blank lines
Kyle Evans [Sat, 18 Mar 2023 06:04:35 +0000 (01:04 -0500)]
daemon: kill off some stray blank lines

Overlooked in review; mea culpa.

Reported by: jrtc27

(cherry picked from commit 6b49a630f441e1a9e8c8e57d2bb71e589d95872c)

14 months agodaemon: remove unnecessary memset in daemon_state_init()
Ihor Antonov [Sat, 18 Mar 2023 05:43:35 +0000 (22:43 -0700)]
daemon: remove unnecessary memset in daemon_state_init()

(cherry picked from commit 8117ea0a413150dccc05ea376596b98c4b1855e6)

14 months agodaemon: repace goto exit with daemon_terminate()
Ihor Antonov [Sat, 18 Mar 2023 05:31:12 +0000 (22:31 -0700)]
daemon: repace goto exit with daemon_terminate()

Start breaking down big main()
Remove goto exit label and replace it with a function that does cleanup.

Comment re-worded by kevans@.

(cherry picked from commit cf6356fd471cdf4e5c52550f63599881d722962c)

14 months agodaemon: move variables into struct daemon_state
Ihor Antonov [Sun, 12 Mar 2023 16:07:34 +0000 (10:07 -0600)]
daemon: move variables into struct daemon_state

The fact that most of the daemon's state is stored on the stack
of the main() makes it hard to split the logic smaller chunks.
Which in turn leads to huge main func that does a a lot of things.
struct log_params existed because some variables need to be passed
into other functions together.

This change renames struct log_params into daemon_state
and moves the rest of the variables into it. This is a necessary
preparation step for further refactroing.

Reviewed by: imp

(cherry picked from commit 298a392ec31819c8440974eeb47dfed48568fd5e)

14 months agoBump __FreeBSD_version for llvm 15.0.7 merge
Dimitry Andric [Wed, 8 Feb 2023 19:20:21 +0000 (20:20 +0100)]
Bump __FreeBSD_version for llvm 15.0.7 merge

PR: 265425
MFC after: 2 weeks

(cherry picked from commit 3264f6b88fce7c5437d205685863617d8f6a22dd)