Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TEST] Enable ASLR #16878

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

[TEST] Enable ASLR #16878

wants to merge 4 commits into from

Conversation

Vestrel
Copy link
Contributor

@Vestrel Vestrel commented Mar 17, 2025

Tested on x86 (without TSX) and linux arm (qemu). Had to compile discord-rpc from source since precompiled libs don't have pic flag enabled.

@Megamouse
Copy link
Contributor

Please move the discord stuff to a separate PR

@Vestrel Vestrel marked this pull request as draft March 18, 2025 11:13
@Megamouse Megamouse requested a review from kd-11 March 18, 2025 19:55
@Vestrel Vestrel force-pushed the aslr branch 2 times, most recently from 3acc568 to a218bce Compare March 21, 2025 00:49
@Vestrel Vestrel marked this pull request as ready for review March 21, 2025 00:50
@AniLeo AniLeo requested a review from elad335 March 22, 2025 20:48
@AniLeo AniLeo added Enhancement Refactoring Refactors or simplifies existing code labels Mar 22, 2025
@kd-11
Copy link
Contributor

kd-11 commented Mar 23, 2025

I tested windows x86 a bit since yesterday and that seems fine. I need to find some time to test arm64 linux and macos.

@kd-11
Copy link
Contributor

kd-11 commented Mar 23, 2025

Which reminds me - patches also needs to be tested, especially the more complicated ones that use falloc

@AniLeo
Copy link
Member

AniLeo commented Mar 25, 2025

Tested a few games on Linux x64, everything looks the same as master:

  • God of War Ascension: First battle with the spider
  • MotorStorm: First race
  • NieR Replicant: Load into Village, Lost Shrine: Roof
  • Sonic Unleashed: Windmill Isle
  • The Last of Us: Load into Prologue House, Wilderness areas
  • VSH: First setup and boot
  • Yakuza Dead Souls: Load into Kamurocho

Created LLVM firmware cache from scratch too

@@ -574,7 +574,6 @@ namespace stx
}

// Random checks which may fail on invalid pointer
ensure((reinterpret_cast<u64>(r.d()->destroy.load()) - 0x10000) >> 47 == 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you remove it? does it fail the assert?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, for bigger VAs

Copy link
Contributor

@elad335 elad335 Mar 25, 2025

Choose a reason for hiding this comment

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

We are relying on functions to be allocated at address lower than 0xffff'ffff'ffff in PPU. It's not ideal but it is how RPCS3 works as of this day.

See

write_to_ptr<uptr>(ppu_ptr(addr), (reinterpret_cast<uptr>(ptr) & 0xffff'ffff'ffffu) | (uptr(ppu_read(addr)) & ~0xffff'ffff'ffffu));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Refactoring Refactors or simplifies existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants