From 095e8f13dbf4d7bd85b72571cb5be57c33622ad0 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Tue, 7 Jun 2022 17:59:22 +0100 Subject: [PATCH] func-malloc: expand CHERI tests to check no-VMEM --- src/test/func/malloc/malloc.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/func/malloc/malloc.cc b/src/test/func/malloc/malloc.cc index ec28a7d0..1d4c31da 100644 --- a/src/test/func/malloc/malloc.cc +++ b/src/test/func/malloc/malloc.cc @@ -55,6 +55,14 @@ void check_result(size_t size, size_t align, void* p, int err, bool null) INFO("Cheri size is {}, but required to be {}.", cheri_size, alloc_size); failed = true; } +# if defined(CHERI_PERM_SW_VMEM) + const auto cheri_perms = __builtin_cheri_perms_get(p); + if (cheri_perms & CHERI_PERM_SW_VMEM) + { + INFO("Cheri permissions include VMEM authority"); + failed = true; + } +# endif if (p != nullptr) { /*