From abadfdc507d5a75b6272dc360e70a80a510c758a Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Tue, 8 Oct 2024 09:05:33 -0700 Subject: [PATCH] Avoid dependence on asm ssp symbol Resolves #336 --- pk/pk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pk/pk.c b/pk/pk.c index bc413081..ebe501c8 100644 --- a/pk/pk.c +++ b/pk/pk.c @@ -119,7 +119,7 @@ static void run_loaded_program(size_t argc, char** argv, uintptr_t kstack_top) size_t shadow_stack_top = shadow_stack_bottom + shadow_stack_size; set_csr(senvcfg, SENVCFG_SSE); - write_csr(ssp, shadow_stack_top); + asm volatile ("csrw %0, %1" :: "I" (CSR_SSP), "r" (shadow_stack_top) : "memory"); } set_csr(senvcfg, SENVCFG_CBCFE | INSERT_FIELD(0, SENVCFG_CBIE, 1));