From 29686e8e3ce511b3c6834e797381b0724f1e27a1 Mon Sep 17 00:00:00 2001 From: Robert Norton Date: Tue, 6 Mar 2018 16:53:06 +0000 Subject: Add missing checks for permit_load and permit_store in capability load/store instructions. Fixes fairly long-standing hole in architecture spotted by Kyndylan. --- cheri/cheri_insts.sail | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cheri') diff --git a/cheri/cheri_insts.sail b/cheri/cheri_insts.sail index 3d27fde3..1c30fc59 100644 --- a/cheri/cheri_insts.sail +++ b/cheri/cheri_insts.sail @@ -1276,6 +1276,8 @@ function clause execute (CSC(cs, cb, rt, rd, offset, conditional)) = raise_c2_exception(CapEx_TagViolation, cb) else if (cb_val.sealed) then raise_c2_exception(CapEx_SealViolation, cb) + else if not (cb_val.permit_store) then + raise_c2_exception(CapEx_PermitStoreViolation, cb) else if not (cb_val.permit_store_cap) then raise_c2_exception(CapEx_PermitStoreCapViolation, cb) else if not (cb_val.permit_store_local_cap) & (cs_val.tag) & not (cs_val.global) then @@ -1325,6 +1327,8 @@ function clause execute (CLC(cd, cb, rt, offset, linked)) = raise_c2_exception(CapEx_TagViolation, cb) else if (cb_val.sealed) then raise_c2_exception(CapEx_SealViolation, cb) + else if not (cb_val.permit_load) then + raise_c2_exception(CapEx_PermitLoadViolation, cb) else { cursor = getCapCursor(cb_val); -- cgit v1.2.3