nfscl: Set up a custom buf_ops so that VOP_STRATEGY() call is avoided
A crash was reported, where there was a panic because
a NFS client bwrite() call resulted in a call to VOP_STRATEGY()
where the vp is unlocked.
I believe that write-backs done via the NFS client are safe to
do while holding the buffer lock, but not the vnode lock.
To avoid this panic, this patch defines a custom buf_ops
with an NFS specific bufstrategy() function that calls the
NFS strategy code directly instead of through a VOP_STRATEGY()
call.
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D62336
www/linux-chrome: Security update to 158.0.8127.107
Fixes critical use after free in ANGLE, Web Authentication, IndexedDB,
Canvas, Fonts, Layout, Navigation and Skia, plus buffer overflow and out
of bounds write in ANGLE and integer overflow in Skia.
Changelog: https://chromereleases.googleblog.com/2026/12/stable-channel-update-for-desktop.html
Security: e11e436c-9a8d-491f-ae2a-3893ad415a4e
Sponsored by: Netzkommune GmbH
[libc] Check AllocChecker before pointer offset in HashTable::allocate (#247861)
`HashTable::allocate` added `align_boundary` to `mem` before checking
the `AllocChecker` result from `operator new`, so a failed allocation
returned a non-null offset pointer instead of `nullptr`. Check `ac`
right after `operator new` and return `nullptr` when allocation fails,
and add a `table_test` case verifying the `nullptr` return.
Assisted-By: Gemini
[analyzer][NFC] Out-line `Environment` and `EnvironmentManager` members (#248252)
- Move the bodies of `Environment::begin`, `Environment::end`,
`Environment::Profile`, `Environment::operator==` and
`EnvironmentManager::getInitialEnvironment` from `Environment.h` into
`Environment.cpp`.
- Define the `EnvironmentManager` constructor and destructor out of line
too. They instantiated the `llvm::ImmutableMap` factory and its teardown
in every TU that includes the header, i.e. nearly every checker, though
only the engine constructs and destroys the manager.
Build-time impact (instructions retired, 196 `lib/StaticAnalyzer` TUs):
- Total: -0.22% (run-to-run noise 0.2%; 9 of 9 paired sweeps faster).
- 164 TUs change by more than 0.15%, by -0.28% over those.
Run-time impact (analyzer, 20 TUs of clang/lib/{AST,Sema,Parse,CodeGen},
elapsed cycles, 10 interleaved rounds per binary, before = merge base
a26d5a8):
- Result: no slowdown detected. Median of per-round totals -0.39%: no
[9 lines not shown]
Remove AAPotentialConstantValues::getAssumedConstant
Its only caller was removed with AAValueSimplify.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
nfs_nfsdstate.c: Partial revert of 64857418bb23
Dropping the cached reply that is too large causes
a correctness problem that is too difficult to fix,
so revert this and leave it the way it was.
Although there is an argument that not doing could
cause resource exhaustion, it has not been reported
in the field as a problem.
(cherry picked from commit bc7366a340edb366c37352c636b8360de92aa3a2)
[mlir][Presburger] Fix rangeProduct with locals (#247441)
rangeProduct copied the constraints of the second relation into a copy
of the first after inserting columns for the range variables of the
first, but did not account for local variables. When either relation had
locals, the copied constraints were misaligned with the columns of the
result, either asserting on the number of columns or silently producing
a different relation.
Build the result by extending each relation with the range variables of
the other and intersecting them, which merges their locals.
Assisted-by: gemini-4-carbon
nfsd: Fix handling of RPC messages too large to cache
The NFSv4.1/4.2 session negotiates a limit to the size
of an RPC reply message that can be cached for the session
slot.
This patch fixes the code so that it checks that limit and
does not cache replies larger than the limit, even if the
client requested that it be cached.
This patch is slightly different than what the author
submitted, but retains the check for reply cache size limit.
(cherry picked from commit 64857418bb2379a7d89b6af04cddf92fa48dd28c)
[libc] Cap source length scan to size in strndup (#248241)
`strndup` computed the input length with `internal::string_length(src)`
before clamping to `size` and copied `len + 1` bytes before writing the
trailing null terminator. Use `internal::strnlen(src, size)` so the scan
stops at `size`, copy `len` bytes before setting `dest[len]` to `'\0'`,
and add unit tests for inputs without a null terminator within `size`
bytes.
Assisted-By: Gemini
[AMDGPU] Use SADDR with out-of-range offsets
Add the part of a constant offset that does not fit the immediate field
to the SGPR base with a scalar add, instead of falling back to a 64-bit
VGPR address. This matters most for async LDS DMA loads, which have no
immediate field for the global address.
[AMDGPU] Restore SADDR add sharing in GlobalISel
Before GFX12, the scalar add expands into an s_add_u32/s_addc_u32 pair
linked through SCC, which MachineCSE cannot merge. Without the per-block
cache, each access in GlobalISel built its own pair, so code for those
targets grew, in some functions beyond what upstream generates. Restore
the cache and add a MIR test that checks two loads share one add.
[flang] Add an interface for operations that store values (#247411)
FortranObjectStoreOpInterface names the values that an operation stores
and the operands that receive them. It has the same shape as the OpenACC
StoreLikeOpInterface, so that the two can later be merged into one MLIR
interface. It is implemented on fir.store, fir.copy, fir.save_result,
fir.char_convert, hlfir.assign, hlfir.copy_in, hlfir.copy_out and
cuf.data_transfer.
Alias analysis will use it to tell an address that is stored to memory
from an address that is only used to access memory.
Related to #243650.
Assisted-by: AI
[CodeGenPrepare] Ignore branch weights of logical and/or selects
SelectionDAGBuilder can split a conditional branch on a logical and/or
into one branch per condition.
After #154426, SimplifyCFG puts the branch weights of the folded branch
on the select that it creates. optimizeSelectInst() then finds the
select predictable and turns it into a branch on an i1 phi first. As a
result, the later conditions are computed before the first branch, and
the phi needs its own block. On x86, the fast path of
`if (a && b) [[likely]]` has two more instructions than with clang 21,
and more with three conditions.
Ignore the branch weights of logical and/or selects, including weights
from a profile. SelectOptimize does not turn them into branches either:
TTI::shouldTreatInstructionLikeSelect() returns false for them. A
logical and/or with a one-use compare as the condition can still become
a branch if an operand is worth sinking.
[3 lines not shown]
[CodeGenPrepare] Check shouldTreatInstructionLikeSelect() first
SelectOptimize does not start a group of selects with a select that
TTI::shouldTreatInstructionLikeSelect() rejects: a logical and/or or a
select of two constants. Use the hook in optimizeSelectInst() the same
way, instead of the check for a logical and/or in
isFormingBranchFromSelectProfitable():
- A select that the hook rejects does not become a branch, by its branch
weights or to sink an expensive operand. The next select on the same
condition is then checked on its own.
- As in SelectOptimize, the selects after the first one of a group on
the same condition join the group without the check, and become phis
with it (#238838).
- A group whose first select the target does not support is still
expanded.
Selects of two constants with branch weights, which have become branches
since d66607bd8cd1 (2016), now stay selects.
[4 lines not shown]
[CodeGenPrepare] Add tests for weighted selects (NFC) (#245217)
Precommit tests for #244382 (issue #236043), which keeps CodeGenPrepare
from turning a select into a branch when the target does not treat it
like a select (TTI::shouldTreatInstructionLikeSelect()):
- logical and/or selects, most of them with branch weights and feeding a
conditional branch in the same block;
- selects of two constants with branch weights, alone and next to other
selects on the same condition;
- selects of vectors on PowerPC, which does not support a select of
vectors on a scalar condition.
The CodeGenPrepare tests are for x86-64. The llc tests are for x86-64,
AArch64 (neoverse-v2, where a predictable select is expensive) and
PowerPC. The IR of the new tests is what opt -O2 produces.
Assisted-by: Claude Code (Claude Opus 5.5)
compiler-rt: pass StackTrace with explicit order to ReportReceiver
- NotifyStack/OnStack take a StackTrace plus a ReportStackOrder, so TSan
(whose traces are outermost-first) hands over its raw traces without
copying; the receiver reorders while filling its own buffer.
- Use Tid/kInvalidTid for the thread id, dropping kReportUnknownThread.
- Make ~ReportReceiver protected and non-virtual.
- ScopedSanitizerReport asserts the error report lock is held and no longer
stores the sanitizer name.
- HandleDeadlySignal ends the report before Die() and reports
"stack-overflow" as the type for stack overflows.
- ODR violation registration stacks use an unknown thread.
[GVN] Treat Deadblock as Available
PRE insert load instruction if there is only one predecessor cannot be
eliminated. A deadblock can actually be treat as Available so that it
doesn't count into the BB that needs to insert load.
Blocks unreachable from entry are treated the same way.
[GVN][NFC] Add tests for dead and unreachable predecessors in PRE
Baseline tests for load PRE and scalar PRE where a predecessor is a
dead block or is unreachable from entry.
Assisted-by: Claude # Test