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]
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.
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
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
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)
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
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
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.
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)
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)
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)
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)
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)
mfc-candidates: use stable/14 as default MFC-to branch
This tool is typically invoked from within a working tree containing the
desired MFC target branch, which is detected automatically. It also has
a default for when it is invoked from elsewhere. Switch the default to
the most recent branch, stable/14.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 76a8625bc71da3fa63eef5abb4782553d2588f5c)
iflib: Add sysctl to request extra MSIX vectors on driver load
Intended to be used with upcoming feature to add sub-interfaces, since
those new interfaces will be dynamically created and will need to have
spare MSI-X interrupts already allocated for them on driver load.
This sysctl is marked as a tunable since it will need to be set before
the driver is loaded since MSI-X interrupt allocation and setup is
done during the attach process.
Signed-off-by: Eric Joyner <erj at FreeBSD.org>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D41326
(cherry picked from commit 3c7da27a473e339392121404e06c506df040c16f)
ice_ddp: Update package to 1.3.36.0
This is intended to be used with the upcoming ice 1.39.13-k
driver update, but is still backwards compatible with
previous versions of the driver.
Signed-off-by: Eric Joyner <erj at FreeBSD.org>
Sponsored by: Intel Corporation
(cherry picked from commit 768329961dc0c041f7647f1c4549944a2ca168aa)
iflib: Add subinterface interrupt allocation function
The ice(4) driver will add the ability to create extra interfaces
that hang off of the base interface; to do that the driver requires
a method for the subinterface to request hardware interrupt resources
from the base interface.
Signed-off-by: Eric Joyner <erj at FreeBSD.org>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D39930
(cherry picked from commit ed34a6b6eab9ea39759ccd3f12876a815d271929)