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

FreeBSD/src 0cb97c1tools/tools/mwl/mwlstats mwlstats.c

mwlstats: Fix a typo in an error message

- s/the the/the/

(cherry picked from commit e1e149ad8ada85267e981cb9d4c6b48d4ce9e1f4)
DeltaFile
+1-1tools/tools/mwl/mwlstats/mwlstats.c
+1-11 files

FreeBSD/src 1002fa2tools/tools/mwl/mwlstats mwlstats.c

mwlstats: Fix a typo in an error message

- s/the the/the/

(cherry picked from commit e1e149ad8ada85267e981cb9d4c6b48d4ce9e1f4)
DeltaFile
+1-1tools/tools/mwl/mwlstats/mwlstats.c
+1-11 files

FreeBSD/src ce775a8sys/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

FreeBSD/src 068465dsys/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

FreeBSD/src 176336ctools/tools/mwl/mwlstats mwlstats.c

mwlstats: Fix a typo in an error message

- s/the the/the/

(cherry picked from commit e1e149ad8ada85267e981cb9d4c6b48d4ce9e1f4)
DeltaFile
+1-1tools/tools/mwl/mwlstats/mwlstats.c
+1-11 files

FreeBSD/src 19307b8sys/kern uipc_accf.c, tests/sys/kern socket_accf.c

accept_filter: return different errors for non-listener and a busy socket

The fact that an accept filter needs to be cleared first before setting to
a different one isn't properly documented.  The requirement that the
socket needs already be listening, although trivial, isn't documented
either.  At least return a more meaningful error than EINVAL for an
existing filter.  Cover this with a test case.
DeltaFile
+32-0tests/sys/kern/socket_accf.c
+5-1sys/kern/uipc_accf.c
+37-12 files

FreeBSD/src fac45b6sys/dev/aic7xxx aic7xxx_inline.h aic7xxx.c

ahc(4): resolve some minor nits

In ahc_init(), qoutfifo is already assigned to effectively the same
value a couple lines up, except in the first assignment it uses the
proper definition; keep the more descriptive assignment.

ahc_targetcmd_offset() gets the offset wrong entirely; as per the
area of ahc_init() this diff also touches, targetcmds is laid out first
in the shared map and it's followed by the qoutfifo.  As a result, we'd
generally be getting negative offsets here.  We can't actually do a
partial sync anyways, so there was no consequence to getting this wrong.

Reviewed by:    imp, mav

(cherry picked from commit b5e0cc2fa44f52f16fc0b9c3f1709bc0f43fe2d0)
DeltaFile
+1-1sys/dev/aic7xxx/aic7xxx_inline.h
+0-1sys/dev/aic7xxx/aic7xxx.c
+1-22 files

FreeBSD/src cef3d54sys/dev/aic7xxx aic79xx_osm.c aic7xxx_osm.c

ahc(4)/ahd(4): fix target mode on ARM

One of the comments in ahc_execute_scb() notes that the CAM direction is
actually w.r.t. the initiator.  As a consequence, all of our sync ops
end up being wrong because the direction is flipped from that of the
transfer.  Fix it to do proper invalidation and avoid spewing random
garbage out on the SCSI bus.

Reported and tested by: HP van Braam <hp at tmm.cx>
Reviewed by:    imp, mav

(cherry picked from commit 9dcf39575efb2ff32f955d9e04e04af28d45d798)
DeltaFile
+21-14sys/dev/aic7xxx/aic79xx_osm.c
+21-14sys/dev/aic7xxx/aic7xxx_osm.c
+42-282 files

FreeBSD/src 60a4a85sys/dev/aic7xxx aic7xxx_inline.h aic7xxx.c

ahc(4): resolve some minor nits

In ahc_init(), qoutfifo is already assigned to effectively the same
value a couple lines up, except in the first assignment it uses the
proper definition; keep the more descriptive assignment.

ahc_targetcmd_offset() gets the offset wrong entirely; as per the
area of ahc_init() this diff also touches, targetcmds is laid out first
in the shared map and it's followed by the qoutfifo.  As a result, we'd
generally be getting negative offsets here.  We can't actually do a
partial sync anyways, so there was no consequence to getting this wrong.

Reviewed by:    imp, mav

(cherry picked from commit b5e0cc2fa44f52f16fc0b9c3f1709bc0f43fe2d0)
DeltaFile
+1-1sys/dev/aic7xxx/aic7xxx_inline.h
+0-1sys/dev/aic7xxx/aic7xxx.c
+1-22 files

FreeBSD/src 7c3092esys/dev/aic7xxx aic79xx_osm.c aic7xxx_osm.c

ahc(4)/ahd(4): fix target mode on ARM

One of the comments in ahc_execute_scb() notes that the CAM direction is
actually w.r.t. the initiator.  As a consequence, all of our sync ops
end up being wrong because the direction is flipped from that of the
transfer.  Fix it to do proper invalidation and avoid spewing random
garbage out on the SCSI bus.

Reported and tested by: HP van Braam <hp at tmm.cx>
Reviewed by:    imp, mav

(cherry picked from commit 9dcf39575efb2ff32f955d9e04e04af28d45d798)
DeltaFile
+21-14sys/dev/aic7xxx/aic79xx_osm.c
+21-14sys/dev/aic7xxx/aic7xxx_osm.c
+42-282 files

FreeBSD/src c68eed8share/man/man9 accf_tls.9, sys/conf options

accf_tls: accept filter that waits for TLS handshake header
DeltaFile
+106-0sys/netinet/accf_tls.c
+95-0share/man/man9/accf_tls.9
+60-1tests/sys/kern/socket_accf.c
+7-0sys/modules/accf_tls/Makefile
+1-0sys/modules/Makefile
+1-0sys/conf/options
+270-13 files not shown
+273-19 files

FreeBSD/src c7a5881sys/dev/uart uart_bus_pci.c

Add support for Intel Atom S1200 UART

PR: 278316

Signed-off-by: Henrich Hartzer <henrichhartzer at tuta.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1164
(cherry picked from commit 1f2776e123603042944aad9f41ceb46b5b28d8ae)
DeltaFile
+2-0sys/dev/uart/uart_bus_pci.c
+2-01 files

FreeBSD/src 9857f82sys/tools arm_kernel_boothdr.awk

arm_kernel_bothdr.awk: Update to latest ota

The latest ota is the first one in FreeBSD that treats 0 + "0xf" as
being '0' instead of '15'. Don't use this old trick anymore to convert
from hexidecimal to a number. Write a function to do that instead. This
fixes kernel.bin building on arm*. awk on 14 doesn't need this, but to
build FreeBSD stable/14's kernel.bin on 15 we'll need it, so fast MFC.

MFC After:              3 days
Sponsored by:           Netflix
Reviewed by:            kevans
Differential Revision:  https://reviews.freebsd.org/D44801

(cherry picked from commit de22251127cd0e89ce1edb56c58b202496a97ba3)
DeltaFile
+10-4sys/tools/arm_kernel_boothdr.awk
+10-41 files