Skip to content

RSX: Fix UB in FIFO_control::get_current_arg_ptr() - #16813

Merged
elad335 merged 1 commit into
RPCS3:masterfrom
elad335:ub
Mar 7, 2025
Merged

elad335 merged 1 commit into
RPCS3:masterfrom
elad335:ub

Conversation

@elad335

@elad335 elad335 commented Mar 6, 2025

Copy link
Copy Markdown
Contributor

If memory was invalid on the next 4 pages, std::span was referencing invalid memory which is undefined behaviour.
Clamp it to the current page or onto the next if it is valid too.

@elad335
elad335 merged commit 8ed2089 into RPCS3:master Mar 7, 2025
Comment thread rpcs3/Emu/RSX/RSXFIFO.cpp
{
// Return a raw pointer with no limited access
return {static_cast<const u32*>(vm::base(m_iotable->get_addr(m_internal_get))), 0x10000};
constexpr u32 _1m = 0x100000;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The caller to get_current_arg_ptr should specify the length they wish to consume.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants