]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 months agofreebsd-update: handle file -> directory on upgrade
Ed Maste [Wed, 27 Sep 2023 13:36:33 +0000 (09:36 -0400)]
freebsd-update: handle file -> directory on upgrade

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

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

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

(cherry picked from commit f6d37c9ca13f8ab0ef32cf5344daecb8122d1e85)

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

OpenZFS release 2.1.13

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

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

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

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

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

(cherry picked from commit 3fb80f1476c7776f04ba7ef6d08397cef6abcfb0)

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

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

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

(cherry picked from commit 3e609fd481c07802fe837ed834c3710b8c19493c)

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

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

(cherry picked from commit 0a5d2802b41fd216d9a345f749af1a6ccbe9f382)

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

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

(cherry picked from commit a2d1360142f609485c9301df08cc99140743ef2b)

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

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

(cherry picked from commit b653faaa19c47a4a7e488e5ead738b7ae44ffe8b)

Fix typos in acl_get_entry(3) manual page.

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

(cherry picked from commit c34fce8a039935e06ed84db1395d7d2c551e5a7c)

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

PR: 273953

(cherry picked from commit c584bb9cac16bc200ac45cc8b709e7e7e99e24bb)

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

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

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

Discussed with: kib, mjg

(cherry picked from commit 67864268da53b792836f13be10299de8cd62997e)

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

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

(cherry picked from commit a3074ff2122faf0eaba7d3f989e916b1c7f21912)

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

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

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

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

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

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

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

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

(cherry picked from commit 8527bb2aee6ca9013c34445de88217a954b6628d)

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

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

(cherry picked from commit 38426b32e106cf251520259b29779372eda7a5f8)

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

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

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

(cherry picked from commit f44102411e1b16363e91a074c9c403069c550e4d)

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

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

(cherry picked from commit 7f5e3b9fa3d159b7f061b4d01a767cbe5d0527f3)

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

MFC after: 3 days

(cherry picked from commit 855e0457396c7addb1df6fc1d14200cc8de286c0)

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

PR:             273966
Reviewed by: emaste

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

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

PR: 273565

(cherry picked from commit cd89fe3923e92ab090cbdff7eb215c2d85b51718)

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

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

PR: 273565, 273245

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

(cherry picked from commit 035f7c9a3653d91564a5513f1311aa3b6e14a17e)

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

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

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

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

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

(cherry picked from commit 70fbcd451b68b7f6038d8a602cd8d5e1bb890f1d)

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

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

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

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

(cherry picked from commit ede6c6c0434a266a1712ffe807f4e31e229948df)

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

Sponsored by: The FreeBSD Foundation

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

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

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

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

(cherry picked from commit b6ce41118bb11d3db86eae8fbebc8c198e8b330d)

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

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

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

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

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

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

8 months agogicv3: Add checks for the device ID
Andrew Turner [Tue, 22 Aug 2023 14:37:19 +0000 (15:37 +0100)]
gicv3: Add checks for the device ID

Add checks that the device ID is supported by the hardware and is
within the range allocated when the driver attaches.

Reviewed by: gallatin, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41554

(cherry picked from commit 7d2dd08d013d79dc3f2a22747b079628a571cea2)

8 months agogicv3: Add a verbose message for unknown tables
Andrew Turner [Tue, 22 Aug 2023 11:30:50 +0000 (12:30 +0100)]
gicv3: Add a verbose message for unknown tables

Add a message under bootverbose when we find a gicv3 its table type
that is unknown.

Reviewed by: gallatin, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41553

(cherry picked from commit 629734783de5212ea2a7cdc6a8fb7cf6834b1344)

8 months agogicv3: Stop setting the esize field
Andrew Turner [Tue, 22 Aug 2023 11:29:03 +0000 (12:29 +0100)]
gicv3: Stop setting the esize field

The GITS_BASER esize field is read-only, there is no need to change it.

Reviewed by: gallatin, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41552

(cherry picked from commit 2f11b2abfc185d3d4f45e6a3dae270b859cdd388)

8 months agogicv3: Split out finding the page size
Andrew Turner [Tue, 22 Aug 2023 10:51:26 +0000 (11:51 +0100)]
gicv3: Split out finding the page size

When adding indirect (2 level) tabled we will need to know the page
size to calculate the size of the level 1 table. To allow for this find
the page size before entering the loop to calculate the final register
value.

Reviewed by: gallatin, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41551

(cherry picked from commit 3fc4f7c88085dc94c88348839074b8db6f19fae1)

8 months agoarm64: Update the ID_AA64PFR1_EL1 fields
Andrew Turner [Thu, 6 Jul 2023 14:40:01 +0000 (15:40 +0100)]
arm64: Update the ID_AA64PFR1_EL1 fields

While here move to decimal for the _op and _CR definitions to be used
by a future macro to define the register when the assembler doesn't
know about it.

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40896

(cherry picked from commit 8c111e5b375897bc298b8cdb3095f3c0e29c2307)

8 months agoarm64: Update the ID_AA64PFR0_EL1 fields
Andrew Turner [Thu, 6 Jul 2023 14:02:35 +0000 (15:02 +0100)]
arm64: Update the ID_AA64PFR0_EL1 fields

While here move to decimal for the _op and _CR definitions to be used
by a future macro to define the register when the assembler doesn't
know about it.

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40895

(cherry picked from commit 0766dde9b5587d04c634eda1ab4666203d32a271)

8 months agoarm64: Don't use hex for ID_AA64MMFR2_EL1_op/CR*
Andrew Turner [Thu, 6 Jul 2023 13:15:12 +0000 (14:15 +0100)]
arm64: Don't use hex for ID_AA64MMFR2_EL1_op/CR*

It breaks a future macro that creates the alternative register name
for old compilers.

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40892

(cherry picked from commit 2134cfe793d67e3bc6ec0713862168452f4ad8f0)

8 months agoarm64: Update the ID_AA64MMFR1_EL1 fields
Andrew Turner [Thu, 6 Jul 2023 13:11:29 +0000 (14:11 +0100)]
arm64: Update the ID_AA64MMFR1_EL1 fields

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40891

(cherry picked from commit 284f91de8b43a5d66fbd484d6cb5ab2d86e822d1)

8 months agoarm64: Update the ID_AA64MMFR0_EL1 fields
Andrew Turner [Thu, 6 Jul 2023 12:34:28 +0000 (13:34 +0100)]
arm64: Update the ID_AA64MMFR0_EL1 fields

While here move to decimal for the _op and _CR definitions to be used
by a future macro to define the register when the assembler doesn't
know about it.

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40890

(cherry picked from commit b21402d058755f4b33a82fa8024fbf4501f5a218)

8 months agoarm64: Update the ID_AA64ISAR1_EL1 fields
Andrew Turner [Thu, 6 Jul 2023 10:01:11 +0000 (11:01 +0100)]
arm64: Update the ID_AA64ISAR1_EL1 fields

While here move to decimal for the _op and _CR definitions to be used
by a future macro to define the register when the assembler doesn't
know about it.

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40889

(cherry picked from commit de01309926e21e1cff196b6b23cff6c52064aa0e)

8 months agoarm64: Update the ID_AA64ISAR0_EL1 fields
Andrew Turner [Thu, 6 Jul 2023 09:19:21 +0000 (10:19 +0100)]
arm64: Update the ID_AA64ISAR0_EL1 fields

While here move to decimal for the _op and _CR definitions to be used
by a future macro to define the register when the assembler doesn't
know about it.

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40888

(cherry picked from commit 4182f58172b56f71bfaf2450a0e9cb8b4397bf0a)

8 months agoarm64: Update the ID_AA64DFR0_EL1 fields
Andrew Turner [Mon, 13 Mar 2023 09:17:32 +0000 (09:17 +0000)]
arm64: Update the ID_AA64DFR0_EL1 fields

While here move to decimal for the _op and _CR definitions to be used
by a future macro to define the register when the assembler doesn't
know about it.

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40887

(cherry picked from commit 6fd44e5f530935a26f58637594ac22719324fb12)

8 months agoarm64: Make register definitions const
Mark Johnston [Wed, 28 Jun 2023 20:13:37 +0000 (16:13 -0400)]
arm64: Make register definitions const

No functional change intended.

Reviewed by: andrew
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc. (hardware)
Differential Revision: https://reviews.freebsd.org/D40502

(cherry picked from commit 00bcb77ebcbcb89bd27205b289699d711a0caf3d)

8 months agoContinue searching for an irq map from the start
Andrew Turner [Tue, 27 Jun 2023 08:32:12 +0000 (09:32 +0100)]
Continue searching for an irq map from the start

When searching for a free irq map location continue the search from the
beginning of the list. There may be holes in the map before
irq_map_first_free_idx, e.g. when removing an entries in order will
increase the index past the current free entry.

PR: 271990
Reviewed by: mhorne
Sponsored by: Arm Ltd

Differential Revision: https://reviews.freebsd.org/D40768

(cherry picked from commit 9beb195fd9fdc4beb7d5bca865cf5b19ccd7449b)

8 months agoAdd more arm64 special register values
Andrew Turner [Fri, 9 Jun 2023 17:46:58 +0000 (18:46 +0100)]
Add more arm64 special register values

These will be used to simplify the kernel special register handling.

Sponsored by: Arm Ltd

(cherry picked from commit 178747a1586d48a8063014d7b8528ec47205e1bf)

8 months agoAdd more arm64 ID registers to the user_regs array
Andrew Turner [Fri, 9 Jun 2023 08:36:12 +0000 (09:36 +0100)]
Add more arm64 ID registers to the user_regs array

This is a mapping from ID register value to offset in struct cpu_desc.
These registers may be needed with future architecture revisions either
by userspace or by bhyve.

Sponsored by: Arm Ltd

(cherry picked from commit 1dd169af7143db4df613f273e565919c1c2b53f5)

8 months agoarm64: Fix the definition of ID_AA64DFR1_EL1
Andrew Turner [Fri, 2 Jun 2023 15:23:47 +0000 (16:23 +0100)]
arm64: Fix the definition of ID_AA64DFR1_EL1

(cherry picked from commit dd235575283811af73db665a280ac40f8b0a608b)

8 months agoAdd more arm64 ID registers
Andrew Turner [Fri, 2 Jun 2023 14:59:46 +0000 (15:59 +0100)]
Add more arm64 ID registers

These will be used by bhyve to emulate these registers.

Sponsored by: Arm Ltd

(cherry picked from commit 4baf5db06ccfdb616abb6a68be99f297f7377bf4)

8 months agoarm64: Correct a pmap unlock in pmap_stage2_fault
Andrew Turner [Fri, 2 Jun 2023 09:58:56 +0000 (10:58 +0100)]
arm64: Correct a pmap unlock in pmap_stage2_fault

This is used by bhyve so was not an issue as it is still in development.
Sponsored by: Arm Ltd

(cherry picked from commit 8cca8e248fb7f5fb475544a08d8cdb24d26bf4b3)

8 months agoAdd brackets around GICv3 redistributor macros
Andrew Turner [Thu, 25 May 2023 08:35:14 +0000 (09:35 +0100)]
Add brackets around GICv3 redistributor macros

The GICv3 redistributor register access macros take arguments that are
used as variables. Add brackets around them as is the style, and for
safety.

Sponsored by: Arm Ltd

(cherry picked from commit 8b709c88e56dc7e035be6744572bd2978a704338)

8 months agoarm64: Print the spinlock count on panic
Andrew Turner [Wed, 24 May 2023 14:40:30 +0000 (15:40 +0100)]
arm64: Print the spinlock count on panic

When the spinlock count is non-zero while taking a data abort we panic.
Print this count to help debugging.

Sponsored by: Arm Ltd

(cherry picked from commit fa512fcd8fe74d72b7f29a324c8cd3ca20ff25c8)

8 months agoPrint registers on an arm64 spinlock data abort
Andrew Turner [Tue, 23 May 2023 09:21:39 +0000 (10:21 +0100)]
Print registers on an arm64 spinlock data abort

When checking if the spinlock count is correct in a data abort we can
panic without printing the registers. These are useful to debug the
abort, e.g. by giving the fault address register.

Reviewed by: kib
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D40228

(cherry picked from commit 0731b0a9f1f9e3b4ec699ec67b6eb24159fa9b05)

8 months agoAdd more arm64 special registers
Andrew Turner [Thu, 4 May 2023 10:30:57 +0000 (11:30 +0100)]
Add more arm64 special registers

These will be used by bhyve

Reviewed by: markj
Sponsored by: Arm Ltd
Sponsored by: Innovate UK
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40128

(cherry picked from commit 419f8fc7fbc8b860df92db58d13ac9c9aafa1c10)

8 months agoSplit out pmap_map_delete on arm64
Andrew Turner [Fri, 28 Apr 2023 10:54:19 +0000 (11:54 +0100)]
Split out pmap_map_delete on arm64

This will be used when supporting some extensions, e.g. Branch Target
Identification (BTI).

Sponsored by: Arm Ltd

(cherry picked from commit 020edaea2ab05c9cea7d83872f28a4e5e65407e2)

8 months agoCreate pmap_mask_set_locked on arm64
Andrew Turner [Wed, 12 Apr 2023 12:09:06 +0000 (13:09 +0100)]
Create pmap_mask_set_locked on arm64

Create a locked version of pmap_mask_set. We will need this for BTI
support.

Sponsored by: Arm Ltd

(cherry picked from commit 421516f25e9cfa91b33841f633a463889bc10af7)

8 months agoMark EENTRY as .text
Andrew Turner [Thu, 6 Apr 2023 15:36:15 +0000 (16:36 +0100)]
Mark EENTRY as .text

To allow it to be used before ENTRY we need to ensure the symbol is
in the .text section. It also needs to be aligned correctly.

While here mark the symbol type as a function as in the ENTRY macro.

Reported by: jrtc27
Sponsored by: Arm Ltd

(cherry picked from commit 04b4655997d2d10e3f3748f3a1a1d84c4ae95740)

8 months agoMove arm64 EENTRY uses before ENTRY
Andrew Turner [Fri, 31 Mar 2023 12:34:51 +0000 (13:34 +0100)]
Move arm64 EENTRY uses before ENTRY

The ENTRY macro adds instructions to the start of a function but not
EENTRY. To use these instructions in both functions move the EENTRY
use before the ENTRY use.

Sponsored by: Arm Ltd

(cherry picked from commit 47ff149afaea6a403b8d044e26673bc3cd605fe4)

8 months agoHandle the arm64 unknown exception separately
Andrew Turner [Fri, 31 Mar 2023 09:15:45 +0000 (10:15 +0100)]
Handle the arm64 unknown exception separately

Rather than falling through to the default case handle the unknown
exception with its own panic message. As ESR_EL1 is zero for this
exception stop printing it.

Sponsored by: Arm Ltd

(cherry picked from commit 3a0cc6fe61ea29334c17dfb71bf24ba9e604ab4c)

8 months agoMark arm64 mair_el1 fields as unsigned long
Andrew Turner [Thu, 16 Mar 2023 16:19:21 +0000 (16:19 +0000)]
Mark arm64 mair_el1 fields as unsigned long

The register is 64-bit so the upper bits could be shifted past the
signed 32-bit size of an int the values were before.

Sponsored by: Arm Ltd

(cherry picked from commit a671f96d9319d63e4a634f88ae277c4d682bba69)

8 months agoAdd PSCI affinity info return values
Andrew Turner [Thu, 16 Mar 2023 12:16:59 +0000 (12:16 +0000)]
Add PSCI affinity info return values

These can be returned from the PSCI AFFINITY_INFO call. This is not
marked as optional so bhyve will need to implement it & can use these
macros.

Sponsored by: Arm Ltd

(cherry picked from commit 7d0b915919665cb43107b36ad103791515eade5b)

8 months agoAdd a psci macro to build a version value
Andrew Turner [Thu, 16 Mar 2023 12:14:01 +0000 (12:14 +0000)]
Add a psci macro to build a version value

Add PSCI_VER that takes a major and minor version and builds the value
returned by the firmware. This will be used by bhyve.

Sponsored by: Arm Ltd

(cherry picked from commit e89be21854b3aa33efd2e06529a181343281659d)

8 months agoAllow psci.h to be used by userspace
Andrew Turner [Thu, 16 Mar 2023 12:08:32 +0000 (12:08 +0000)]
Allow psci.h to be used by userspace

Wrap parts of psci.h that aren't usable by userspace in _KERNEL checks.
This allows it to be used to implement PSCI and SMCCC by bhyve in
userspace.

Sponsored by: Arm Ltd
Sponsored by: Innovate UK
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 473ab212dc1f72c1765f112568237d229d4e0441)

8 months agorc.d/hostid: remove useless cat
наб [Mon, 30 May 2022 23:18:12 +0000 (01:18 +0200)]
rc.d/hostid: remove useless cat

We've already read it and validated it ‒ re-reading is wasteful

PR: 264376
(cherry picked from commit 11bd40d04af59daa7ae7feea0518081a35f07053)

8 months agovt: clarify comments on kbd add/release
Ed Maste [Thu, 24 Feb 2022 15:38:16 +0000 (10:38 -0500)]
vt: clarify comments on kbd add/release

PR: 247498

(cherry picked from commit a2774a9264eb11b26fc6be4127a8c0da1ead297d)

8 months agomemcpy.3: remove BUGS section allowing overlapping strings
Ed Maste [Tue, 24 Aug 2021 13:20:18 +0000 (09:20 -0400)]
memcpy.3: remove BUGS section allowing overlapping strings

The removed text claimed that memcpy is implemented using bcopy and thus
strings may overlap.  Use of bcopy is an implementation detail that is
no longer true, even if the implementation (on some archs) does allow
overlap.

In any case behaviour is undefined per the C standard if memcpy is
called with overlapping objects, and this man page already claimed that
src and dst may not overlap.

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

(cherry picked from commit 37296464defda0aa769c39ab554deb4875aef000)

8 months agorescue: include ping iff at least one of INET & INET6 is enabled
Ed Maste [Fri, 31 Dec 2021 01:11:31 +0000 (20:11 -0500)]
rescue: include ping iff at least one of INET & INET6 is enabled

Ping does not build (and serves no purpose) if neither is enabled
(i.e., building WITHOUT_INET and WITHOUT_INET6).

This is equvalent to a4ef9e58bc0c but for rescue/.

PR: 260082
Fixes: a4ef9e58bc0c ("sbin: build ping if at least one of...")
Sponsored by: The FreeBSD Foundation

(cherry picked from commit daf481f3d508e7497b456e8df7db17c90b623ee0)

8 months agoudl.4: note that "device videomode" is also required
Archimedes Gaviola [Sat, 9 Sep 2023 17:39:17 +0000 (13:39 -0400)]
udl.4: note that "device videomode" is also required

Reviewed by: emaste

(cherry picked from commit 9888a79adad22ba06b5aff17d05abac0029c537a)

8 months agoAdd deprecation notices to publickey(5) tools
Ed Maste [Wed, 20 Sep 2023 11:31:14 +0000 (07:31 -0400)]
Add deprecation notices to publickey(5) tools

Reviewed by: imp, manu
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40144

(cherry picked from commit d5ef73a71f0e2fbc4dc9b907a6e59a15599c50b3)

8 months agorc.subr: don't require service to be enabled for `status`
Daniel Tameling [Sat, 1 Jul 2023 08:43:40 +0000 (10:43 +0200)]
rc.subr: don't require service to be enabled for `status`

For a service that sets an rcvar, there is a check whether it has been
enabled before the actual command is executed. If the check fails, one
gets a message to enable it and the returned exit status is 0.
However, this is usually undesirable for the status command, which is
a) supposed to check whether the service is running anyway and
b) returns a non-zero exit code if that is not the case.
Thus, skip the check for the status command.

PR: 272282
Reviewed by: emaste

(cherry picked from commit ba793728a840041e93e38bcbff4a7233dc63b722)
(cherry picked from commit f701d9da1d94891dd2edad607a989cad6eb10313)

8 months agosrc.conf.5: regen after SSP option description update
Ed Maste [Thu, 7 Sep 2023 15:57:46 +0000 (11:57 -0400)]
src.conf.5: regen after SSP option description update

Also pick up missing note about SSP being disabled for MIPS.

(cherry picked from commit 5449d0144d612d7b7b3b85ab292d514db4e300c3)

8 months agoUpdate WITH_/WITHOUT_SSP descriptions
Ed Maste [Wed, 30 Aug 2023 20:49:44 +0000 (16:49 -0400)]
Update WITH_/WITHOUT_SSP descriptions

ProPolice refers to a specific implementation by Hiroaki Etoh and
Kunikazu Yoda.  The implementation in contemporary Clang and GCC is
somewhat different and newer, so use a generic term in the src.conf
descriptions.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit b461276d75488fe50c1503db85d43cbb8c3c3067)

8 months agoWhen parsing a rule to rotate log files on a specific week day,
Garance A Drosehn [Thu, 30 Dec 2021 20:45:13 +0000 (20:45 +0000)]
When parsing a rule to rotate log files on a specific week day,
parseDWM() can advance the time to the next week. If the next week is
in the next month, then tm_mon is incremented. However, the increment
was failing to handle the wraparound from December to January, so when
parsing a rule during the last week of the December, the month would
advance to month 12. This triggered an out-of-bounds read of the
mtab[] array in days_pmonth() after parseDWM() returned.  To fix,
this change resets the month to January and increment the year when
the month increment wraps.

The default rule for /var/log/weekly.log triggers this during the
last week of December each year.
Reported by: CHERI
Obtained from: CheriBSD
Reviewed by: jhb
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: <https://reviews.freebsd.org/D33687>

(cherry picked from commit b7b447fd4ca327faa99b2f16e6cbd61c86c75f04)

8 months agoirdma(4): remove artificial completion generator
Bartosz Sobczak [Mon, 21 Aug 2023 11:28:58 +0000 (13:28 +0200)]
irdma(4): remove artificial completion generator

Removing artificial completion generator as there had been no indication
of the code being required for E810 cards.  Further more it was found
that the code may have unpleasant side effects on user experience when
using ucmatose tool.

Signed-off-by: Bartosz Sobczak <bartosz.sobczak@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: erj@
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D41593

(cherry picked from commit ffafa6a4d157e49e6b12567958c4ab0c9151c080)

8 months agoirdma(4): use related vnet for searching netdev
Bartosz Sobczak [Mon, 21 Aug 2023 11:56:57 +0000 (13:56 +0200)]
irdma(4): use related vnet for searching netdev

It was found through testing that when ULP uses individual vnet, the
search for the correct vlan_id may failing because of no proper
interface with given address.

The solution is to use vnet associated to the connection whenever
possible.

Signed-off-by: Bartosz Sobczak <bartosz.sobczak@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: erj@
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D41592

(cherry picked from commit bc3a013ccd23c50bb48f17211ffc36fe85d11e18)

8 months agoice(4): Match irdma interface changes
Bartosz Sobczak [Mon, 24 Jul 2023 15:46:31 +0000 (17:46 +0200)]
ice(4): Match irdma interface changes

(This is a direct commit to stable/13)

Signed-off-by: Bartosz Sobczak <bartosz.sobczak@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Sponsored by: Intel Corporation

8 months agoirdma(4): upgrade to 1.2.17-k
Bartosz Sobczak [Wed, 5 Jul 2023 14:23:06 +0000 (16:23 +0200)]
irdma(4): upgrade to 1.2.17-k

Update Intel irdma driver to version 1.2.17-k

Notable changes:
- pf-reset handling improvements, including fixes in communication with if_ice(4)
- avoid racing when handling various events
- adding sw stats sysctls
- hand over pe_criterr handling from ice(4) to irdma(4)
- debug prints adjustments
- fix crash after changes in irdma_add_mqh_ifa_cb

Additional fixes in stable/13 but not in original cherry-picked commit:
- code appearance improvements
- bug fixes in fbsd_kcompat.c
- avoid waiting procedures under lock in irdma_add_mqh_ifa_cb
- busy wait for manage_qhash
- stats don't need to be RDTUN, RD is enough

Signed-off-by: Bartosz Sobczak <bartosz.sobczak@intel.com>
Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: erj@
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D41425

(cherry picked from commit 01fbb86991d524288a785b544c29d9c5ea1b61fb)

8 months agoirdma(4): Upgrade the driver to 1.1.11-k
Bartosz Sobczak [Tue, 28 Mar 2023 21:15:15 +0000 (14:15 -0700)]
irdma(4): Upgrade the driver to 1.1.11-k

Summary of changes:
- postpone mtu size assignment during load to avoid race condition
- refactor some of the debug prints
- add request reset handler
- refactor flush scheduler to increase efficiency and avoid racing
- put correct vlan_tag for UD traffic with PFC
- suspend QP before going to ERROR state to avoid CQP timout
- fix arithmetic error on irdma_debug_bugf
- allow debug flag to be settable during driver load
- introduce meaningful default values for DCQCN algorithm
- interrupt naming convention improvements
- skip unsignaled completions in poll_cmpl

Signed-off-by: Bartosz Sobczak bartosz.sobczak@intel.com
Signed-off-by: Eric Joyner <erj@FreeBSD.org>
Reviewed by: hselasky@
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D39173

(cherry picked from commit 35105900c65bb5adcde05d37ae34ad006970d4f9)

8 months agoObsoleteFiles: cleanup more old libclang_rt files for powerpc64le
Dimitry Andric [Tue, 19 Sep 2023 11:45:57 +0000 (13:45 +0200)]
ObsoleteFiles: cleanup more old libclang_rt files for powerpc64le

PR: 273776
MFC after: 3 days

(cherry picked from commit 8a99263e9da1f04ede967cfa1ea6d52d258dcbe5)
(cherry picked from commit 237b0c5b22c95683c2367ef0a82f54c309309db4)

8 months agoObsoleteFiles: cleanup old libclang_rt files for powerpc64le
Dimitry Andric [Sat, 16 Sep 2023 07:47:19 +0000 (09:47 +0200)]
ObsoleteFiles: cleanup old libclang_rt files for powerpc64le

PR: 273776
MFC after: 3 days

(cherry picked from commit cadbf320b352b3691cdfa90ad8ba818efca4ea68)

8 months agoObsoleteFiles: cleanup old libclang_rt files for powerpc64
Dimitry Andric [Thu, 14 Sep 2023 16:39:31 +0000 (18:39 +0200)]
ObsoleteFiles: cleanup old libclang_rt files for powerpc64

PR:             273776
MFC after:      3 days

(cherry picked from commit b9c012a60b6e98f7c3e765859195302cf3ae7f6c)

8 months agoObsoleteFiles.inc: Add libclang_rt libraries for riscv64 for LLVM 14/15.
John Baldwin [Tue, 5 Sep 2023 16:12:12 +0000 (09:12 -0700)]
ObsoleteFiles.inc: Add libclang_rt libraries for riscv64 for LLVM 14/15.

Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D41701

(cherry picked from commit 25b58f9a4a69012b5c1729a3895f9fb3369e2b5d)

8 months agotmpfs.5: Document option export
Mateusz Piotrowski [Mon, 18 Sep 2023 21:58:08 +0000 (23:58 +0200)]
tmpfs.5: Document option export

This is a no-op option supported for the sake of NFS.

MFC after: 7 days

(cherry picked from commit b2bd87bb01a97b5b025614a6bfccb8e109c201cd)

8 months agotmpfs.5: Document option union
Mateusz Piotrowski [Mon, 18 Sep 2023 20:29:09 +0000 (21:29 +0100)]
tmpfs.5: Document option union

As noted in 59169d915600333b7d9187097f157865ba642256,
tmpfs(5) supports the union option just fine.

MFC after: 7 days

(cherry picked from commit 1d225179fd5d7eb932486a94abb8b76be7e44241)

8 months agotmpfs.5: Document option nomtime
Mateusz Piotrowski [Mon, 18 Sep 2023 19:51:50 +0000 (20:51 +0100)]
tmpfs.5: Document option nomtime

Fixes: c1e84733ac7e tmpfs: add nomtime mount option,
MFC after: 7 days

(cherry picked from commit 6a1de1912d5216512a73dd97c4ee454d44b8fffb)

8 months agotmpfs.5: Document option nosymfollow
Mateusz Piotrowski [Mon, 18 Sep 2023 19:43:15 +0000 (20:43 +0100)]
tmpfs.5: Document option nosymfollow

Fixes: 15df90218bb6 tmpfs: support the nosymfollow mount option
MFC after: 7 days

(cherry picked from commit 942cc861f2cb5af287f15aa9b1bd56527f113032)

8 months agotmpfs.5: Document option pgread
Mateusz Piotrowski [Mon, 18 Sep 2023 19:38:53 +0000 (20:38 +0100)]
tmpfs.5: Document option pgread

Fixes: 765ad5b28d3f tmpfs: add the "pgread" mount option
MFC after: 7 days

(cherry picked from commit fade2298889d588c15705b44e336ff02cc96f956)

8 months agotmpfs.5: Sort option descriptions
Mateusz Piotrowski [Mon, 18 Sep 2023 19:31:24 +0000 (20:31 +0100)]
tmpfs.5: Sort option descriptions

MFC after:  3 days

(cherry picked from commit e69a5788273b4f531a49054e0238424826375633)

8 months agotmpfs.5: Keep the style of option descriptions consistent
Mateusz Piotrowski [Mon, 18 Sep 2023 19:29:42 +0000 (20:29 +0100)]
tmpfs.5: Keep the style of option descriptions consistent

MFC after: 3 days

(cherry picked from commit 0789d988a95eba5bd45fbe82a4ebd4dc7e957797)

8 months agotmpfs.5: Fix the use of Bl
Mateusz Piotrowski [Mon, 18 Sep 2023 19:24:22 +0000 (20:24 +0100)]
tmpfs.5: Fix the use of Bl

MFC after: 3 days

(cherry picked from commit adbc93c4cc862b6fc6e7992f6e8c78745d0d36eb)

8 months agoat.man: Move examples to the EXAMPLES section
Mateusz Piotrowski [Mon, 18 Sep 2023 19:17:52 +0000 (20:17 +0100)]
at.man: Move examples to the EXAMPLES section

MFC after: 3 days

(cherry picked from commit cd056e3cd4e421fd50245bb2aa6f989b23e861bc)

8 months agoat.man: Fix mdoc(7) macro usage
Mateusz Piotrowski [Mon, 18 Sep 2023 19:12:31 +0000 (20:12 +0100)]
at.man: Fix mdoc(7) macro usage

MFC after: 3 days

(cherry picked from commit d13b8b3e7255ad01b25ab512983af88d78fc1e53)

8 months agorc.conf.5: Pet mdoc linters
Mateusz Piotrowski [Mon, 18 Sep 2023 18:47:10 +0000 (19:47 +0100)]
rc.conf.5: Pet mdoc linters

MFC after: 3 days

(cherry picked from commit b7961dba30e60fb0d1a5383cf03e5ea2fd2ff607)

8 months agodaemon.8: Document -u sets HOME, USER, and SHELL
Mateusz Piotrowski [Mon, 18 Sep 2023 18:17:55 +0000 (19:17 +0100)]
daemon.8: Document -u sets HOME, USER, and SHELL

Fixes: 6b3ad1d73732 When -u option is used also set USER, HOME and SHELL
MFC after: 3 days

(cherry picked from commit c1207678f7ebd546a0705dabc3218e49abe06a99)

8 months agodaemon.8: Sort options in DESCRIPTION
Mateusz Piotrowski [Mon, 18 Sep 2023 18:40:23 +0000 (19:40 +0100)]
daemon.8: Sort options in DESCRIPTION

MFC after: 3 days

(cherry picked from commit ee23e1e49666e2c6edd0e5d749d3562587dcb9a7)

8 months agodaemon.8: Use Cm where appropriate
Mateusz Piotrowski [Mon, 18 Sep 2023 18:36:33 +0000 (19:36 +0100)]
daemon.8: Use Cm where appropriate

MFC after: 3 days

(cherry picked from commit a5bc8e8a5863c4aea5ed7ebe2ebc2332c287545c)

8 months agodaemon.8: Use Dv for signal names
Mateusz Piotrowski [Mon, 18 Sep 2023 18:28:27 +0000 (19:28 +0100)]
daemon.8: Use Dv for signal names

MFC after: 3 days

(cherry picked from commit 735637f7d68777d0befa4b9a9291f3fc02b5ed00)

8 months agobsdinstall.8: Document BSDINSTALL_SKIP_* variables
Mateusz Piotrowski [Mon, 18 Sep 2023 18:11:30 +0000 (19:11 +0100)]
bsdinstall.8: Document BSDINSTALL_SKIP_* variables

Fixes: 17f4ded55180 bsdinstall: add variables to allow skipping
MFC after: 3 days

(cherry picked from commit fea2cffb8659da1590401e04ce8cbf823c9da66c)

8 months agobsdinstall.8: Set Bl's -width correctly
Mateusz Piotrowski [Mon, 18 Sep 2023 17:49:57 +0000 (18:49 +0100)]
bsdinstall.8: Set Bl's -width correctly

MFC after: 3 days

(cherry picked from commit a8f5c9d3305feb8e846e2ebb6511e350c2702eca)

8 months agolibfido2: update to 1.13.0
Ed Maste [Tue, 19 Sep 2023 17:06:12 +0000 (13:06 -0400)]
libfido2: update to 1.13.0

Some highlights from NEWS entries:

 ** Improved OpenSSL 3.0 compatibility.
 ** Support for hidraw(4) on FreeBSD; gh#597.
 ** Improved support for FIDO 2.1 authenticators.

PR: 273596
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 2ccfa855b2fc331819953e3de1b1c15ce5b95a7e)
(cherry picked from commit 5bfbde817cdedbd7309c38a361cd1211bdcdd70e)

8 months agolibfido2: backport hidraw(4) support
Ed Maste [Tue, 19 Sep 2023 16:50:13 +0000 (12:50 -0400)]
libfido2: backport hidraw(4) support

PR: 273596
Submitted by: David Horn
Obtained from: libfido2 2c9dfaae2a56930160388700

(cherry picked from commit 1843dfb05ed80149f5a412180af882e3cb8f451b)
(cherry picked from commit 3df74eecfdecbafe55838b45141c275754d526bb)

8 months agoFix zfsd with the device_removal pool feature.
Alan Somers [Tue, 12 Sep 2023 01:20:39 +0000 (19:20 -0600)]
Fix zfsd with the device_removal pool feature.

Previously zfsd would crash in the presence of a pool with a
top-level-vdev that had previously been removed.  The crash happened
because the configuration nvlist of such a TLV contains an empty
ZPOOL_CONFIG_CHILDREN array, which led to a pop_front from an empty
list, which has undefined behavior.

The crash only happened in stable/14 and later, probably do to
differences in libcxx, but the change should be MFCed anyway.

PR: 273663
Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Sponsored by: Axcient
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D41818

(cherry picked from commit 0b294a386d34f6584848ed52407687df7ae59861)

8 months agoTag zfs-2.1.13
Tony Hutter [Tue, 12 Sep 2023 16:42:21 +0000 (09:42 -0700)]
Tag zfs-2.1.13

META file and changelog updated.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
8 months agoswapon.2: correct FreeBSD release that introduced swapoff
Ed Maste [Mon, 18 Sep 2023 09:01:38 +0000 (10:01 +0100)]
swapon.2: correct FreeBSD release that introduced swapoff

It was introduced in 92da00bb245b, after 5.0 and beforen 5.1.  Reported
in https://github.com/ziglang/zig/issues/16590.

(cherry picked from commit b15f6400376a90d3b00aa3ac00666f683f975376)
(cherry picked from commit f4bb052a789eae8ddcbfa7a9c00bc781b54e13c4)

8 months agofreebsd-update: do not restart sshd when updating jail/basedir
Ed Maste [Sat, 16 Sep 2023 20:46:16 +0000 (21:46 +0100)]
freebsd-update: do not restart sshd when updating jail/basedir

In 6cd1bc531609 for PR 263489 I changed freebsd-update to restart sshd
after upgrade, to avoid an upgrade-related incompatibility that made it
impossible to login.

This is intended to avoid losing access to remote hosts, and ought not
apply to upgrading jails (from outside).

PR: 263489, 272282
Reported by: otis
Reviewed by: otis, kevans
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Fixes: 6cd1bc531609 ("freebsd-update: restart sshd after upgrade")
Differential Revision: https://reviews.freebsd.org/D41890

(cherry picked from commit 8ee97b1928e75f7f81a870ffb063010778e0a129)
(cherry picked from commit cce342e21357833892083e865710c4a05603b7b5)

8 months agocheck-zstd-symbols: also ignore __pfx_ symbols
наб [Mon, 18 Sep 2023 16:08:41 +0000 (18:08 +0200)]
check-zstd-symbols: also ignore __pfx_ symbols

Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b341b20d648bb7e9a3307c33163e7399f0913e66
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #15282
Closes #15284

8 months agoCleanup: Replace oldstyle struct hack with C99 flexible array members
Richard Yao [Tue, 10 Jan 2023 20:44:35 +0000 (15:44 -0500)]
Cleanup: Replace oldstyle struct hack with C99 flexible array members

The Linux 5.16.14 kernel's coccicheck caught this. The semantic
patch that caught it was:

./scripts/coccinelle/misc/flexible_array.cocci

However, unlike the cases where the GNU zero length array extension had
been used, coccicheck would not suggest patches for the older style
single member arrays. That was good because blindly changing them would
break size calculations in most cases.

Therefore, this required care to make sure that we did not break size
calculations. In the case of `indirect_split_t`, we use
`offsetof(indirect_split_t, is_child[is->is_children])` to calculate
size. This might be subtly wrong according to an old mailing list
thread:

https://inbox.sourceware.org/gcc-prs/20021226123454.27019.qmail@sources.redhat.com/T/

That is because the C99 specification should consider the flexible array
members to start at the end of a structure, but compilers prefer to put
padding at the end. A suggestion was made to allow compilers to allocate
padding after the VLA like compilers already did:

http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/n983.htm

However, upon thinking about it, whether or not we allocate end of
structure padding does not matter, so using offsetof() to calculate the
size of the structure is fine, so long as we do not mix it with sizeof()
on structures with no array members.

In the case that we mix them and padding causes offsetof(struct_t,
vla_member[0]) to differ from sizeof(struct_t), we would be doing unsafe
operations if we underallocate via `offsetof()` and then overcopy via
sizeof().

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14372

8 months agolibc: use separate collate objects for C, POSIX, and C.UTF-8
Yuri Pankov [Tue, 28 Mar 2023 15:10:47 +0000 (17:10 +0200)]
libc: use separate collate objects for C, POSIX, and C.UTF-8

Fix newlocale() overwriting the locale name in collate object
when same instance was used for those locales, and querylocale()
reporting unexpected value for LC_COLLATE_MASK.

PR: 255646, 269375
Reviewed by: markj, bapt (previous version)
Differential Revision: https://reviews.freebsd.org/D30146

(cherry picked from commit 269dea90d6eb32690730b0f6a17fb41170483104)