From 8b12792e28fcccef8794aff397a7ec549fc45fdd Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Fri, 15 Nov 2024 19:48:06 +0000 Subject: [PATCH] CUnseal: permit any in-bound type FIXES https://github.com/CHERIoT-Platform/cheriot-sail/issues/71 --- src/cheri_insts.sail | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cheri_insts.sail b/src/cheri_insts.sail index d2f59cf..38e5509 100644 --- a/src/cheri_insts.sail +++ b/src/cheri_insts.sail @@ -754,10 +754,8 @@ function clause execute (CUnseal(cd, cs1, cs2)) = { let permitted = cs2_val.tag & isCapSealed(cs1_val) & not(isCapSealed(cs2_val)) - & (cs2_addr == unsigned(cs1_val.otype)) - & cs2_val.permit_unseal - & (cs2_addr >= cs2_base) - & (cs2_addr < cs2_top); + & inCapBounds(cs2_val, zero_extend(cs1_val.otype), 1) + & cs2_val.permit_unseal; let new_global = cs1_val.global & cs2_val.global; let newCap = {unsealCap(cs1_val) with global=new_global}; C(cd) = clearTagIf(newCap, not(permitted));