FreeBSD/src 46b606cstand/userboot/test test.c

userboot: support environment and symlinks in test application

Pass the environment on to the loader.
Also define USERBOOT=1 in the environment varables.

Add support for symlinks in the test application open callback.

stat the root directory when opening file
Without this, running "ls" command on the root directory encounters
issues getting the directory listing.

Reviewed by:    jhb
Obtained from:  Juniper Networks, Inc.
Differential Revision:  https://reviews.freebsd.org/D44625
DeltaFile
+168-42stand/userboot/test/test.c
+168-421 files

FreeBSD/src 2cb4909sys/kern kern_cons.c subr_boot.c, sys/sys cons.h reboot.h

cons: Add boot option to mute boot messages after banner

This is useful for embedded systems, where it provides feedback that the
kernel has booted, but avoids printing the probe messages.  If both
mutemsgs and verbose are set, verbose cancels the mute.

Additionally, this unmutes the console on panic, so a user can see what
happened leading up to the panic.

Obtained from:  Juniper Networks, Inc.
DeltaFile
+13-1sys/kern/kern_cons.c
+4-2sys/kern/subr_boot.c
+3-0sys/kern/kern_shutdown.c
+2-0sys/sys/cons.h
+1-0sys/sys/reboot.h
+23-35 files

FreeBSD/src 21aba39sys/dev/cxgbe t4_main.c

cxgbe(4): Minor tweaks to comments.

No functional change intended.

MFC after:      1 week
Sponsored by:   Chelsio Communications
DeltaFile
+7-5sys/dev/cxgbe/t4_main.c
+7-51 files

FreeBSD/src 9de0036sys/dev/cxgbe t4_main.c, sys/dev/cxgbe/common t4_hw.c

cxgbe(4): Initialize mps_bg_map to an invalid value if it's not known.

MFC after:      1 week
Sponsored by:   Chelsio Communications
DeltaFile
+1-1sys/dev/cxgbe/common/t4_hw.c
+1-1sys/dev/cxgbe/t4_main.c
+2-22 files

FreeBSD/src 4d1362csys/dev/cxgbe/common t4_hw.c

cxgbe(4): Do not read hardware registers to determine the number of ports.

PORTVEC obtained from the firmware is the authoritative source of this
information, and nports (calculated from PORTVEC) is available by the
time t4_port_init runs.

MFC after:      1 week
Sponsored by:   Chelsio Communications
DeltaFile
+7-6sys/dev/cxgbe/common/t4_hw.c
+7-61 files

FreeBSD/src 13a5a46sys/compat/linux linux_socket.c, sys/dev/md md.c

Fix new users of MAXPHYS and hide it from the kernel namespace

In cd8537910406, kib made maxphys a load-time tunable.  This made
the #define MAXPHYS in sys/param.h  almost entirely obsolete, as
it could now be overridden by kern.maxphys at boot time, or by
opt_maxphys.h.

However, decades of tradition have led to several new, incorrect, uses
of MAXPHYS in other parts of the kernel, mostly by seasoned
developers.  I've corrected those uses here in a mechanical fashion,
and verified that it fixes a bug in the md driver that I was
experiencing.

Since using MAXPHYS is such an easy mistake to make, it is best to
hide it from the kernel namespace.  So I've moved its definition to
_maxphys.h, which is now included in param.h only for userspace.

That brings up the fact that lots of userspace programs use MAXPHYS
for different reasons, most of them probably wrong.  Userspace consumers

    [8 lines not shown]
DeltaFile
+10-0sys/sys/_maxphys.h
+1-7sys/sys/param.h
+3-3sys/dev/md/md.c
+2-2sys/dev/rtsx/rtsx.c
+1-1sys/compat/linux/linux_socket.c
+1-0sys/kern/subr_param.c
+18-136 files

FreeBSD/src 857d74bsys/dev/cxgbe t4_sge.c t4_main.c

cxgbe(4): Allocate a taskqueue per port instead of per channel.

All the channels are not used on all boards and there's no point
allocating taskqueues that will never be used.

MFC after:      1 week
Sponsored by:   Chelsio Communications
DeltaFile
+10-9sys/dev/cxgbe/t4_sge.c
+5-2sys/dev/cxgbe/t4_main.c
+2-1sys/dev/cxgbe/adapter.h
+17-123 files

FreeBSD/src 397d8f3lib/libsys Symbol.map

libsys: don't try to expose freebsd7___semctl

This has always been in libc and never exported directly.  I accidently
included it along side some freebsd11_* symbols based on a tree where I
moved semctl(2).

Fixes:          df1a09ba524d0 libsys: expose a few more symbols for libc's use
DeltaFile
+0-1lib/libsys/Symbol.map
+0-11 files

FreeBSD/src 21b5829libexec/tftpd tftpd.c

tftpd: Untangle a conditional.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D45026
DeltaFile
+5-4libexec/tftpd/tftpd.c
+5-41 files

FreeBSD/src 661a83fsys/vm vm_glue.c

vm: Fix error handling in vm_thread_stack_back()

vm_object_page_remove() wants to busy the page, but that won't work
here.  (Kernel stack pages are always busy.)

Make the error handling path look more like vm_thread_stack_dispose().

Reported by:    pho
Reviewed by:    kib, bnovkov
Fixes:  7a79d0669761 ("vm: improve kstack_object pindex calculation to avoid pindex holes")
Differential Revision:  https://reviews.freebsd.org/D45019
DeltaFile
+5-1sys/vm/vm_glue.c
+5-11 files

FreeBSD/src 9b30b96etc/mtree BSD.var.dist, libexec/phttpget phttpget.8

Remove remnants of portsnap(8)

This was prompted by noticing that '/var/db/portsnap' still exists on
newly-installed machines.

With this change, all mentions of portsnap(8) in the tree are gone,
except for the historical note in the AUTHORS section of manpage
phttpget(8).

locate(1) will thus start indexing again '/var/db/portsnap' on machines
where this directory still exists, which may be a good way to push
administrators to delete it.

Reviewed by:            cperciva
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D45023
DeltaFile
+4-7libexec/phttpget/phttpget.8
+4-4usr.sbin/freebsd-update/freebsd-update.sh
+3-3tools/regression/iscsi/initiator-instructions.txt
+1-1usr.bin/locate/locate/locate.rc
+1-1usr.bin/locate/locate/updatedb.sh
+0-2etc/mtree/BSD.var.dist
+13-186 files

FreeBSD/src c0b58e6contrib/libarchive/libarchive archive_string.c archive_match.c, contrib/libarchive/unzip/test test_I.c

libarchive: merge bugfixes from vendor branch

 #2147 archive_string: clean up strncat_from_utf8_to_utf8 (36047967a)
 #2153 archive_match: check archive_read_support_format_raw()
       return value (0ce1b4c38)
 #2154 archive_match: turn counter into flag (287e05d53)
 #2155 lha: Do not allow negative file sizes (93b11caed)
 #2156 tests: setenv LANG to en_US.UTF-8 in bsdunzip test_I.c (83e8b0ea8)

MFC after:      3 days
DeltaFile
+42-54contrib/libarchive/libarchive/archive_string.c
+9-9contrib/libarchive/libarchive/archive_match.c
+8-0contrib/libarchive/unzip/test/test_I.c
+2-0contrib/libarchive/libarchive/archive_read_support_format_lha.c
+61-634 files

FreeBSD/src ed3e988libarchive archive_string.c archive_match.c, unzip/test test_I.c

Update vendor/libarchive to libarchive master 83e8b0ea8

 #2147 archive_string: clean up strncat_from_utf8_to_utf8 (36047967a)
 #2153 archive_match: check archive_read_support_format_raw()
       return value (0ce1b4c38)
 #2154 archive_match: turn counter into flag (287e05d53)
 #2155 lha: Do not allow negative file sizes (93b11caed)
 #2156 tests: setenv LANG to en_US.UTF-8 in bsdunzip test_I.c (83e8b0ea8)

Obtained from:          libarchive
Libarchive commit:      83e8b0ea8c3b07e07ac3dee90a8724565f8e53fd
DeltaFile
+42-54libarchive/archive_string.c
+9-9libarchive/archive_match.c
+8-0unzip/test/test_I.c
+2-0libarchive/archive_read_support_format_lha.c
+61-634 files

FreeBSD/src b91f295sys/conf files.arm64

arm64: Check for virtio for scmi_virtio.c

scmi_virtio.c depends on virtio. Check for this before including it in
the kernel.

Reported by:    Isaac Cilia Attard (via cperciva)
Sponsored by:   Arm Ltd
DeltaFile
+1-1sys/conf/files.arm64
+1-11 files

FreeBSD/src 5b3e5c6sys/kern sys_generic.c

kcmp_pget(): do not accept TIDs

Otherwise pget() might still look up and hold the current process.

Reported and tested by: pho
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+2-1sys/kern/sys_generic.c
+2-11 files

FreeBSD/src 1e01650sys/kern sys_generic.c

kcmp_pget(): add an assert that we did not hold the current process

Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+5-1sys/kern/sys_generic.c
+5-11 files

FreeBSD/src 8774c92contrib/libarchive/libarchive archive_write_set_passphrase.c archive_read_support_format_rar.c, contrib/libarchive/libarchive/test test_write_disk_appledouble.c test_read_format_xar_doublelink.c

libarchive: merge from vendor branch

Libarchive 3.7.4 + three fixes from master

Security fixes:
 #2135 rar: Fix OOB in rar e8 filter (CVE-2024-26256)
 #2145 zip: Fix out of boundary access
 #2148 rar: Fix OOB in rar delta filter
 #2149 rar: Fix OOB in rar audio filter

Important bugfixes:
 #2131 7zip: Limit amount of properties
 #2110 bsdtar: Fix error handling around strtol() usages
 #2116 passphrase: Never allow empty passwords
 #2124 rar: Fix "File CRC Error" when extracting specific rar4 archives
 #2123 xar: Avoid infinite link loop
 #2150 xar: Fix another infinite loop and expat error handling
 #2108 zip: Update AppleDouble support for directories
 #2071 zstd: Implement core detectiongit

    [2 lines not shown]
DeltaFile
+84-0contrib/libarchive/libarchive/test/test_write_disk_appledouble.c
+29-34contrib/libarchive/tar/bsdtar.c
+55-0contrib/libarchive/libarchive/test/test_read_format_xar_doublelink.c
+18-17contrib/libarchive/libarchive/archive_write_set_passphrase.c
+29-1contrib/libarchive/libarchive/archive_read_support_format_rar.c
+27-0contrib/libarchive/libarchive/test/test_write_disk_appledouble_zip.zip.uu
+242-5229 files not shown
+403-10935 files

FreeBSD/src 3cf9a50lib/libarchive/tests Makefile

libarchive: add two missing package files to libarchive tests

(cherry picked from commit 7d03ec330684a4e82e6113df3f40305849e5fb6c)
DeltaFile
+2-0lib/libarchive/tests/Makefile
+2-01 files

FreeBSD/src 2d92e58contrib/libarchive/libarchive/test test_compat_lzip.c

libarchive: fix null format string error in tests (unbreaks gcc13 build)

Obtained from:  libarchive (d43c39247)

(cherry picked from commit 701d0666c03dacba9b73d91dff2a6140e157bdc4)
DeltaFile
+0-1contrib/libarchive/libarchive/test/test_compat_lzip.c
+0-11 files

FreeBSD/src d253927contrib/libarchive/libarchive archive_read_support_format_zip.c archive_write_set_format_zip.c, contrib/libarchive/libarchive/test test_compat_lzip_4.tlz.uu test_compat_lzip_3.lz.uu

libarchive: merge from vendor branch

Libarchive 3.7.3

New features:
  #1941 uudecode filter: support file name and file mode in raw mode
  #1943 7-zip reader: translate Windows permissions into UNIX
        permissions
  #1962 zstd filter now supports the "long" write option
  #2012 add trailing letter b to bsdtar(1) substitute pattern
  #2031 PCRE2 support
  #2054 add support for long options "--group" and "--owner" to tar(1)

Security fixes:
  #2101 Fix possible vulnerability in tar error reporting introduced
        in f27c173

Important bugfixes:
  #1974 ISO9660: preserve the natural order of links

    [7 lines not shown]
DeltaFile
+1,474-0contrib/libarchive/libarchive/test/test_compat_lzip_4.tlz.uu
+1,461-0contrib/libarchive/libarchive/test/test_compat_lzip_3.lz.uu
+325-174contrib/libarchive/libarchive/archive_read_support_format_zip.c
+276-0contrib/libarchive/libarchive/test/test_write_format_zip64_stream.c
+247-0contrib/libarchive/libarchive/test/test_write_format_zip_stream.c
+115-78contrib/libarchive/libarchive/archive_write_set_format_zip.c
+3,898-252719 files not shown
+5,753-1,753725 files

FreeBSD/src 11d79c4sys/compat/linuxkpi/common/include/linux aperture.h, sys/compat/linuxkpi/common/src linux_aperture.c linuxkpi_videokmod.c

linuxkpi: Add linuxkpi_video module

This contain the hdmi code and the aperture code like in linux.

Differential Revision:  https://reviews.freebsd.org/D44925
Reviewed by:            bz
Obtained from:          drm-kmod
Sponsored by:           Beckhoff Automation GmbH & Co. KG
DeltaFile
+365-0sys/compat/linuxkpi/common/src/linux_aperture.c
+58-0sys/compat/linuxkpi/common/include/linux/aperture.h
+15-0sys/modules/linuxkpi_video/Makefile
+7-0sys/compat/linuxkpi/common/src/linuxkpi_videokmod.c
+1-0sys/modules/Makefile
+446-05 files

FreeBSD/src 7f84bb3sys/compat/linuxkpi/common/src linux_hdmi.c linuxkpi_hdmikmod.c, sys/modules/linuxkpi_hdmi Makefile

linuxkpi: hdmi: Split the module declaration to a new file

In order to have a proper linuxkpi_video kmod, move the module declaration
to a new file as linuxkpi_video will also include linux_hdmi.c

Differential Revision:  https://reviews.freebsd.org/D44926
Reviewed by:            bz, emaste, wulf
Sponsored by:           Beckhoff Automation GmbH & Co. KG
DeltaFile
+0-10sys/compat/linuxkpi/common/src/linux_hdmi.c
+7-0sys/compat/linuxkpi/common/src/linuxkpi_hdmikmod.c
+1-0sys/modules/linuxkpi_hdmi/Makefile
+8-103 files

FreeBSD/src 5098196lib/libc/include libc_private.h

libc_private.h: use private namespace name for size_t

This is direct commit to stable/13.

(cherry picked from commit a951992d1eb332ed1e97ef6b89ead3f05707adc2)
DeltaFile
+1-1lib/libc/include/libc_private.h
+1-11 files

FreeBSD/src a951992lib/libc/include libc_private.h

libc_private.h: use private namespace name for size_t

This is direct commit to stable/14.
DeltaFile
+1-1lib/libc/include/libc_private.h
+1-11 files

FreeBSD/src f0e8600lib/libc/stdio xprintf_errno.c

libc printf_render_errno(): do not use strerror()

(cherry picked from commit aa66995b4c804cbb579f71645d97fe282a798bfc)
DeltaFile
+4-3lib/libc/stdio/xprintf_errno.c
+4-31 files

FreeBSD/src 27e54c9lib/libc/stdio vfprintf.c

__vprintf(): switch from strerror() to strerror_rl()

PR:     278556

(cherry picked from commit f887667694632c829b0599b54ff86a072e93df87)
DeltaFile
+5-1lib/libc/stdio/vfprintf.c
+5-11 files

FreeBSD/src fcac864lib/libc/stdio xprintf_errno.c

libc: minor style, wrap long lines

(cherry picked from commit bac9d7e8f2931149815c3d5a9ab69594bbdffde6)
DeltaFile
+4-2lib/libc/stdio/xprintf_errno.c
+4-21 files

FreeBSD/src a8ae94blib/libc/include libc_private.h, lib/libc/string strerror.c

libc: make strerror_rl() usable for libc

(cherry picked from commit 92771bc00ad0f567b27876c34450bef7a0ee61d0)
DeltaFile
+5-5lib/libc/string/strerror.c
+2-0lib/libc/include/libc_private.h
+7-52 files

FreeBSD/src 0451d42lib/libc/stdio xprintf_errno.c

libc: minor style, wrap long lines

(cherry picked from commit bac9d7e8f2931149815c3d5a9ab69594bbdffde6)
DeltaFile
+4-2lib/libc/stdio/xprintf_errno.c
+4-21 files

FreeBSD/src ade62d4lib/libc/stdio vfprintf.c

__vprintf(): switch from strerror() to strerror_rl()

PR:     278556

(cherry picked from commit f887667694632c829b0599b54ff86a072e93df87)
DeltaFile
+5-1lib/libc/stdio/vfprintf.c
+5-11 files