FreeBSD/src 8ceac8eusr.bin/script script.c script.1

script: handle terminal resize on SIGWINCH

Add a -w flag to forward terminal resize events on to the child, which
can be useful in some circumstances to avoid terminal corruption.

Reviewed by:    des
Co-authored-by: Xavier Beaudouin <xavier.beaudouin at klarasystems.com>
Sponsored by:   Modirum MDPay
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D44167
DeltaFile
+54-8usr.bin/script/script.c
+4-1usr.bin/script/script.1
+58-92 files

FreeBSD/src 4459abeusr.bin/script script.c

script: minor style improvements

Fix some nits pointed out by checkstyle9.pl in advance of functional
changes to script(1).

Reviewed by:    des
Sponsored by:   Modirum MDPay
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D44167
DeltaFile
+10-8usr.bin/script/script.c
+10-81 files

FreeBSD/src 7b390cbbin/date date.c

date: Fix tests by initializing timespec structure

The tests related to nanosecond support were failing on amd64 due to
uninitialized timespec structure.

Fixes:          eeb04a736cb9 date: Add support for nanoseconds
Reviewed by:    markj
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D44975
DeltaFile
+2-0bin/date/date.c
+2-01 files

FreeBSD/src d6f77d3libarchive archive_write_set_passphrase.c archive_write_add_filter_zstd.c, libarchive/test test_write_disk_appledouble.c test_read_format_xar_doublelink.c

Update vendor/libarchive to 3.7.4

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

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
 #2108 zip: Update AppleDouble support for directories
 #2071 zstd: Implement core detection

Obained from:           libarchive
Libarchive commit:      313aa1fa10b657de791e3202c168a6c833bc3543
DeltaFile
+84-0libarchive/test/test_write_disk_appledouble.c
+29-34tar/bsdtar.c
+55-0libarchive/test/test_read_format_xar_doublelink.c
+18-17libarchive/archive_write_set_passphrase.c
+27-0libarchive/test/test_write_disk_appledouble_zip.zip.uu
+22-1libarchive/archive_write_add_filter_zstd.c
+235-5242 files not shown
+436-13548 files

FreeBSD/src 5626f9eshare/man/man9 style.9

style.9: Document the existence of tools/build/checkstyle9.pl

MFC after:      3 days
Sponsored by:   Klara, Inc.
DeltaFile
+5-1share/man/man9/style.9
+5-11 files

FreeBSD/src eeb04a7bin/date date.c date.1, bin/date/tests format_string_test.sh

date: Add support for nanoseconds

This patch introduces support for a conversion specification for
nanoseconds.

The format of %N is meant to be compatible with that of GNU date.

The nanoseconds conversion specification is implemented directly in
date(1) instead of libc (in strftime(3)) to avoid introducing
non-standard functions to libc at this time and modifying struct tm.

Apart from introducing the nanoseconds conversion specification, this
patch brings the following changes:

- The "ns" format for ISO 8061 dates is now unlocked. E.g., date -Ins
  prints:
      2024-04-22T12:20:28,763742224+02:00
- The -r flag when fed a file is now aware of the nanosecond part of the last
  modification time.

    [9 lines not shown]
DeltaFile
+105-27bin/date/date.c
+22-6bin/date/date.1
+15-2bin/date/tests/format_string_test.sh
+142-353 files

FreeBSD/src 9b10aa4tools/test/stress2/misc rdwr.sh

stress2: More detailed error reporting
DeltaFile
+33-17tools/test/stress2/misc/rdwr.sh
+33-171 files

FreeBSD/src 6251027sys/fs/nfsclient nfs_clrpcops.c

nfscl: Do not use nfso_own for delayed nfsrpc_doclose()

When an initial attempt to close an NFSv4 lock returns NFSERR_DELAY,
the open structure is put on a list for delayed closing.  When this
is done, the nfso_own field is set to NULL, so it cannot be used by
nfsrpc_doclose().

Without this patch, the NFSv4 client can crash when a NFSv4 server
replies NFSERR_DELAY to a Close operation.  Fortunately, most extant
NFSv4 servers do not do this.  This patch avoids the crash for any
that do return NFSERR_DELAY for Close.

Found during a IETF bakeathon testing event this week.

MFC after:      5 days
DeltaFile
+14-6sys/fs/nfsclient/nfs_clrpcops.c
+14-61 files

FreeBSD/src f0e59ecsys/cam/ctl ctl_cmd_table.c

CTL: READ(6) should be allowed on CD devices

DOS ASPI drivers use this, with this change applied it is possible to
load a DOS ASPI CDROM driver and run the Windows 98 installer.

Signed-off-by: HP van Braam <hp at tmm.cx>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1202
DeltaFile
+1-0sys/cam/ctl/ctl_cmd_table.c
+1-01 files

FreeBSD/src ce3b53fsbin/nvmecontrol nvmecontrol.8

nvmecontrol: Flesh out nvmecontrol format information

The format command takes a number of different parameters. Include a
brief summary of what the values mean, though since the driver's support
for metadata is at best weak, 0's are almost always used for values
other than -f format. Add an example that ties it all together.

Sponsored by:           Netflix
Reviewed by:            pauamma at gundo.com, chuck
Differential Revision:  https://reviews.freebsd.org/D44958
DeltaFile
+70-11sbin/nvmecontrol/nvmecontrol.8
+70-111 files

FreeBSD/src 9245cedrelease/arm64 RPI.conf

release: remove the RPI CM4s .dtb

This isn't actually packaged by the sysutils/rpi-firmware port, so we
cannot include it in the image.  Fix the RPI release build until an
interested party adds it to the port and packages are available.

Reported by:    cperciva
DeltaFile
+1-1release/arm64/RPI.conf
+1-11 files

FreeBSD/src 68cbb07share/mk src.opts.mk, sys/conf kern.opts.mk config.mk

Revert "config.mk: Add MK_VIMAGE knob"

This commit broke "make makeman" checks in github CI due to a lack of
option description files.  The split between VIMAGE and VIMAGE_SUPPORT
is not clearly justified and the code is broken because there is no
opt_vimage.h (it's in opt_global.h).

This reverts commit 22ca6db50f4e6bd75a141f57cf953d8de6531a06.
DeltaFile
+1-3sys/conf/kern.opts.mk
+0-2share/mk/src.opts.mk
+0-2sys/conf/config.mk
+1-73 files

FreeBSD/src 8efba70sys/fs/nfsclient nfs_clrpcops.c nfs_clstate.c

nfscl: Revert part of commit 196787f79e67

Commit 196787f79e67 erroneously assumed that the client code for
Open/Claim_deleg_cur_FH was broken, but it was not.
It was actually wireshark that was broken and indicated
that the correct XDR was bogus.

This reverts the part of 196787f79e67 that changed the arguments for
Open/Claim_deleg_cur_FH.

Found during the IETF bakeathon testing event this week.

MFC after:      3 days
DeltaFile
+10-23sys/fs/nfsclient/nfs_clrpcops.c
+1-22sys/fs/nfsclient/nfs_clstate.c
+0-1sys/fs/nfsclient/nfsmount.h
+11-463 files

FreeBSD/src 7ab7ecflibexec/tftpd/tests functional.c

tftpd: Clean up the tests.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D44955
DeltaFile
+128-125libexec/tftpd/tests/functional.c
+128-1251 files

FreeBSD/src 9f231aflibexec/tftpd tftpd.c, libexec/tftpd/tests functional.c

tftpd: Immediately reject any request shorter than 4 bytes.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D44957
DeltaFile
+19-0libexec/tftpd/tests/functional.c
+5-0libexec/tftpd/tftpd.c
+24-02 files

FreeBSD/src 83a6e98libexec/tftpd/tests functional.c

tftpd: Check the server status after each test.

* In the setup phase, wait for the server to start (or fail to start)
  before proceeding with the test.  This makes it possible to write test
  cases that don't expect a response from the server without ending up
  in a race over the server PID file.
* After running each test, wait up to 30 seconds for the server to exit
  and check that the exit status matches what the test case says to
  expect (usually 0).
* We still kill and collect the server in the cleanup phase, in case the
  test ended early.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D44956
DeltaFile
+42-2libexec/tftpd/tests/functional.c
+42-21 files

FreeBSD/src 1ed44fclibexec/tftpd tftpd.c tftp-utils.c, libexec/tftpd/tests functional.c

tftpd: Use `size_t` where appropriate.

* Limit the use of `ssize_t` to only where it's needed.
* Correct one case of `int` being used for a length.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D44954
DeltaFile
+31-21libexec/tftpd/tests/functional.c
+8-8libexec/tftpd/tftpd.c
+2-2libexec/tftpd/tftp-utils.c
+1-1libexec/tftpd/tftp-utils.h
+42-324 files

FreeBSD/src 7358517sys/net if_bridge.c

if_bridge: Minor style fixes

And more comments on the #ifdef INET blocks to improve readability.

While here, revert the order of two prototypes to produce minimal diff
compared to stable branches.

MFC with:       65767e6126a7
DeltaFile
+6-10sys/net/if_bridge.c
+6-101 files

FreeBSD/src ad31d47usr.sbin/bsdinstall/scripts docsinstall

bsdinstall: update comment related to pkg

pkg_add has been gone since 2013(?).  Refer to pkg(8) instead.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    jrtc27
Differential Revision: https://reviews.freebsd.org/D44946
DeltaFile
+1-1usr.sbin/bsdinstall/scripts/docsinstall
+1-11 files

FreeBSD/src f08bf5acontrib/llvm-project/compiler-rt/lib/sanitizer_common sanitizer_symbolizer_markup.cpp sanitizer_symbolizer_markup_constants.h

Merge commit 0f329e0246d1 from llvm-project (by Dimitry Andric):

  [sanitizer_symbolizer] Cast arguments for format strings in markup (#89815)

  When compiling the common sanitizer libraries, there are many warnings
  about format specifiers, similar to:

      compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup.cpp:31:32: warning: format specifies type 'void *' but the argument has type 'uptr' (aka 'unsigned long') [-Wformat]
         31 |   buffer->AppendF(kFormatData, DI->start);
            |                   ~~~~~~~~~~~  ^~~~~~~~~
      compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup_constants.h:33:46: note: format string is defined here
         33 | constexpr const char *kFormatData = "{{{data:%p}}}";
            |                                              ^~
            |                                              %lu
      compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup.cpp:46:43: warning: format specifies type 'void *' but the argument has type 'uptr' (aka 'unsigned long') [-Wformat]
         46 |   buffer->AppendF(kFormatFrame, frame_no, address);
            |                   ~~~~~~~~~~~~            ^~~~~~~
      compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup_constants.h:36:48: note: format string is defined here
         36 | constexpr const char *kFormatFrame = "{{{bt:%u:%p}}}";

    [13 lines not shown]
DeltaFile
+6-4contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup.cpp
+3-3contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup_constants.h
+9-72 files

FreeBSD/src 54c3aa0sys/fs/nfsserver nfs_nfsdstate.c nfs_nfsdserv.c

Revert "nfsd: Fix NFSv4.1/4.2 Claim_Deleg_Cur_FH"

This reverts commit f300335d9aebf2e99862bf783978bd44ede23550.

It turns out that the old code was correct and it was wireshark
that was broken and indicated that the RPC's XDR was bogus.
Found during IETF bakeathon testing this week.
DeltaFile
+4-12sys/fs/nfsserver/nfs_nfsdstate.c
+2-8sys/fs/nfsserver/nfs_nfsdserv.c
+6-202 files

FreeBSD/src 514773alib Makefile

Skip building libclang_rt when WITHOUT_CLANG is used

As noted in bug 277096, when building a pkgbase repository using
WITHOUT_CROSS_COMPILER and WITHOUT_TOOLCHAIN (which sets WITHOUT_CLANG),
the following residual files are left over:

/usr/lib/clang/18/lib/freebsd/libclang_rt.asan-x86_64.so
/usr/lib/clang/18/share/asan_ignore_list.txt
/usr/lib/clang/18/share/cfi_ignore_list.txt
/usr/lib/clang/18/share/msan_ignore_list.txt

This is because the lib/libclang_rt directory is still descended into,
even if WITHOUT_CLANG is used. Fix it by not descending into the
libclang_rt directory in that case.

PR:             277096
Reported by:    Siva Mahadevan <me at svmhdvn.name>
MFC after:      3 days
DeltaFile
+1-1lib/Makefile
+1-11 files

FreeBSD/src d663993sys/kern kern_kthread.c

kthread: Set *tdptr earlier in kproc_kthread_add()

See commit ae77041e0714 ("kthread: Set *newtdp earlier in
kthread_add1()") for details.  That commit was incomplete since
g_init()'s first call to kproc_kthread_add() will cause
kproc_kthread_add() to take the `*procptr == NULL` branch, which avoids
kthread_create().

To ensure that the thread pointer is initialized before the thread
starts running, we have to start the kernel process with RFSTOPPED.
We could perhaps go further and use RFSTOPPED only when tdptr != NULL,
but it's probably better to have consistent behaviour.

Reviewed by:    olce, kib
Reported by:    syzbot+e91e798f3c088215ace6 at syzkaller.appspotmail.com
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D44927
DeltaFile
+9-1sys/kern/kern_kthread.c
+9-11 files

FreeBSD/src a2eaf1csbin/dumpon dumpon.c

dumpon: fix set but not used variable

Signed-off-by: inkeliz <inkeliz at inkeliz.com>

Reviewed by:    markj
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1178

(cherry picked from commit 464b1ab216d5f78054626524addf99f5c622da96)
DeltaFile
+10-2sbin/dumpon/dumpon.c
+10-21 files

FreeBSD/src eff68b6bin/mv mv.c

mv: Set file flags after setting file times

Some file flags prevent modification of file times, so they should be
set later.  This matches NetBSD's behaviour.

Reviewed by:    markj
MFC after:      1 week
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1138

(cherry picked from commit 428f86fd2ff1fd2b073d556fac273c8c7f457376)
DeltaFile
+6-5bin/mv/mv.c
+6-51 files

FreeBSD/src 32004d8sys/fs/nfsserver nfs_nfsdkrpc.c

nfsserver: Rate-limit messages about requests from unprivileged ports

If access from unreserved ports is disabled, then a remote host can
cause an NFS server to log a message by sending a packet.  This is
useful for diagnosing problems but bad for resiliency in the case where
the server is being spammed with a large number of rejected requests.

Limit prints to once per second (racily).

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

(cherry picked from commit b7e4666d7b69c22699a9299687018a892a5dad5b)
DeltaFile
+14-4sys/fs/nfsserver/nfs_nfsdkrpc.c
+14-41 files

FreeBSD/src 42255aftools/build checkstyle9.pl

checkstyle9: Allow a space between "*" and _*restrict

Before the change, we would get errors like this:

    ERROR: "foo * bar" should be "foo *bar"
    #369: FILE: foobar.c:369:
    +barbaz(char * __restrict s,

Reviewed by:            des, imp
Sponsored by:           Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D44911
DeltaFile
+1-0tools/build/checkstyle9.pl
+1-01 files

FreeBSD/src 177ba18bin/sync sync.8

sync.8: Document that the "sync dance" is not a thing

People still believe that it is essential to run sync(8) a couple of
times before a reboot/halt. Document that this has not been necessary
for a long time now.

Reviewed by:    imp, bcr, Pau Amma <pauamma at gundo.com>
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D33233
DeltaFile
+29-1bin/sync/sync.8
+29-11 files

FreeBSD/src 4395d3clib/libsys gettimeofday.2

Document that gettimeofday() is obsolescent

Reported by:    kaktus
Reviewed by:    kaktus, pstef
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D23942
DeltaFile
+24-1lib/libsys/gettimeofday.2
+24-11 files

FreeBSD/src 2e9bfb6sys/sys link_elf.h types.h

sys: Remove two double words in source code comments

- s/of of/of/

(cherry picked from commit cf5d9c41246c0583b28d5c1101c6f334e38a67e9)
DeltaFile
+1-1sys/sys/link_elf.h
+1-1sys/sys/types.h
+2-22 files