Skip to content

Commit aaa407c

Browse files
committed
cheri: Return the full SW permission bits for hybrid DDC.
1 parent 7e329f8 commit aaa407c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

bin/cheribsdtest/cheribsdtest_registers.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,11 @@ check_initreg_data_full_addrspace(void * __capability c)
222222

223223
/* Permissions. */
224224
v = cheri_perms_get(c);
225-
if (v != (CHERI_CAP_USER_DATA_PERMS | CHERI_PERM_SW_VMEM))
225+
if (v != (CHERI_CAP_USER_DATA_PERMS | CHERI_PERM_SW_VMEM |
226+
CHERI_PERM_SYSCALL))
226227
cheribsdtest_failure_errx("perms %jx (expected %jx)", v,
227228
(uintmax_t)CHERI_CAP_USER_DATA_PERMS |
228-
CHERI_PERM_SW_VMEM);
229+
CHERI_PERM_SW_VMEM | CHERI_PERM_SYSCALL);
229230

230231
/*
231232
* More overt tests for permissions that should -- or should not -- be

sys/arm64/cheri/cheri_machdep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ hybridabi_thread_setregs(struct thread *td, unsigned long entry_addr)
119119

120120
/* Set DDC to full user privilege. */
121121
tf->tf_ddc = (uintcap_t)cheri_capability_build_user_rwx(
122-
CHERI_CAP_USER_DATA_PERMS | CHERI_PERM_SW_VMEM,
122+
CHERI_CAP_USER_DATA_PERMS | CHERI_PERMS_SWALL,
123123
CHERI_CAP_USER_DATA_BASE, CHERI_CAP_USER_DATA_LENGTH,
124124
CHERI_CAP_USER_DATA_OFFSET);
125125

sys/riscv/cheri/cheri_machdep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ hybridabi_thread_setregs(struct thread *td, unsigned long entry_addr)
9292

9393
/* Set DDC to full user privilege. */
9494
tf->tf_ddc = (uintcap_t)cheri_capability_build_user_rwx(
95-
CHERI_CAP_USER_DATA_PERMS | CHERI_PERM_SW_VMEM,
95+
CHERI_CAP_USER_DATA_PERMS | CHERI_PERMS_SWALL,
9696
CHERI_CAP_USER_DATA_BASE, CHERI_CAP_USER_DATA_LENGTH,
9797
CHERI_CAP_USER_DATA_OFFSET);
9898

0 commit comments

Comments
 (0)