Skip to content

sys_ppu_thread: Fix u64 stack size argument - #17692

Merged
elad335 merged 2 commits into
RPCS3:masterfrom
elad335:send-ppu
Nov 15, 2025
Merged

elad335 merged 2 commits into
RPCS3:masterfrom
elad335:send-ppu

Conversation

@elad335

@elad335 elad335 commented Nov 15, 2025 •

Copy link
Copy Markdown
Contributor
  • In sys_ppu_thread_thread_create: stack size is 64-bit long and for the alignment-up, UINT64_MAX is treated ike 0 instead of returning an error code. (and 0 is treated like 4KB)
  • Conditionally read sys_spu_thread_group_attribute::ct member like LV2 does. (fixing 4 bytes out-of-bunds read)
  • Respect null terminator in both sys_spu_thread_group_create and sys_spu_thread_initialize.

@elad335
elad335 merged commit 7e209a7 into RPCS3:master Nov 15, 2025
8 of 9 checks passed
// Compute actual stack size and allocate
const u32 stack_size = utils::align<u32>(std::max<u32>(_stacksz, 4096), 4096);
// 0 and UINT64_MAX both convert to 4096
const u64 stack_size = FN(x ? x : 4096)(utils::align<u64>(_stacksz, 4096));

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.

Image

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