mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 21:58:48 +00:00
MMU/PatchEngine: Fix potential crash during stack probe
TryReadInstruction doesn't validate the address it resolves, that can result in Memory::GetPointer failing and returning nullptr which then leads to a nullptr dereference and a crash. Created PowerPC::HostIsInstructionRAMAddress which works the same way as PowerPC::HostIsRAMAddress for the IBAT.
This commit is contained in:
parent
bd2881ff86
commit
49873b1287
3 changed files with 20 additions and 12 deletions
|
@ -223,11 +223,7 @@ static bool IsStackSane()
|
|||
return false;
|
||||
|
||||
// Check the link register makes sense (that it points to a valid IBAT address)
|
||||
auto insn = PowerPC::TryReadInstruction(PowerPC::HostRead_U32(next_SP + 4));
|
||||
if (!insn.valid || !insn.hex)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return PowerPC::HostIsInstructionRAMAddress(PowerPC::HostRead_U32(next_SP + 4));
|
||||
}
|
||||
|
||||
bool ApplyFramePatches()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue