[lld][MachO] Error out on string tables over 4 GiB
Symbol string table offsets (`n_strx`) and the table's size (`strsize`) are
32 bits wide, but `StringTableSection` tracks its size in a `size_t` and
silently truncates offsets past 4 GiB, producing a corrupt symbol table.
This PR reports an error once all strings have been added instead. The test
reaches 4 GiB cheaply by linking one object with a 1 MiB local symbol name
4096 times under `-no-deduplicate-symbol-strings`.
Assisted by Claude.
netinet6: limit size of packet options set via setsockopt(2) to MCLBYTES
While soopt_getm() can indeed allocate a chain of mbufs, the control is
then passed to ip6_pcbopts(), that passes to ip6_setpktopts(). And the
latter refuses to work on a chain and returns EINVAL. This all was true
since KAME import. Thus, the limit set by aec9c8d5a5ee indeed protects
from a local DoS vector, but it doesn't make a practical sense. Anything
between MCLBYTES and IPV6_PKTOPTIONS_MBUF_LIMIT would be refused with
EINVAL and freed.
Reviewed by: pouria
Fixes: aec9c8d5a5ee52dd6d19892138ef78fc78ef2210
PR: 100219
Differential Revision: https://reviews.freebsd.org/D62252
[RISCV] Remove unnecessary 'and' from masked cmpxchg loop. (#246502)
As noted during review of #240749. loophead has already created a
register that holds 'dest & mask' and newval was already masked.
Assisted-by: Claude
Uses/zig: simplify build/install targets
The workaround of building the port while staging is now unnecessary.
Reviewed by: arrowd, kenrap
Tested by: kenrap
Differential Revision: https://reviews.freebsd.org/D60710
nd6: Skip periodic DAD while SLAAC can regenerate a stable address
A failed periodic DAD retry probes the same address. Counting it as
another RFC 7217 failure lets a persistent duplicate exhaust the
interface's regeneration budget and prevent SLAAC on other prefixes.
Count only the initial DAD failure for each address. When SLAAC can
generate another stable address, disable periodic DAD for the failed
candidate. The final candidate remains eligible for periodic recovery
if the conflict clears.
Reported by: llm-postcr
Fixes: 4d5833adfd19 ("nd6: Periodically retry DAD for duplicated IPv6 addresses")
[HIP] Address review nits: drop unused REQUIRES, add MSVC ordering test
- Drop amdgpu-registered-target from hip-include-path-preprocess.hip
since both RUN lines are host-only and pass with an X86-only build.
- Add an MSVC target test to hip-include-path.hip verifying that ROCm
toolkit headers appear before system headers (resource dir / INCLUDE
env var paths) on Windows, confirming the late-hook ordering is
intentional on MSVC.
Co-Authored-By: Claude Opus 4.6 <noreply at anthropic.com>
[DAG][X86] Do not narrow trunc(select) to an undesirable type
DAGCombiner rewrites trunc(select c, a, b) as select c, (trunc a),
(trunc b) when truncating is free. X86 has no 8-bit CMOV, so LowerSELECT
widens an i8 select to i32 through ANY_EXTENDs that become MOVZX
(isolate_msb_i128 in bit-manip-i128.ll):
orb $64, %cl orl $64, %ecx
testq %rsi, %rsi testq %rsi, %rsi
movzbl %cl, %ecx cmovneq %rax, %rcx
cmovnel %eax, %ecx
Gate the fold on isTypeDesirableForOp(ISD::SELECT, VT) and have X86
report i8 as undesirable when CMOV is available. Without CMOV the select
becomes a branch, so nothing changes there. The hook's default rejects
every illegal type, so it is only asked about legal ones and narrowing
to an illegal type is unchanged. A select of two constants is still
narrowed: it becomes i8 setcc arithmetic that needs no zero extension.
[6 lines not shown]
[X86] Enable SlotIndexes compaction by default
Compacting SlotIndexes before greedy allocation drops the entries of
erased instructions, so live range sizes and instruction distances
reflect the code being allocated rather than how much was erased
before it. AMDGPU has done this since #235806; do the same for X86.
Codegen changes only through allocation: no new crashes, verifier
errors or allocation failures in the lit suites, including
EXPENSIVE_CHECKS, and a stage-2 build of LLVM, clang and lld with
-verify-machineinstrs passes its own tests. On llvm-test-suite at -O3,
spills drop 0.3% and .text 0.06%, with compile time unchanged.
Most test updates are regenerated checks. misched-matmul now inserts
20 spills instead of 24. live-debug-vars-stale-slotindexes.mir gets
one more use of %27 so that accumulate_fit still reaches the stale
index path it was written for. reloc-opt.ll gets an NF add that keeps
its source live, because compaction compresses the existing one to the
legacy form. inline-spiller-hoist-folded-copy.ll gets four empty asm
[2 lines not shown]
[ctxprof] Write flat profiles for non-rootable functions
Functions that cannot become roots, such as those containing musttail calls, have their CtxRoot field initialized to the non-rootable sentinel. When serializing flat profiles, check whether a function is an active root rather than requiring CtxRoot to be null and rootable, so flat profiles collected for non-rootable functions are not dropped.
[AMDGPU][GlobalISel] Recognize canonical update.dpp results (#247744)
Teach GlobalISel to recognize canonical `llvm.amdgcn.update.dpp` results
so the post-legalizer combiner can remove redundant `G_FCANONICALIZE`
instructions.
The source must be canonical. If either mask is partial or zero fill is
disabled, the old value must also be canonical because some lanes can
retain it.
Merge tag 'uml-fixes-7.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux
Pull uml fixes from Johannes Berg:
- vector network driver (NAPI, hardening)
- rust module loading
- FD initialization in time-travel messages
* tag 'uml-fixes-7.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux:
um: time-travel: don't use uninitialized fds from START ACK
um: vector: Don't clean up NAPI that was never set up
um: vector: Possible underflow and races fixes
rust: arch/um: Fix loading Rust modules
[AMDGPU] Scalarize packed FP math with fabs sources and update cost model (#236584)
Packed math instructions (v_pk_add, v_pk_mul, v_pk_fma, v_pk_min_num and
v_pk_max_num) have no abs source modifier, so an fabs feeding one must
be materialized as a real and per element. Scalarizing the packed operation
instead lets the abs fold back into a source modifier, trading the packed
instruction plus N ands for N scalar instructions.
Update the TTI cost model to match: fabs stays free, and a packed
f32/f64 fadd/fsub/fmul, fma/fmuladd or f64 minimumnum/maximumnum with a
single-use fabs source (looking through fneg) is priced as one scalar instruction
per element instead of a packed instruction. When queried by the SLP vectorizer, the
operands of the scalar instruction representing the lanes are checked.
Fixes: LCOMPILER-2919
---------
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
powerpc: fix single stepping across signal delivery and fork
PT_STEP sets MSR[SE] and trap() clears it again when the trace trap
comes in, but the rest of the kernel treated it as a bit a thread can't
change, which broke stepping in three places.
sendsig() kept it set for the signal handler, so the debugger got a
SIGTRAP on the handler's first instruction. This is what
ptrace__PT_STEP_with_signal in ptrace_test trips over. Clear it for the
handler, like amd64 does with PSL_T.
The context saved for the handler still has it, but set_mcontext()
refused a context whose MSR[SE] no longer matched the frame, so
sigreturn(2) failed and the process exited as soon as the handler
returned. Let a context carry MSR[SE].
cpu_fork() copied it into the child, which nobody traces, so a fork(2)
done while stepping killed the child with SIGTRAP. Clear it there.
[3 lines not shown]
[lldb] Escape non-printable characters in thread and queue names (#248151)
The inferior sets thread and queue names and can put any bytes in them.
The thread.name and thread.queue format entities printed them verbatim,
so a name could send control sequences to the terminal.
Escape both with StringPrinter, as string summaries already do.
Printable UTF-8 is unchanged, while double quotes and backslashes are
escaped too.
rdar://187191695
Assisted-by: Claude
[Attributor] Fold lookupAAForImpl into lookupAAFor
Also use isAllowed in checkAndQueryIRAttr.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
ZTS: mmp_on_off must not leave a suspended pool behind
mmp_on_off runs with zfs_multihost_interval=100 and the default ten
fail intervals, so MMP suspends the pool when no MMP write has
succeeded for one second. In CI one MMP write took 1.25 s:
WARNING: MMP writes to pool 'testpool' have not succeeded in
over 1109 ms; suspending pool
A pool suspended by MMP can't be cleared on its own host (#19033), so
cleanup failed ("pool is imported on a different host") and left it
imported. The tests after it failed on their zpool create, and
mmp_on_zdb's cleanup destroyed it: zpool destroy -f unmounts the root
dataset, and the unmount waits in zil_commit() for the suspended pool
forever, so the CI job ran into its 300 minute timeout.
mmp_clear_suspended() should have stopped that destroy, but it asks
zpool for the pool's health, and once a cleanup has removed the
hostid, zpool reports the hostid mismatch (ONLINE), not the
[12 lines not shown]