Skip to content

Fix fit check overflows - #57

Open
astral4 wants to merge 1 commit into
SFBdragon:masterfrom
astral4:fix-fit-check-overflow
Open

astral4 wants to merge 1 commit into
SFBdragon:masterfrom
astral4:fix-fit-check-overflow

Conversation

@astral4

@astral4 astral4 commented Sep 24, 2026

Copy link
Copy Markdown

Addresses #56.

This change makes the code compare sizes instead of addresses. Also, an address is now formed only once it's known to be in bounds.

calef added a commit to nifeos/nife that referenced this pull request Oct 21, 2026
calef ruled D on #2498 (2026-10-21 UTC): vendor talc 5.1.1 with SFBdragon/talc#57 applied exactly
as upstream wrote it, pinned through vendor-verify, wired with [patch.crates-io], read by the std
generator, and watched until a release carries it.

- vendor/talc is the published tarball (sha256 53f8ad14..., the Cargo.lock checksum) plus
  vendor/talc.divergence.patch, which is #57: the fit checks in full_search_bin and the in-place
  grow compare sizes instead of addresses, and its wasm32-only regression test comes with it.
  script/vendor-verify proves both.
- The root workspace, jig, fuzz, redoxfs_server and tools/redoxfs_host each patch talc to it, so
  no graph links the unpatched crate; the root excludes vendor/talc from membership.
- std_generate_talc reads vendor/talc instead of cargo's unpacked copy, and the farm stamp hashes
  its source.
- script/vendor-watch speaks GitHub as well as GitLab (compare, with `vcs_path` for a crate in a
  subdirectory) and reports a pin's `upstream_fix` pull request: open, merged on a date, or closed.
  Merged or closed counts as behind.
- vendor/README.md records the divergence and its drop condition.

`cargo miri test -p allocation_cache` now passes on talc itself; the walk needed no padding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
calef added a commit to nifeos/nife that referenced this pull request Nov 15, 2026
talc sits under every nife program that allocates, it is mostly unsafe
pointer arithmetic, and Miri has already found one defect in it (the fit
and in-place grow checks fixed by SFBdragon/talc#57). Upstream's fuzz
targets never read a block back and drive talc with a test binning, not
the way a nife program does.

The target lives in the crate's own fuzz/ workspace, so it leaves with
the crate, and the root workspace excludes it. MemoryRegionHeap cannot
run on a host yet: its grow issues the host's own syscall instruction
through user_mode_runtime::invoke. So src/policy.rs restates the crate's
policy line for line over a host arena with a page budget, and lists
each difference; milestone 1100 item 8's page source lets the target
drive the crate itself. It depends on nothing in memory_region_heap, so
the renames in flight there cannot break it.

After every operation it checks alignment, bounds, overlap, block
contents, committed pages against pages mapped, talc's heap end and
counters, the initialize-once rule and when a refusal is allowed. The
seeds come from seeds/make-seeds.py and replay as tests/seeds.rs, which
also runs under Miri. script/fmt and script/lint reach the new
workspace, and the lint ratchet counts it as a tenth configuration.

The package name `fuzz` and the target name are provisional.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M1dgc4ivTNwepAJeUWgK9y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant