startup_stubs: reject invalid ranges in publish_placement #1502
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1509"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T13:21:59Z.
Summary
x2w_startup::publish_placement(src/startup_stubs/placement_publish.h): rejectstart == 0,record.bytes == 0, andstart + record.bytesuint64 overflow withE_INVALIDARGbefore acquiringlockor mutatingrecords,by_start, ormax_width.tests/startup_placement_alloc.cppwith negative controls for null start (including an already-registered owner andbytes > max_width), zero-byte size, and exact 1-byte / multi-byteuint64_tend-address overflow (verifyingget_recordsis not invoked, the lock is released, andrecords/by_start/max_widthremain unchanged), plus a boundary test forstart + bytes == UINT64_MAX.Verification
git diff --check origin/main..HEAD(passed)python3 -B tests/docs_links_check.py(passed)python3 -B tests/bidi_controls_check.py(passed)/O2verification forstartup_placement_allocandstartup_placement_publish(see verification comment).AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T13:36:28Z.
Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
86f29e63a5057121b44dfae96fad72da345f44ef:--preset dev):cmake --build --preset dev --target startup_placement_alloc startup_placement_publish_check -- -j 6):4.32s(configure1.81s)ctest --preset dev -R '^startup_placement_(alloc|publish)' --parallel 4 --no-tests=error --output-on-failure): 3/3 passed (0.10s:startup_placement_alloc0.02s,startup_placement_publish0.02s,startup_placement_publish_shrink_control0.01s)/O2(--preset release):cmake --build --preset release --target startup_placement_alloc startup_placement_publish_check -- -j 6):1.76s(configure1.75s)ctest --preset release -R '^startup_placement_(alloc|publish)' --parallel 4 --no-tests=error --output-on-failure): 3/3 passed (0.10s:startup_placement_alloc0.02s,startup_placement_publish0.02s,startup_placement_publish_shrink_control0.01s)AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T13:36:42Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
86f29e6ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T14:44:59Z.
All three halves of the guard are covered — verified by removing each
Independent reviewer, not the author. Reviewed
86f29e63; nothing pushed to the branch. Mutations were made locally insrc/startup_stubs/placement_publish.h, rebuilt, reverted; working tree is clean.Environment: Windows 11 build 26300.9974, MSVC 14.44.35207, SDK 10.0.26100.
3 of 3 pass as submitted, and
startup_placement_publishstill prints its two-record shape(
max_width 0x100000 then 0x400000), so the new guard does not disturb the working path.The guard under test
Removing each half
Overflow, zero start and zero size each take the test red on their own, and
startup_placement_publishplus the shrinkcontrol stay green in all three runs — which matches the description that the new checks sit before the lock and never
touch
records,by_startormax_width.One note, not a request
The three failure branches are indistinguishable in the output: all three show only
startup_placement_alloc ***Failed,so the report cannot tell a reader which half of the guard broke if one ever regresses. If you already rely on the
assertion text inside the test for that, fine — a one-line printed reason per control would make a future bisect
readable.
Verdict
Reviewed
86f29e63. +27/-1 across the header and its test, three cases pass, the happy path is unchanged, and each of thethree rejections is genuinely exercised. No objection from me.