Skip to content

SaveStates: Reject unrealistic memory allocations - #19395

Merged
elad335 merged 2 commits into
RPCS3:masterfrom
elad335:sstates
Sep 3, 2026
Merged

SaveStates: Reject unrealistic memory allocations#19395
elad335 merged 2 commits into
RPCS3:masterfrom
elad335:sstates

Conversation

@elad335

@elad335 elad335 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Continuation of #19386
While protection against overflow has been added, protection against false (due to corruption) allocations which can cause RAM shortage can still happen.
This affects the loading stage of savestates, where the size of arrays is loaded from the file.
I have limited dynamic allocations to be 256MB at maximum which correlates to the maximum PS3 memory single allocation size.
Even that is unrealistic 99% of the time, but it protects against RPCS3 crashing due to memory bottlenecking until the FXO verifications tell us that indeed there is corruption and stop deserialization altogether before anything bad happens.
Unique limits to each dynamic container deserialization call may be added in the future.

@elad335 elad335 added Bugfix Savestates Anything that involves savestates labels Sep 3, 2026
Comment thread rpcs3/util/serialization.hpp
@elad335
elad335 enabled auto-merge (rebase) September 3, 2026 20:24
@elad335
elad335 merged commit 5ab2398 into RPCS3:master Sep 3, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix Savestates Anything that involves savestates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants