From 465df659f55973036b033180de4b7b3c00e098d0 Mon Sep 17 00:00:00 2001 From: Akilan Date: Wed, 26 Nov 2025 12:05:33 +0000 Subject: [PATCH] added cheri permissions directly --- src/snmalloc/ds_core/cheri.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/snmalloc/ds_core/cheri.h b/src/snmalloc/ds_core/cheri.h index db80976..41514d9 100644 --- a/src/snmalloc/ds_core/cheri.h +++ b/src/snmalloc/ds_core/cheri.h @@ -36,6 +36,17 @@ namespace snmalloc * permissions checks are required in the non-SNMALLOC_CHECK_CLIENT case * to defend ourselves or other clients against a misbehaving client. */ + + // Defining values + #define CHERI_PERM_GLOBAL (1 << 0) /* 0x00000001 */ + #define CHERI_PERM_EXECUTE (1 << 1) /* 0x00000002 */ + #define CHERI_PERM_LOAD (1 << 2) /* 0x00000004 */ + #define CHERI_PERM_STORE (1 << 3) /* 0x00000008 */ + #define CHERI_PERM_LOAD_CAP (1 << 4) /* 0x00000010 */ + #define CHERI_PERM_STORE_CAP (1 << 5) /* 0x00000020 */ + #define CHERI_PERM_STORE_LOCAL_CAP (1 << 6) /* 0x00000040 */ + #define CHERI_PERM_SEAL (1 << 7) /* 0x00000080 */ + static const size_t reqperm = CHERI_PERM_LOAD | CHERI_PERM_STORE | CHERI_PERM_LOAD_CAP | CHERI_PERM_STORE_CAP; snmalloc_check_client(