Commit Graph
2 Commits
Author SHA1 Message Date
Diego Casares 202d2853a9 fix(loader): prepare no longer overflows on RVAs past 4 GiB
prepare() added a relocation's page RVA to its in-page offset, and the
TLS callback field's RVA to the directory's RVA, with plain `+`. In a
malformed image either sum can pass u32::MAX: a debug build panics, and
a release build wraps to a wrong RVA. Skip a relocation target that has
no RVA, and treat a TLS field with no RVA as having no relocation to
clear.

(cherry picked from commit 95b990d39a07685b77a5f89492bb705d62d23bbc)
2026-11-27 17:51:23 -08:00
Diego Casares 4902d45680 hle: pending_with completes the call it began, not the block's
pending_with ran its work on a thread that completed the call by its block
address. A title that cancels the call and begins another on the same block
(zeroed, as a new block is) had the old work finish the new call. The thread
also read the shared state through a raw pointer that cleanup had already
freed when the cancel ended the call, so a result returned after a cancel
was a use-after-free.

The thread now holds an Arc of the state and the call it began with, and
completes that call directly. A call a cancel ended is left alone.

Adds a regression test for the stale completion and a test for the
successful path.

(cherry picked from commit d3fb9dc0df8133003b2777944cfef613f6546bff)
2026-11-27 17:51:23 -08:00