Cluster 2 (RMAPI/UVM/Locking/Memory P0s):
- Convert runtime_start_users to atomic_t so wait_event() in
nv_rs_rmapi_node_gpu_remove never calls mutex_lock while !TASK_RUNNING.
- Guard all 6 unlocked nv_rs_alloc_reg_find() call sites in rmapi_node.c with
nv_rs_rmapi_alloc_lock.
- Run nv_rs_rmapi_rc_recover_fault while nv_rs_rmapi_lock is held from
nv_rs_rmapi_node_trylock() in nv_rs_uvm_fault_work_fn (no blocking re-lock).
- Filter MANAGED_RANGES and PAGE_TREES by UvmFile owner in uvm_node.rs to
prevent cross-process managed_unmap UAF; use flush_gpu_tlb_trylock() +
TLB_FLUSH_PENDING deferral so .mmap/vm_ops->close never touch LIVE_ENGINES
without nv_rs_rmapi_lock.
- Pin FD-exported memory backings in memory::Table::export_pins and check via
shared backing_shares_resource() so export -> free original -> import never
UAFs; release orphaned backings on FD owner close.
- Fix Backing::System map_protection(flags), deduplicate video_allocated_bytes,
and unmap Backing::Register in drop_mappings.
Cluster 4 (Kernel Build Hygiene & Linux 5.15-7.3 Compat P0s):
- Factor shared kernel-open/compat_probes.mk for Kbuild + build_guest_test.sh
(fixing Linux 5.15 char *date probe and Linux 7.0+ guest_build).
- Extend tools/prepare_kernel_archive.py to strip all kernel-exported
compiler_builtins mem/string members (strlen/memcpy/memmove/memset/memcmp/bcmp)
and wire it into tools/vm/build_guest_test.sh.
- Fix tools/check_kernel_module.py no_unhardened_sls_return to check per-ret
int3 succession instead of file-wide has_int3.
- Set AR=llvm-ar / NM=llvm-nm under LLVM=1 in utils.mk, LC_ALL=C and non-rustup
fallback in verify_rust_guest.py/check_native_codegen.py, and 1024 MiB guest RAM.
Validated: cargo fmt/clippy/test (958+2), test_gate_cases.py (24/24),
test_kernel_archive.py (5/5), NV_RS_KERNEL_IBT=0 & 1 make modules +
check_kernel_module.py (largest_stack=1000), QEMU EDU verify_rust_guest.py.
Resolve merge conflicts in src/nvidia/kernel/pmu_bringup.rs and
src/nvidia/kernel/rmapi_node.rs against Wave 6/7 (7f7021e), preserving
all upstream logic while keeping Rust Edition 2024 syntax.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Conflict in pmu_bringup.rs: took upstream's adaptive HBM backoff logic;
converted its new extern block in adapter_start.rs to `unsafe extern`.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
A kernel with CONFIG_CC_IS_CLANG=y (CachyOS, for one) passes clang-only
flags to external module builds, so 'make modules' failed in the C shims
with gcc. Detect it from $(KERNEL_OUTPUT)/.config, the way the IBT flags
are detected, and leave an explicit LLVM= setting alone.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- utils.mk: search ~/.cargo/bin in rustup lookup and fall back to ~/.cargo/bin/rustc; auto-gate -Z cf-protection=branch -C jump-tables=no on CONFIG_X86_KERNEL_IBT=y (overridable via NV_RS_KERNEL_IBT=0/1).
- rust-toolchain.toml: restore default stable 1.100.0 (IBT kernels build with RUSTUP_TOOLCHAIN=nightly-2026-11-29).
- tools/check_kernel_module.py: resolve section-symbol relocation targets against disassembled function-entry addresses (avoiding false mid-function failures on valid .text+<entry_off> relocs) and enforce the x86 endbr64 gate when IBT is configured or emitted.
- Stock 580.178.04 parity: omit .llseek across fops (matching nv.c/uvm.c), use container_of() in nano_timer_adapter.c (matching nv-timer.h), use #if defined(MAX_PAGE_ORDER) in rom_fw_adapter.c (matching nv-linux.h), and pass FOLL_LONGTERM in nv_rs_rmapi_os_lock_user_pages (matching os-mlock.c).
- Docs: remove scratch docs/HISTORY.md and update docs/KERNEL_COMPAT.md.
- utils.mk RUST_KERNEL_FLAGS (x86 kernel target) gains -Z cf-protection=branch; the ARM64 branch be left alone — IBT be an x86 CET feature and no BTI was ordered.
- rust-toolchain.toml moved from pinned stable 1.100.0 to nightly, since the flag be unstable. Verified against the tool: rustc --print=codegen-options on 1.100.0 lists nothing for CF protection, and the unstable book lists none/branch/full for the LLVM backend.
- Make RUSTC explicit so the pinned toolchain is what actually runs:
- utils.mk: RUSTC ?= $(or $(shell rustup which rustc),$(shell command -v rustc)). Resolves the toolchain pinned in rust-toolchain.toml instead of trusting PATH order; still overridable with RUSTC=..., and no hardcoded ~/.cargo path that may not exist on another box.
- The gotcha that made this necessary is recorded in the scroll: plain rustc here be the system stable 1.100.0 and rejects -Z. Boxes without rustup still fail - honest limit, no magic.
- Updated tools/post_reboot.sh to check kernel oops taint bit and stuck driver tasks instead of <86400s uptime
- Level 7 hardware regression passed on 0000:b3:00.0 (module 37e6fa430835eee2b426019db3ad70eeb7a9e9070c09c84bd9b973cf56cbe529, 107 inventory words, 0 static mismatches, CUDA baseline verified before and after)
- Updated .gitignore to exclude build archives (*.a, *.rlib), __pycache__, and raw trace dumps