Skip to content

Commit 98d2c29

Browse files
authored
Merge pull request #1717 from riscv-software-src/fix-ss-load
Loads to shadow-stack pages are allowed
2 parents 4a2da91 + 952b98f commit 98d2c29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

riscv/mmu.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ reg_t mmu_t::walk(mem_access_info_t access_info)
557557
// shadow stack access cause store access fault if xwr!=010 and xwr!=001
558558
throw trap_store_access_fault(virt, addr, 0, 0);
559559
} else if (type == FETCH || hlvx ? !(pte & PTE_X) :
560-
type == LOAD ? !(pte & PTE_R) && !(mxr && (pte & PTE_X)) :
560+
type == LOAD ? !(pte & PTE_R) && !(sse && (pte & PTE_W)) && !(mxr && (pte & PTE_X)) :
561561
!(pte & PTE_W)) {
562562
break;
563563
} else if ((ppn & ((reg_t(1) << ptshift) - 1)) != 0) {

0 commit comments

Comments
 (0)