upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/main.cpp
diff options
context:
space:
mode:
authorIlyassRS <ilyassroussi2000@gmail.com>2026-11-25 13:08:19 +0100
committerIlyassRS <ilyassroussi2000@gmail.com>2026-11-25 13:09:51 +0100
commiteb4c4204e8c4523debb0b04d91e7e258d2a29a77 (patch)
tree06a50fd66289e3879bc680fcb16ee90442940ea6 /runtime/src/main.cpp
parent0d80bc5df7c873f40965f34f185cb96913786765 (diff)
runtime: harden title_window_plan and ArenaBlocks boundary and overflow checks
Fix edge-case arithmetic and boundary bugs in the title-memory window planner and GPU address arena allocator: 1. runtime/src/title_window_plan.h: - title_window_range(): reject va < lo (previously returned a range starting at lo > va that excluded va, causing va - range.start to underflow in resolve_title_memory), reject most == 0 (avoiding std::clamp(want, 1, 0) UB), require power-of-two align, and avoid UINT64_MAX - want - align unsigned underflow when computing end. - title_pool_extent(): reject non-power-of-two align and unreadable requests (readable_end <= va) before rounding end up to align, and enforce the most cap after alignment rounding so out.size <= most always holds and out contains va. 2. runtime/src/arena_blocks.h: - Make align_up() overflow-checked so high alignments or keep_out_end near UINT64_MAX cannot wrap to 0 and trigger an infinite loop in ArenaBlocks::allocate(). - Guard against non-advancing keep_out_end <= start in allocate(). - Make consistent() safe against reserved_ > size_ underflow and free_bytes_ + live_bytes overflow. Extend runtime/test/arena_blocks_test.cpp and add portable runtime/test/title_window_plan_bounds_test.cpp. Item: RT-TITLE-WINDOW-AND-ARENA-BOUNDS
Diffstat (limited to 'runtime/src/main.cpp')
0 files changed, 0 insertions, 0 deletions