[libunwind] Support extended amd64 segment registers on FreeBSD (#237265)
Raise the amd64 DWARF register limit to 59 and add RFLAGS, all six
segment selectors, FS.base, and GS.base to the register model. Capture
the extended state and restore it when resuming, using setcontext on
FreeBSD to restore selectors and bases together. Pack the state into the
existing context buffers without changing their public sizes or the
Windows XMM offsets.
Add tests for register access, signal-frame CFI recovery, register
bounds, and resume behavior.
Assisted-by: GPT
Check stack are register context in ThreadPlanCallFunction::DoTakedown (#217759)
I get a couple of crashes a year in ThreadPlanCallFunction::DoTakedown
on the line where we get the PC from the thread. It looks like the
RegisterContext (or maybe GetStackFrameAtIndex(0)) are returning null.
The crashes are when the UI calls UnwindInnermostFrame so I know that
thread has to be valid. So the only possibilities I can think of are
that we couldn't reconstruct the stack frame at index 0 or its register
context. I don't know how that would happen, but there's no harm in
being more careful accessing the register context.
[RISCV] Make $rs an output of PseudoTAILReg.
It's used as the temporary register for the AUIPC when expanded
so it should be an output.
Assisted-by: Claude
Merge tag 'kbuild-fixes-7.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux
Pull Kbuild fixes from Nathan Chancellor:
- Move probing of '-mfentry' back into Makefile instead of Kconfig
because it does not interact well with toolchains that support
multiple bit widths
- Add a big comment in scripts/Kconfig.toolchain of two pitfalls when
moving cc-option checks from Kbuild to Kconfig
* tag 'kbuild-fixes-7.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux:
scripts/Kconfig.toolchain: Highlight cc-option differences between Kconfig and Kbuild
kbuild: Move testing of '-mfentry' back to Makefile from Kconfig
[tsan] Increase per-thread held lock limit in DeadlockDetectorTLS to 512 (#232882)
When running under ThreadSanitizer with deadlock detection enabled
(`detect_deadlocks=1`), `DeadlockDetectorTLS::addLock` enforces a hard
limit on the number of distinct locks a single thread may hold
simultaneously via `CHECK_LT(n_all_locks_,
ARRAY_SIZE(all_locks_with_contexts_))`.
Although #116409 previously raised this limit from 64 to 128, workloads
that initialize large RPC frameworks, worker pools, or sharded data
structures (such as C++ extensions under free-threaded Python) can hold
more than 128 locks simultaneously on one thread during initialization,
triggering a fatal `CHECK` failure.
Increase `all_locks_with_contexts_` capacity from 128 to 512. Each
`LockWithContext` entry is 8 bytes (`u32 lock; u32 stk;`), adding 3 KB
per heap-allocated `DDLogicalThread` when `detect_deadlocks=1` while
remaining well below `TwoLevelBitVector` capacity (`DDBV::kSize`, which
is 4096 on 64-bit platforms and 1024 on 32-bit platforms).
[3 lines not shown]
Merge tag 'ktest-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest
Pull ktest updates from Steven Rostedt:
- Sort configs before writing config file
Currently the .config file is created from the perl hash array from
reading the applied min-configs. The order is determined by how perl
hashes the values. This causes the .config file to be created in
different orders for each run, and the order may determine the final
value of the .config file after it goes through a make oldconfig.
Sort the values when creating the .config so that the result is the
same for every run.
- Add total test time to run output
Have ktest display the total test time of running all the tests. This
is useful to find issues in the build, install, boot or test run
[19 lines not shown]
[ci] Collect profiles in the LLVM test-suite LNT runs on Linux
Run the test-suite with `--use-perf all` on Linux, which collects profiling
data and submits it to LNT. Bump both machines since the version of the
test suite also changes.
Assisted by Claude
[SHT_LLVM_BB_ADDR_MAP] Emit the function GUID for local-linkage functions (#237345)
Add the `-basic-block-address-map-emit-func-guid` flag to emit the
function GUID (the `FuncGUID` feature added in #231675) in the
SHT_LLVM_BB_ADDR_MAP section. The GUID is only emitted for functions
with local linkage, whose symbol names may not be unique across
translation units. Other functions can be identified by their symbol
names, so the feature bit is left unset for them.
The GUID assigned by AssignGUIDPass (`!guid` metadata) is used when
available. Otherwise, it is computed from the module's source file name
and the function's current name, since AssignGUIDPass only runs in the
(Thin)LTO pre-link pipelines.
This also bumps the emitted SHT_LLVM_BB_ADDR_MAP version to 6, which is
required for the FuncGUID feature.
Assisted-by: Claude Opus 5.5
Merge tag 'cifs-fixes-7.4-rc1' of https://git.manguebit.org/linux
Pull smb client fixes from Paulo Alcantara:
- Validate the offsets and lengths a server puts in its responses
before using them, so that a malicious or broken server can no longer
make the client read past the received data:
- POSIX lock data (which leaked kernel bytes through F_GETLK)
- NT transaction responses and SMB1 EA lists (both wrapping their
pointer checks on 32-bit)
- short SESSION_SETUP responses (which sent stale buffer content
back to the server in the NTLMv2 AUTHENTICATE message)
- SMB2 READ data areas
- empty truncated fiemap responses
- Fix a heap overflow in SMB2_tcon() with UNC paths longer than
MAX_SHARENAME_LENGTH
- Fix a slab-out-of-bounds write when chmod() rewrites a security
[27 lines not shown]
Merge tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fsverity/linux
Pull fsverity fixes from Eric Biggers:
"Fixes for several bugs found by LLMs:
- Fix bypass of IPE's fsverity support, and a use-after-free in
certain cases, when FS_IOC_ENABLE_VERITY fails when almost done
- Fix FS_IOC_MEASURE_VERITY and FS_IOC_READ_VERITY_METADATA to no
longer bypass Landlock and AppArmor's read permission checks
- Be robust against the filesystem returning different values for a
file's verity descriptor length in two successive queries"
* tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fsverity/linux:
fsverity: Set S_VERITY only after rollback is no longer possible
fsverity: Tell LSMs about signature only after verity is enabled
fsverity: Be more careful with return value of ->get_verity_descriptor()
fsverity: Explicitly require FMODE_READ to retrieve hashes
devel/java-subversion: fix JAR install path, typo, NLS init duplication, RUN_DEPENDS
Install svn-javahl.jar under JAVAJARDIR (the ports tree's own
convention for JARs) instead of a non-standard lib/svn-javahl/
subdirectory. Fix a --without-siwg-python typo in CONFIGURE_ARGS.
Switch USES=java to java:build: this port installs a native library
and a JAR, it doesn't invoke java itself, so it has no business
pulling a JDK into RUN_DEPENDS -- the caller that actually loads the
library and the JAR decides which JVM to run, not this port.
Add files/patch-native_JNIUtil.cpp: JNIGlobalInit()'s non-Windows NLS
setup hand-rolled a bindtextdomain() call that duplicates
svn_nls_init() (the same helper every svn_cmdline_init()-based CLI
tool uses); call the real function instead, which also picks up
bind_textdomain_codeset() that the duplicated code was missing.
Bump PORTREVISION_LATEST/PORTREVISION_LTS and add an UPDATING entry
for the JAR path change.
devel/java-subversion: fix JAR install path, typo, NLS init duplication, RUN_DEPENDS
Install svn-javahl.jar under JAVAJARDIR (the ports tree's own
convention for JARs) instead of a non-standard lib/svn-javahl/
subdirectory. Fix a --without-siwg-python typo in CONFIGURE_ARGS.
Switch USES=java to java:build: this port installs a native library
and a JAR, it doesn't invoke java itself, so it has no business
pulling a JDK into RUN_DEPENDS -- the caller that actually loads the
library and the JAR decides which JVM to run, not this port.
Add files/patch-native_JNIUtil.cpp: JNIGlobalInit()'s non-Windows NLS
setup hand-rolled a bindtextdomain() call that duplicates
svn_nls_init() (the same helper every svn_cmdline_init()-based CLI
tool uses); call the real function instead, which also picks up
bind_textdomain_codeset() that the duplicated code was missing.
Bump PORTREVISION_LATEST/PORTREVISION_LTS and add an UPDATING entry
for the JAR path change.
[clang][DepScan] Introduce API to find modulemaps without loading
Introduce a way to batch look up the modulemap that defines
each of a set of module names.
`getModuleMapsForModules` builds a compiler instance from the same
command line as a by-name scan, then does every lookup in a separate
header search with lazy modulemap loading turned on and diagnostics
ignored.
The main use case is to let the Swift dependency scanner
invalidate its serialized dependency graph without the cost of loading
the referenced modules.
* Modulemaps passed with `-fmodule-map-file` are parsed first, all
other modules are resolved by by-name header search.
[clang][HeaderSearch] Introduce API to find a module's module map without loading (#235835)
Add a new public interface `lookupModuleMapFileForModule` that behaves
like `lookupModule` but only relies on parsing modulemaps, except in the
inferred framework case.
* Add a public `parseModuleMapFile` that can parse files passed through
`-fmodule-map-file`.
* Both APIs require lazy modulemap loading enablement.
* Introduce several helpers to support the new API.
Merge tag 'thermal-7.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull thermal control fixes from Rafael Wysocki:
"These fix three issues related to thermal control:
- Fix CPU mask truncation in power limit trace event used by the
power allocator thermal governor (Hungyu Lin)
- Fix code indentation in create_s32_tzp_attr() and rearrange it to
use early return when applicable (Thorsten Blum)
- Allow cross builds of the Intel thermal tests (Sasha Levin)"
* tag 'thermal-7.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
thermal: sysfs: Fix indentation in create_s32_tzp_attr()
thermal: Fix CPU mask truncation in power limit trace event
selftests/thermal: allow cross builds of the Intel tests
[AMDGPU] Assert that RewriteAGPRCopyMFMA sees current reserved registers
AMDGPURewriteAGPRCopyMFMA reads allocation orders from the shared
RegisterClassInfo after the VGPR allocator. If a change to the reserved
registers was not published to the analysis, it can be offered a reserved
register: its spill slot elimination then trips an assertion in VirtRegMap if it
happens to pick that register, and silently clobbers it without assertions.
Check on entry, before the subtarget early exit, that the analysis matches MRI's
frozen set, so every AMDGPU pipeline reaching the pass verifies it. Add
RegisterClassInfo::hasCurrentReservedRegs() for the comparison; it recomputes
nothing.
AI-assisted.
[AMDGPU] Stop publishing reserved registers from AMDGPUReserveWWMRegs
Remove the update, the TRI->getReservedRegs() call needed to produce it, and the
pass's RegisterClassInfo dependency.
Since #226523, the allocator immediately following this pass publishes the
reserved register set it freezes. Publishing here duplicates the computation and
leaves a window in which the shared analysis and MRI's frozen set disagree.
AI-assisted.
Address review: don't look up a '\01' name without the global prefix
A symbol without the target's global prefix has no C name, so looking it up
by the rest of its name found a different symbol (e.g. "\01printf" on Darwin
called libc's printf). Fall back to the IR name instead, as ORC's
DynamicLibrarySearchGenerator skips such symbols, and reword the comment. In
the test, drop the redundant -jit-kind=mcjit and add a case for this.
Assisted-by: Claude Opus 5.5
Merge tag 'pm-7.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki:
"These address assorted issues in the power management code and update
documentation:
- Fix potential out-of-bounds access in deferred reset in the cpufreq
statistics code (Zhongqiu Han)
- Cancel HWP notify work in the intel_pstate driver cleanup to
prevent possible use-after-free from occurring (Tristan Madani)
- Adjust state names and descriptions for ACPI _LPI idle states in
the intel_idle driver to make them follow the driver's idle state
naming convention (Rafael Wysocki)
- Document the new pm_runtime_use_autosuspend() undo mechanism that
triggers automatically on driver exit (Joshua Crofts)
[14 lines not shown]
[AMDGPU] Avoid illegal types in the zero/any extend to perm combine (#235846)
performZeroOrAnyExtendCombine runs after type legalization and converts
the byte providers of the extended i16 to i32 with
getBitcastedAnyExtOrTrunc.
A provider can be a vector wider than 32 bits, for example a v8i16
bitcast of a v2i64 half of a <4 x i64> kernel argument.
Bitcasting it to an integer of the same width creates an i128, and
LegalizeDAG asserts with "Unexpected illegal type!".
Both bytes come from the first dword of their provider, so extract that
dword with getDWordFromOffset, as matchPERM does.
Providers of up to 32 bits take the same path as before.
AI-assisted.
Merge tag 'acpi-7.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI support fixes from Rafael Wysocki:
"These address assorted issues in ACPI support code and work around
concurrency-related issues in AML on some platforms:
- Separate handler locking from sysfs lifetime in the ACPI platform
profile driver to avoid possible deadlocks due to sysfs accesses
during driver removal (Daniel Lezcano)
- Introduce additional locking around the evaluation of selected ACPI
control methods in a few places to work around issues related to
concurrency in AML on some platforms (Ali Ahmet Memiş)
- Address two issues reported by Sashiko in the ACPI table data sysfs
interface (Jamie Nguyen)
- Initialize parser_state.aml_end in acpi_install_method() properly
to avoid out-of-bounds accesses during control method installation
[11 lines not shown]
Write the internal link addresses to truenas_smbhad.conf
truenas_smbhad finds its end of the internal link by binding the two HA
heartbeat addresses and keeping the one that succeeds. TrueNAS sets
net.ipv4.ip_nonlocal_bind, so both binds succeed on either controller
and the daemon gives up with "both HA heartbeat addresses on this
controller": the primary serves smbd unprotected and the standby never
connects, so the standby never holds a copy of the durable handles.
Write local_address and peer_address, which the daemon takes over its
own detection, from the node, as failover.local_ip and
failover.remote_ip do.