carp: Leave the multicast groups without the softc lock
carp_detach() calls carp_multicast_cleanup() with the softc mutex held.
in_leavegroup() and in6_leavegroup() take in_multi_sx and in6_multi_sx,
so removing the last CARP address of a family from an interface gives:
lock order reversal: (sleepable after non-sleepable)
1st carp_softc (carp_softc, sleep mutex) @ sys/netinet/ip_carp.c:2329
2nd in_multi_sx (in_multi_sx, sx) @ sys/netinet/in_mcast.c:1280
and the same with in6_multi_sx for IPv6.
The memberships belong to the carp_if and are protected by carp_sx,
which carp_detach() holds throughout; carp_attach() already joins the
groups without the softc lock. Leave them once the softc is unlocked
or destroyed, before the carp_if may be freed. The groups of a family
are left only when no CARP address of that family remains on the
interface, and only softcs with an address of a family send
advertisements through its multicast options, so no sender uses them
[7 lines not shown]
netipsec: Do not send a Packet Too Big below the IPv6 minimum MTU
ipsec6_check_pmtu() answers a forwarded packet that does not fit once
encapsulated with an ICMPv6 Packet Too Big for the path MTU less the
estimated IPsec overhead. When the path MTU to the tunnel endpoint is
below IPV6_MMTU plus that overhead, 1417 bytes for an ESP tunnel over
IPv6, the message asks for less than IPV6_MMTU. Senders ignore it
(RFC 8201; icmp6_mtudisc_update() here does too), keep sending packets
of up to 1280 bytes, and the check drops every one of them.
Do what RFC 2473 section 7.1 asks of a tunnel entry point instead: pass
a packet of up to IPV6_MMTU bytes on, so that the outer packet is
fragmented, and report IPV6_MMTU for larger ones. This also replaces
the silent drop of every packet when the path MTU does not even cover
the overhead. With an IPv4 outer header and net.inet.ipsec.dfbit set
to 1, ip_output() still drops such a packet, as the outer header has DF
set.
Add a test with a path MTU of 1300 between the gateways.
[6 lines not shown]
netipsec: Find the outer destination of a bundle for the PMTU check
ipsec{4,6}_check_pmtu() look up the SA of the last request of a policy
to learn the outer destination, and from it the path MTU. The lookup
fills in the empty addresses of a transport request from the packet as
it is before any transform. When the transport request follows a
tunnel request, as in "esp/tunnel/A-B/require ah/transport//require",
the transform applies it after the tunnel request, to the outer header,
and its SA is installed for A and B. The check then finds no SA with
every SA in place. At level require it sends an SADB_ACQUIRE for the
inner addresses and drops the packet. strongSwan installs this shape
for IPComp in tunnel mode,
"ipcomp/tunnel/A-B/unique esp/transport//unique", so with such a policy
no forwarded IPv6 packet got through, and no IPv4 packet that the check
covers (net.inet.ipsec.dfbit 1, or above 1 for a packet with DF set).
At level use the check sends the same SADB_ACQUIRE and, since
655407eeea5b, skips the comparison with the path MTU. A packet that is
too big once encapsulated is then dropped by ip_output() if the outer
IPv4 header has DF set, or else fragmented, and its sender never learns
[28 lines not shown]
NAS-145497 / 28.0.0-BETA.1 / Add the truesearch.status event (#20345)
This commit adds a subscribable event so that the UI can get status
updates as truesearchd does indexing passes on datasets. Middlewared
uses the python client library provided by the truesearchd package and
creates a single process-wide subscription for indexing / truesearch
events and then forwards them along to any subscribers.
27.1 backport notes:
- event sources: master's EventSource and EventSourceManager rework is
not backported. It folds in TypedEventSource (NAS-140179), which 27
lacks. TruesearchStatusEventSource subclasses 27's EventSource, and the
other event sources are unchanged
- truesearch.py: keep 27's service_ import path, and ignore
no-untyped-call on super().cancel(), which 27 leaves unannotated
- test_status_event: subscribe both clients to truesearch.status. 27
keys event source instances by the raw argument, so
truesearch.status:{} starts a second indexer subscription
- api/v28_0_0/truesearch.py is not on 27
[6 lines not shown]
editors/neovim: Only link against libintl when NLS is on
Previously, nvim required gettext to build/run, even if the i18n
flags were turned off. Even with NLS support turned off, the build
required gettext-runtime, which means it was needed at runtime too.
Now, we're finally able to conditionalize USES=gettext on the NLS
option.
Merge commit 6573dd3f1ae9 from llvm-project (by ShengYi Hung):
[Clang][Sema] Accept weak reference after declaration (#228809)
GCC accepts a weak reference even after there is a declaration. In here,
we use Check*Decl to do the required check and merge the NewDecl to
declaration chain.
Assisted-by: Claude # Tests ReleaseNote
Fixes: #56760
PR: 205934
MFC after: 1 week
NAS-145136 / 28.0.0-BETA.1 / Accept scoped link-local IPv6 default gateways in network.configuration.update (by creatorcary) (#20346)
Setting the IPv6 default gateway to a link-local address with its
interface, such as `fe80::1%eno1`, failed in
`network.configuration.update` with a raw `AddressValueError` instead of
saving. The gateway reachability check added in
[NAS-138027](https://ixsystems.atlassian.net/browse/NAS-138027) expands
the address first, and on the Python 3.13.5 that TrueNAS ships that
expansion rejects any address with a scope
([python/cpython#88178](https://github.com/python/cpython/issues/88178)).
This worked on 25.10. A system upgraded with such a gateway kept its
route but could no longer save the Global Configuration form at all,
because the UI sends the gateway with every save.
- A scoped gateway saves again and its default route is installed
through the named interface.
- A scoped gateway now counts as reachable only through the interface it
names, so a missing or misspelled interface gets the usual "Gateway ...
is unreachable" validation error instead of being stored and failing at
[7 lines not shown]
security/vuxml: Amend entry for py-netutils
* The reporting entity should also be specified in full instead of using
the placeholder.
Fixes: f2cabc637ccc security/vuxml: Document py-netutils security issue
[CIR] Change Insert/ExtractElement helpers to take index type (#246434)
A follow-up for https://github.com/llvm/llvm-project/pull/246065 to
change the signature of `createExtractElement` and `createInsertElement`
helpers to receive the index type and not hard code it to u64
[MLIR][NVVM] Use intrinsic lowering base classes for more ops (#246217)
Make additional NVVM ops derive from `NVVM_VoidIntrinsicOp` and
`NVVM_SingleResultIntrinsicOp` so that the per-op `llvmBuilder` blocks
that only call `getIntrinsicIDAndArgs` and `createIntrinsicCall` can be
removed.
This reduces boilerplate in NVVMOps.td. No functional change intended;
the generated LLVM IR is unchanged.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Sonnet 5.5 <noreply at anthropic.com>
[mlir][linalg] Support outer_dims_perm when bubbling up pack through expand_shape (#246534)
`bubbleUpPackOpThroughExpandShape` bails out on any non-identity
`outer_dims_perm`. Support permutations that move each expanded
reassociation group as a whole and in order: such a permutation is a
permutation of the source dims, so it carries over to the new pack op.
Also bail out on rank-0 expand sources, whose empty reassociation
cannot be projected and triggers an assertion, and fix the invalid
`outer_dims_perm` values in the function's doc example.
Assisted-by: Claude Code (Claude Opus 5.5)
[DebugInfo][FLMD] Add parsing for expanded !!dbgLoc attachments
This patch expands the textual IR parsing support added previously, to
also support parsing "expanded" FLDebugLocs, where the SrcLoc fields (line,
column, scope) are all printed in-line. This adds some complications to
parsing, primarily in that it requires us to read and write to the
MDFunctionLocalContext pre-verifier, and that we need yet another form of
"forward-reference" state tracking.
[Mips] Default to 32-bit FPRs for O32 before MIPS32r2 (#247171)
MIPS III and later imply 64-bit FPRs, which N32 and N64 need, but the
subtarget only dropped the 64-bit GPRs for O32 and kept the 64-bit FPRs.
So llc -mcpu=mips3 (or mips4, mips64) with O32 generated FR=1 code using
the odd FPRs for doubles and emitted .module fp=64. Clang's driver
passes
+fpxx there, but the backend still used the FR=1 register file
underneath.
Before MIPS32r2 there is no mthc1/mfhc1, and neither GCC nor Clang
accept
-mfp64 with O32 there. Default to 32-bit FPRs for O32 before MIPS32r2 as
GCC does, keeping 64-bit FPRs when +fp64 is given explicitly.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[Sparc] Reject %f32-%f62 in inline asm on V8 (#247421)
V8 has only %f0-%f31. The register allocator already leaves D16-D31
and Q8-Q15 alone there, but an inline asm operand bound to one of them
was accepted, and for a quad register copyPhysReg then hit an assertion
because the register has no single-precision halves. Reject them, so
the operand gets the usual "could not allocate" error.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[Sparc] Wait three instructions after writing %y on V8 (#247418)
On SPARC V8 a write to %y may take until the third instruction after
it completes to take effect. MULScc, RDY, SDIV, SDIVcc, UDIV and UDIVcc
read %y, so an sdiv or udiv right after the wr to %y that sets up the
high word of the dividend gets an undefined result. V9 removed the
delay.
As GCC does, make sure there are three instructions between a wr to %y
and the next instruction that reads %y on V8, padding with nops. This
is done after the delay slots are filled so that the instructions are
counted in the order they run.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[DebugInfo][FLMD] Add !!dbgLoc and !DIDbgLoc textual IR parsing
This patch adds support for parsing !!dbgLoc attachments to Instructions
and DbgRecords, and also !DIDbgLoc nodes which contain !!dbgLoc fields.
This patch necessarily makes use of the DebugLoc Conversion Map, which is
used this time to read FLDebugLocs and convert to DILocations.
This patch doesn't add support for parsing the expanded form of !!dbgLoc;
that is added in the next patch, which extends the FLMDAttachment variant
to include expanded dbgLocs.
AI assistance was used in generating the test IR added in this commit; all
comments are human-written and the test expects are generated by
update_test_checks, and the IR is unmodified (besides comments) opt output.
[DebugInfo][FLMD] Add printing support for FLDebugLoc+DIDbgLoc
This patch follows up on the preceding patch by adding support for
printing FLDebugLoc as an attachment `!!dbgLoc(...)` for instructions and
debug records, and for printing DIDbgLoc nodes which contain a !!dbgLoc
operand.
A major component of this patch is the addition of a "DebugLoc conversion"
layer, which allows for conversion between DILocation and FLDebugLoc
formats. This is currently only used for converting DILocation->FLDebugLoc
for printing, but provides a common mechanism that will later be used for
FLDebugLoc<->DILocation conversion for printing+parsing, switching between
the two depending on which format is currently being used in-memory. Due to
the constraint of needing to support consistent conversions at different
points in time (primarily for MIR printing and lazy bitcode
materialization), some information is stored in the LLVMContext, including
a third representation of source location information, stored in a format
which is easy to convert to/from either existing format.
[11 lines not shown]
[mlir][SPIR-V] Convert lifetime ops to LLVM (#241755)
LLVM lifetime intrinsics cover a whole alloca, so markers on other
pointers or with a partial size are dropped
[flang] Link clang-cpp only into libraries that use clang (#238436)
`add_flang_library` calls `clang_target_link_libraries` unconditionally, even
when the library lists no `CLANG_LIBS`. When `CLANG_LINK_CLANG_DYLIB` is
on (the default with `LLVM_LINK_LLVM_DYLIB=ON`), that function links
`clang-cpp` regardless of its argument list. So every flang library, including
ones like `FortranDecimal` that have nothing to do with clang, links `clang-cpp`,
and tools such as `fir-opt` and `tco` load `libclang-cpp.so` for no reason.
Call `clang_target_link_libraries` only when `CLANG_LIBS` is non-empty.
`flang` and `bbc` still link `libclang-cpp.so`, through `flangFrontend`,
`flangFrontendTool` and the driver. Static builds are unaffected.
This came up in issue #235982, where the unneeded `libclang-cpp.so`
exposed `fir-opt` to symbol interposition between it and `libMLIR.so`.
Assisted-by: AI