Skip to content

Commit

Permalink
In loading caps w/o cap authority, shed tag sooner
Browse files Browse the repository at this point in the history
FIXES #13
  • Loading branch information
nwf-msr committed Mar 1, 2024
1 parent 37fa2e0 commit 13df603
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cheri_insts.sail
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,9 @@ function clause execute LoadCapImm(cd, cs1, imm) = {
match c {
MemValue(v) => {
var cr = v;
if ptw_info.ptw_lc == PTW_LC_CLEAR | not(auth_val.permit_load_store_cap) then {
cr.tag = false;
};
if cr.tag & not(auth_val.permit_load_global) then {
/* Without load-global authority, the loaded cap is always local */
cr.global = false;
Expand Down Expand Up @@ -825,9 +828,6 @@ function clause execute LoadCapImm(cd, cs1, imm) = {
cr.permit_store = false;
cr.permit_load_mutable = false;
};
if ptw_info.ptw_lc == PTW_LC_CLEAR | not(auth_val.permit_load_store_cap) then {
cr.tag = false;
};
/* Sealing capabilities are excluded from revocation */
let isSealingCap = cr.permit_seal | cr.permit_unseal | cr.perm_user0;
if (cr.tag & not(isSealingCap)) then {
Expand Down

0 comments on commit 13df603

Please sign in to comment.