Skip to content

Reject overflowing savestate collection counts - #19386

Merged
elad335 merged 2 commits into
RPCS3:masterfrom
acts-1631:savestate-serialization-guard
Sep 3, 2026
Merged

Reject overflowing savestate collection counts#19386
elad335 merged 2 commits into
RPCS3:masterfrom
acts-1631:savestate-serialization-guard

Conversation

@acts-1631

Copy link
Copy Markdown
Contributor

The savestate compatibility check trusts the collection length encoded in the file. For bitwise-serializable vectors, the length is multiplied by the element size before reading the data. That multiplication can wrap, allowing a small input to pass the read check and then trigger an enormous vector resize.

This adds checked VLE decoding and rejects collection sizes whose serialized byte count cannot be represented. Normal savestates retain the existing format, while truncated or oversized data is rejected.

@elad335
elad335 self-requested a review September 2, 2026 18:28
@Megamouse Megamouse added the Savestates Anything that involves savestates label Sep 2, 2026
@elad335

elad335 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

This also fixes UB when decoding signed integers when MSB is set, good job.

@elad335
elad335 enabled auto-merge (rebase) September 3, 2026 09:14
@elad335
elad335 merged commit 275c2d4 into RPCS3:master Sep 3, 2026
10 checks passed
@acts-1631

Copy link
Copy Markdown
Contributor Author

Thanks goku

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Savestates Anything that involves savestates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants