diff options
| author | Robert Norton | 2018-03-06 16:53:06 +0000 |
|---|---|---|
| committer | Robert Norton | 2018-03-06 16:53:06 +0000 |
| commit | 29686e8e3ce511b3c6834e797381b0724f1e27a1 (patch) | |
| tree | 7d52e270a8e93ba2b953ffe55e0622e2c7f1777b /cheri | |
| parent | afd2eb53449df925a863211af9d7a9cae56d88a2 (diff) | |
Add missing checks for permit_load and permit_store in capability load/store instructions. Fixes fairly long-standing hole in architecture spotted by Kyndylan.
Diffstat (limited to 'cheri')
| -rw-r--r-- | cheri/cheri_insts.sail | 4 |
1 files changed, 4 insertions, 0 deletions
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); |
