* Set the new canary */ arc4random_buf(&td2->td_md.md_canary, sizeof(td2->td_md.md_canary)); @@ -192,6 +194,8 @@ cpu_copy_thread(struct thread *td, struct thread *td0) td->td_md.md_spinlock_count = 1; td->td_md.md_saved_daif = PSR_DAIF_DEFAULT; + td->td_md.md_sctlr = td0->td_md.md_sctlr; + #if defined(PERTHREAD_SSP) /* Set the new canary */ arc4random_buf(&td->td_md.md_canary, sizeof(td->td_md.md_canary)); diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 6447f0064d33..4233a01d143c 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -2803,6 +2803,7 @@ SCTLR_SA | \ SCTLR_C | \ SCTLR_M) +#define SCTLR_USER_MASK (SCTLR_ATA0 | SCTLR_TCF0_MASK) /* SCTLR_EL12 */ #define SCTLR_EL12_REG MRS_REG_ALT_NAME(SCTLR_EL12) diff --git a/sys/arm64/include/proc.h b/sys/arm64/include/proc.h index b40990e89385..d5879a794269 100644 --- a/sys/arm64/include/proc.h +++ b/sys/arm64/include/proc.h @@ -70,7 +70,8 @@ struct mdthread { int md_efirt_dis_pf; int md_reserved0; - uint64_t md_reserved[2]; + uint64_t md_sctlr; + uint64_t md_reserved1; }; struct mdproc {