From 9dca70ec9e515135eb475696a15071fabbb3df3a Mon Sep 17 00:00:00 2001 From: Elad Ashkenazi Date: Thu, 12 Oct 2023 10:21:18 +0300 Subject: [PATCH] PPU Loader: Fix relocation offset verification Kernel aligns segment memory to 256 bytes internally. --- rpcs3/Emu/Cell/PPUModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/PPUModule.cpp b/rpcs3/Emu/Cell/PPUModule.cpp index 0de8e077b7..adc4c23dc1 100644 --- a/rpcs3/Emu/Cell/PPUModule.cpp +++ b/rpcs3/Emu/Cell/PPUModule.cpp @@ -1615,9 +1615,9 @@ std::shared_ptr ppu_load_prx(const ppu_prx_object& elf, bool virtual_lo { const auto& rel = reinterpret_cast(prog.bin[i]); - if (rel.offset >= ::at32(prx->segs, rel.index_addr).size) + if (rel.offset >= utils::align(::at32(prx->segs, rel.index_addr).size, 0x100)) { - fmt::throw_exception("Relocation offset out of segment memory! (offset=0x%x, index_addr=%u)", rel.offset, rel.index_addr); + fmt::throw_exception("Relocation offset out of segment memory! (offset=0x%x, index_addr=%u, seg_size=0x%x)", rel.offset, rel.index_addr, prx->segs[rel.index_addr].size); } const u32 data_base = rel.index_value == 0xFF ? 0 : ::at32(prx->segs, rel.index_value).addr;