mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-22 20:06:40 +00:00
meso: properly initialize per-thread CFI-value for 11.x
This commit is contained in:
parent
58c3c8c19a
commit
abd7ad2720
1 changed files with 6 additions and 1 deletions
|
@ -51,7 +51,7 @@ namespace ams::kern::arch::arm64 {
|
|||
cpu::InstructionMemoryBarrier();
|
||||
}
|
||||
|
||||
uintptr_t SetupStackForUserModeThreadStarter(KVirtualAddress pc, KVirtualAddress k_sp, KVirtualAddress u_sp, uintptr_t arg, bool is_64_bit) {
|
||||
uintptr_t SetupStackForUserModeThreadStarter(KVirtualAddress pc, KVirtualAddress k_sp, KVirtualAddress u_sp, uintptr_t arg, const bool is_64_bit) {
|
||||
/* NOTE: Stack layout on entry looks like following: */
|
||||
/* SP */
|
||||
/* | */
|
||||
|
@ -76,6 +76,11 @@ namespace ams::kern::arch::arm64 {
|
|||
MESOSPHERE_LOG("Creating User 32-Thread, %016lx\n", GetInteger(pc));
|
||||
}
|
||||
|
||||
/* Set CFI-value. */
|
||||
if (is_64_bit) {
|
||||
ctx->x[18] = KSystemControl::GenerateRandomU64() | 1;
|
||||
}
|
||||
|
||||
/* Set stack pointer. */
|
||||
if (is_64_bit) {
|
||||
ctx->sp = GetInteger(u_sp);
|
||||
|
|
Loading…
Reference in a new issue