FreeBSD/src 8b8ae24stand defs.mk

stand: Force disable RETPOLINE for boot loaders

Boot loaders do not require speculative execution protection, and may be
too large if enabled.

Reported by:    Shawn Webb
Reviewed by:    dim, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56068

(cherry picked from commit 61f78130c2f3a6abaa70bd66d6d6974060fb3d04)
DeltaFile
+1-0stand/defs.mk
+1-01 files

FreeBSD/src dc61491lib/msun/man fmax.3

fmax.3: Add caveat for going beyond C std requirements

libm's fmax and fmin family of functions treat +0.0 as greater than
-0.0.  This is not required by the C standard, so the user may not see
this behaviour due to compiler optimization.

PR:             294214
Reviewed by:    fuz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56230

(cherry picked from commit 7764e9ca28a9702aed4ba7391e055ec2fcf35c41)
(cherry picked from commit 855507463e0d3903d31aa7c084efbf4f819b5d63)
DeltaFile
+8-5lib/msun/man/fmax.3
+8-51 files

FreeBSD/src b06d6b9sys/kern kern_event.c

kqueue_fork_copy_knote(): zero kn_knlist for the copy before calling knlist_add()

Reported by:    pho, dhw
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit aab1ef4527f1b0935add3e8dba9e928e0623376f)
DeltaFile
+1-0sys/kern/kern_event.c
+1-01 files

FreeBSD/src c4266d8sbin/tunefs tunefs.c

tunefs: Better fix for arm64 alignment issues

Rather than trust that the compiler will lay out the stack frame the
way we expect it to, use a union to force the correct alignment.

MFC after:      1 week
Fixes:          616f47f176c3 ("tunefs: Fix alignment warning on arm64")
Reviewed by:    kevans, mckusick
Differential Revision:  https://reviews.freebsd.org/D56245

(cherry picked from commit 8244dd326265867293b2286efc3d571f06ef0dab)

tunefs: Fix pointer arithmetic

While here, remove a bogus const which has been there for years.

MFC after:      1 week
Reported by:    ivy@
Fixes:          1b83e8a3f840 ("Constify string pointers.")

    [5 lines not shown]
DeltaFile
+37-27sbin/tunefs/tunefs.c
+37-271 files

FreeBSD/src 84e7cd4sbin/tunefs tunefs.c

tunefs: Better fix for arm64 alignment issues

Rather than trust that the compiler will lay out the stack frame the
way we expect it to, use a union to force the correct alignment.

MFC after:      1 week
Fixes:          616f47f176c3 ("tunefs: Fix alignment warning on arm64")
Reviewed by:    kevans, mckusick
Differential Revision:  https://reviews.freebsd.org/D56245

(cherry picked from commit 8244dd326265867293b2286efc3d571f06ef0dab)

tunefs: Fix pointer arithmetic

While here, remove a bogus const which has been there for years.

MFC after:      1 week
Reported by:    ivy@
Fixes:          1b83e8a3f840 ("Constify string pointers.")

    [5 lines not shown]
DeltaFile
+37-27sbin/tunefs/tunefs.c
+37-271 files

FreeBSD/src e272f4acontrib/bmake main.c

Fix default for .MAKE.SAVE_DOLLARS

NetBSD make defaults this to "yes",
bmake defauts it to "no" to retain the traditional behavior.

The default is dealt with in bmake's Makefile but that does not
address boot-strap.

For now, just change the ifdef in main.

PR: 294436
DeltaFile
+1-1contrib/bmake/main.c
+1-11 files

FreeBSD/src 8555074lib/msun/man fmax.3

fmax.3: Add caveat for going beyond C std requirements

libm's fmax and fmin family of functions treat +0.0 as greater than
-0.0.  This is not required by the C standard, so the user may not see
this behaviour due to compiler optimization.

PR:             294214
Reviewed by:    fuz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56230

(cherry picked from commit 7764e9ca28a9702aed4ba7391e055ec2fcf35c41)
DeltaFile
+8-5lib/msun/man/fmax.3
+8-51 files

FreeBSD/src bc793adsbin/ifconfig ifgeneve.c

ifconfig: Fix printf on geneve for 32-bit architectures

Replace uint64_t type with uintmax_t in printf to fix warnings
on 32-bit architectures.

Reported by:    Jenkins
Fixes:          688e289ee904 ("ifconfig: Add support for geneve")
Differential Revision: https://reviews.freebsd.org/D55184
DeltaFile
+4-4sbin/ifconfig/ifgeneve.c
+4-41 files

FreeBSD/src 3b10806release Makefile.oracle, release/scripts/oracle image_capability_data.json generate_metadata.lua

release: remove Oracle Cloud Infrastructure build targets

Oracle's previous support is no longer available to the project.
Repeated attempts to find a sponsor within Oracle's cloud business
have not been successful.

The last published official images are from 15.0-RELEASE.

https://marketplace.oracle.com/app/freebsd-release

Relnotes:       yes
Sponsored by:   SkunkWerks, GmbH
Differential Revision:  https://reviews.freebsd.org/D56360
MFC after:      3 days
DeltaFile
+0-108release/Makefile.oracle
+0-105release/tools/oracle.conf
+0-96release/scripts/oracle/image_capability_data.json
+0-74release/scripts/oracle/generate_metadata.lua
+0-24release/scripts/oracle/arm64_shape_compatibilities.json
+0-21release/scripts/oracle/image_metadata.json
+0-4283 files not shown
+1-4359 files

FreeBSD/src 64c72d3sys/kern kern_event.c

kqueue: don't leak file refs on failure to knote_attach()

We'll subsequently just knote_free() since the knote is barely
constructed, but that bypasses any logic that might release references
on owned files/fops.  Defer clearing those until the knote actually owns
them and update the comment to draw the line more clearly.

Reviewed by:    kib

(cherry picked from commit 0bf4d22c37083170961c31694b90551538901a1c)
DeltaFile
+10-6sys/kern/kern_event.c
+10-61 files

FreeBSD/src 6706984lib/libc/gen memfd_create.c, lib/libc/sys shm_open.2

libc: fix memfd_create's HUGETLB handling

The 'simplification' commit referenced below actually broke one aspect
of MFD_HUGETLB: the caller isn't supposed to be required to specify a
size.  MFD_HUGETLB by itself without a shift mask just requests a large
page, so we revert that part of memfd_create() back.

While we're here, fix up the related parts of the manpages a little bit,
since MFD_HUGETLB is actually supported.  The manpage claims that we
would return ENOSYS if forced mappings weren't supported, but this was
actually not true.  However, that seems like a very important
distinction to make between ENOSYS and EOPNOTSUPP, so fix the
implementation to match the docs.

Reviewed by:    kib, markj

(cherry picked from commit 9a8d333368baef356f0a611b47ec592568dd14f9)
DeltaFile
+45-0tests/sys/posixshm/posixshm.h
+13-25tests/sys/posixshm/posixshm_test.c
+35-0tests/sys/posixshm/memfd_test.c
+27-4lib/libc/sys/shm_open.2
+16-7lib/libc/gen/memfd_create.c
+136-365 files

FreeBSD/src efab056sys/kern kern_event.c

kqueue: slightly clarify the flow in knlist_cleardel()

This is purely a cosmetic change to make it a little easier on the eyes,
rather than jumping back to the else branch up top.  Re-flow it to use
another loop on the outside and just inline the re-lock before we repeat
after awaking from fluxwait.

The !killkn path should maybe issue a wakeup if there's a thread in
KQ_SLEEP so that userland can observe the EOF, but this isn't a
practical problem today: pretty much every case of knlist_clear is tied
to a file descriptor and called in the close(2) path.  As a consequence,
potentially affected knotes are almost always destroyed before we even
get to knlist_clear().

Reviewed by:    kib, markj

(cherry picked from commit c6dd40f2d35d596ca60a5d87616c3e4a0fd4f676)
DeltaFile
+29-21sys/kern/kern_event.c
+29-211 files

FreeBSD/src 9ef671estand/lua core.lua core.lua.8

lualoader: allow the local module to filter out the BE list

This allows something like the following local.lua to install a filter
to implement its own notion of hidden BEs using a naming convention of
a leading dot to hide them:

-- file: /boot/lua/local.lua
local core = require("core")

local function be_hide(be)
    if core.isSingleUserBoot() then
        -- All BEs are accepted for single-user
        return true
    end

    local name = be:match("/([^/]+)$")
    if not name then
        -- Accept malformed BEs, for whatever reason
        return true

    [16 lines not shown]
DeltaFile
+18-2stand/lua/core.lua
+12-1stand/lua/core.lua.8
+30-32 files

FreeBSD/src 42a8f97sys/kern kern_event.c

kqueue: compare against the size in kqueue_expand

This is a cosmetic change, rather than a functional one: comparing the
knlistsize against the fd requires a little bit of mental gymnastics to
confirm that this is fine and not doing unnecessary work in some cases.

Notably, one must consider that kq_knlistsize only grows in KQEXTENT
chunks, which means that concurrent threads trying to grow the kqueue
to consecutive fds will usually not result in the list being replaced
twice.  One can also more clearly rule out classes of arithmetic
problems in the final `else` branch.

Reviewed by:    kib, markj

(cherry picked from commit 0b4f0e0515d0c7ec855cd654ae5dc562f4931cae)
DeltaFile
+6-4sys/kern/kern_event.c
+6-41 files

FreeBSD/src cdd2a1dsys/kern kern_event.c

kqueue: add some kn_knlist assertions around knlist_(add|remove)

We currently assert that kn_status is accurate, but there's more room
for error.  Neither of these are very likely, but currently we'd blow up
in SLIST*() macros instead of providing more obvious diagnostics.  It's
perhaps only worth testing these because knlist_remove() requires
getting logic across both f_attach() and f_detach() correct.

Reviewed by:    kib, markj

(cherry picked from commit 306c9049c642da6a59a5dc088589605a9aa38b87)
DeltaFile
+4-0sys/kern/kern_event.c
+4-01 files

FreeBSD/src f206751sys/kern kern_event.c

kqueue: simplify knote_fdclose()

The influx logic in knote_fdclose() is a little misguided, the resulting
wakeup() call should always be redundant: knote_drop_detached() will
always issue a wakeup before it returns, so anything waiting on *that*
knote that had entered fluxwait should have been woken up then.  This is
the obvious divergence from the other influx/wakeup pattern in the
implementation, which will kn_influx-- and then issue the wakeup after
it has processed all of the knotes it can make progress on.

While we're here, the kq_knlist cannot shrink, so we can avoid that
condition in the loop and avoid potentially excessive wakeups from
fluxwait on kqueues that we didn't touch.

Reviewed by:    kib, markj

(cherry picked from commit ff1050d2a366bd288a6ebbf63f98003272513f92)
DeltaFile
+12-10sys/kern/kern_event.c
+12-101 files

FreeBSD/src 58de791sys/arm64/arm64 locore.S

arm64: mte: configure initial state for system registers

The fields in SCTLR_EL1 and HCR_EL2 for enabling MTE are set, and if the
ID_AA64PFR1_EL1 register shows MTE is present, the GCR_EL1 register is
also configured, and the two TFSR registers which hold pending tag check
faults are cleared.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Signed-off-by:  Harry Moulton <harry.moulton at arm.com>
Differential Revision:  https://reviews.freebsd.org/D55946
DeltaFile
+16-1sys/arm64/arm64/locore.S
+16-11 files

FreeBSD/src 7e718b9sys/arm64/arm64 identcpu.c, sys/arm64/include armreg.h

arm64: mte: cleanup cache register definitions

Cleanup the definitions in armreg.h for the CSSIDR_EL1, CLIDR_EL1 and
CSSELR_EL1 system register to prepare for additional bitfeilds for
Memory Tagging Extension (MTE).

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Signed-off-by:  Harry Moulton <harry.moulton at arm.com>
Differential Revision:  https://reviews.freebsd.org/D55944
DeltaFile
+74-19sys/arm64/include/armreg.h
+4-4sys/arm64/arm64/identcpu.c
+78-232 files

FreeBSD/src 5809584sys/arm64/arm64 pmap.c

arm64: Handle changing self-referential DMAP pages

Support changing the property of a DMAP page that holds it's own page
table entry.

Because we need to perform a break-before-make sequence to change the
properties of pages a page that also holds it's own page table entry
will fault in the make part of the sequence.

Handle this by mapping the page with a temporary mapping as we already
do when demoting a superpage.

Reviewed by:    kib
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D55943
DeltaFile
+26-0sys/arm64/arm64/pmap.c
+26-01 files

FreeBSD/src aa555b6sys/arm64/include armreg.h hypervisor.h

arm64: mte: add system register definitions

Add system register and bit field definitions for Memory Tagging
Extension (MTE) in ARMv8.5.

Reviewed by:    andrew
Sponsored by:   Arm Ltd
Signed-off-by:  Harry Moulton <harry.moulton at arm.com>
Co-authored-by: Andrew Turner <andrew at FreeBSD.org>
Differential Revision:  https://reviews.freebsd.org/D55945
DeltaFile
+94-2sys/arm64/include/armreg.h
+24-0sys/arm64/include/hypervisor.h
+118-22 files

FreeBSD/src c208439sys/arm64/arm64 pmap.c

arm64: Add a cmap page to pmap

When modifying mappings in pmap we may need to perform a
break-before-make sequence. This creates an invalid mapping, then
recreates it with the changes.

When modifying DMAP mappings we may be changing the mapping that
contains its own page table then after breaking the old entry we are
unable to create the new entry.

To fix this create a map that can be used & won't be affected by the
break-before-make sequence.

Reviewed by:    kib
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D56306
DeltaFile
+18-1sys/arm64/arm64/pmap.c
+18-11 files

FreeBSD/src b0ef03fsbin/ifconfig ifconfig.8

ifconfig.8: Add geneve(4) parameters

Add geneve parameters to ifconfig manual.

Reviewed by:    ziaee
Differential Revision: https://reviews.freebsd.org/D55181
DeltaFile
+112-1sbin/ifconfig/ifconfig.8
+112-11 files

FreeBSD/src adecd4cshare/man/man4 geneve.4 Makefile

geneve.4: Add geneve manual

Reviewed by: ziaee, adrian
Differential Revision: https://reviews.freebsd.org/D55182
DeltaFile
+384-0share/man/man4/geneve.4
+2-0share/man/man4/Makefile
+386-02 files

FreeBSD/src aa9f669tests/ci/tools ci.conf, tests/sys/net if_geneve.sh Makefile

geneve: Add tests for geneve

Add tests for each combinations of geneve modes, address families
and multicast.

Differential Revision: https://reviews.freebsd.org/D55183
DeltaFile
+1,000-0tests/sys/net/if_geneve.sh
+1-0tests/sys/net/Makefile
+1-0tests/ci/tools/ci.conf
+1,002-03 files

FreeBSD/src 688e289lib/libifconfig libifconfig.c, sbin/ifconfig ifgeneve.c Makefile

ifconfig: Add support for geneve (netlink)

This implementation is netlink only

Differential Revision: https://reviews.freebsd.org/D55184
DeltaFile
+889-0sbin/ifconfig/ifgeneve.c
+3-1lib/libifconfig/libifconfig.c
+1-0sbin/ifconfig/Makefile
+893-13 files

FreeBSD/src e44d2e9sys/modules/if_geneve Makefile, sys/net if_geneve.c if_geneve.h

if_geneve: Add Support for Geneve (RFC8926)

geneve creates a generic network virtualization tunnel interface
for Tentant Systems over an L3 (IP/UDP) underlay network that provides
a Layer 2 (ethernet) or Layer 3 service using the geneve protocol.
This implementation is based on RFC8926.

Reviewed by:    glebius, adrian
Discussed with: zlei, kp
Relnotes:       yes
Differential Revision: https://reviews.freebsd.org/D54172
DeltaFile
+3,967-0sys/net/if_geneve.c
+70-0sys/net/if_geneve.h
+44-0sys/netlink/route/interface.h
+9-3sys/net/if_strings.h
+7-0sys/modules/if_geneve/Makefile
+5-1sys/net/if.h
+4,102-47 files not shown
+4,115-713 files

FreeBSD/src eb5165bcontrib/libarchive/cpio cpio.c, contrib/libarchive/libarchive/test test_read_format_iso_zisofs_overflow.iso.uu test_read_format_rar5_loop_bug.rar.uu

libarchive: merge from vendor branch

libarchive 3.8.7

Important bugfixes:
 #2871 libarchive: fix handling of option failures
 #2897 iso9660: fix undefined behavior
 #2898 RAR: fix LZSS window size mismatch after PPMd block
 #2900 CAB: fix NULL pointer dereference during skip
 #2911 libarchive: do not continue with truncated numbers
 #2919 CAB: Fix Heap OOB Write in CAB LZX decoder
 #2934 iso9660: fix posibble heap buffer overflow on 32-bit systems
 #2939 cpio: Fix -R memory leak
 #2947 libarchive: lzop and grzip filter support

Important bugfixes between 3.8.5 and 3.8.6:
 #2860 bsdunzip: fix ISO week year and Gregorian year confusion
 #2864 7zip: ix SEGV in check_7zip_header_in_sfx via ELF offset validation
 #2875 7zip: fix out-of-bounds access on ELF 64-bit header

    [12 lines not shown]
DeltaFile
+1,096-0contrib/libarchive/libarchive/test/test_read_format_iso_zisofs_overflow.iso.uu
+189-0contrib/libarchive/libarchive/test/test_read_format_rar5_loop_bug.rar.uu
+135-0contrib/libarchive/libarchive/test/test_archive_string_conversion.c
+67-56contrib/libarchive/cpio/cpio.c
+104-0contrib/libarchive/libarchive/test/test_read_format_iso_zisofs_overflow.c
+95-0contrib/libarchive/libarchive/test/test_read_format_cab_skip_malformed.cab.uu
+1,686-5691 files not shown
+3,107-46097 files

FreeBSD/src f2cd95acpio cpio.c, libarchive/test test_read_format_iso_zisofs_overflow.iso.uu test_read_format_rar5_loop_bug.rar.uu

Update vendor/libarchive to 3.8.7

Important bugfixes between 3.8.6 and 3.8.7:
 #2871 libarchive: fix handling of option failures
 #2897 iso9660: fix undefined behavior
 #2898 RAR: fix LZSS window size mismatch after PPMd block
 #2900 CAB: fix NULL pointer dereference during skip
 #2911 libarchive: do not continue with truncated numbers
 #2919 CAB: Fix Heap OOB Write in CAB LZX decoder
 #2934 iso9660: fix posibble heap buffer overflow on 32-bit systems
 #2939 cpio: Fix -R memory leak
 #2947 libarchive: lzop and grzip filter support

Important bugfixes between 3.8.5 and 3.8.6:
 #2860 bsdunzip: fix ISO week year and Gregorian year confusion
 #2864 7zip: ix SEGV in check_7zip_header_in_sfx via ELF offset validation
 #2875 7zip: fix out-of-bounds access on ELF 64-bit header
 #2877 RAR5 reader: fix infinite loop in rar5 decompression
 #2878 mtree reader: Fix file descriptor leak in mtree parser cleanup

    [9 lines not shown]
DeltaFile
+1,096-0libarchive/test/test_read_format_iso_zisofs_overflow.iso.uu
+189-0libarchive/test/test_read_format_rar5_loop_bug.rar.uu
+135-0libarchive/test/test_archive_string_conversion.c
+67-56cpio/cpio.c
+104-0libarchive/test/test_read_format_iso_zisofs_overflow.c
+95-0libarchive/test/test_read_format_cab_skip_malformed.cab.uu
+1,686-56104 files not shown
+3,151-489110 files

FreeBSD/src 26740e8sys/compat/linux linux_ioctl.c linux_ioctl.h, sys/dev/iicbus iic.c iic.h

compat/linux: Add Linux i2c-dev ioctl compatibility support

Implement Linux I2C ioctl translation in the Linux compatibility layer
and wire iicbus cdevs up for in-kernel rdwr handling.
Support common i2c-dev requests including SLAVE, FUNCS, and RDWR,
while rejecting unsupported 10-bit and SMBus operations.

Signed-off-by:  YAO, Xin <mr.yaoxin at outlook.com>
Reviewed by:    imp, adrian, pouria
Differential Revision: https://reviews.freebsd.org/D56251
DeltaFile
+115-0sys/compat/linux/linux_ioctl.c
+35-4sys/dev/iicbus/iic.c
+24-0sys/compat/linux/linux_ioctl.h
+8-0sys/dev/iicbus/iic.h
+182-44 files

FreeBSD/src 58718cfsys/vm vm_fault.c

vm_fault: Reset m_needs_zeroing properly

- When allocating a page, we should only consider the PG_ZERO flag when
  handling the top-level page.
- Unconditionally reset the flag when restarting the fault handler.
  Previously, vm_fault_busy_sleep() would fail to reset it.

PR:             294039
Reviewed by:    kib
Tested by:      Peter Much <pmc at citylink.dinoex.sub.org>
MFC after:      3 days
Fixes:          cff67bc43df1 ("vm_fault: only rely on PG_ZERO when the page was newly allocated")
Differential Revision:  https://reviews.freebsd.org/D56234

(cherry picked from commit 04132e01004316ddd0e0cde6ef15b100b7b1844d)
DeltaFile
+3-4sys/vm/vm_fault.c
+3-41 files