Now that our implementation of PCuABI is getting close to the specification, it is time to zero out DDC in PCuABI. Root capabilities are available separately for all the relevant regions (AT_CHERI_*_CAP in the auxiliary vector, and capabilities returned by mmap() and related syscalls).
Signed-off-by: Kevin Brodsky kevin.brodsky@arm.com --- arch/arm64/kernel/morello.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/kernel/morello.c b/arch/arm64/kernel/morello.c index ae5977ca6420..f20e0b386828 100644 --- a/arch/arm64/kernel/morello.c +++ b/arch/arm64/kernel/morello.c @@ -127,10 +127,14 @@ int morello_thread_start(struct pt_regs *regs, unsigned long pc,
void morello_thread_init_user(void) { - /* TODO [PCuABI] - Set DDC to the null capability */ - uintcap_t ddc = is_pure_task() ? cheri_user_root_cap - : cheri_user_root_allperms_cap; struct morello_state *morello_state = ¤t->thread.morello_user_state; + uintcap_t ddc; + + if (is_pure_task()) { + ddc = 0; + } else { + ddc = cheri_user_root_allperms_cap; + }
/* * CTPIDR doesn't need to be initialised explicitly: