From b232272ad1a30bc62b3046cf2662b965eb9de9ae Mon Sep 17 00:00:00 2001 From: Peter Rugg Date: Thu, 8 Apr 2021 13:08:46 +0100 Subject: [PATCH] Treat CCSeal with an out-of-bounds capability as a move See https://github.com/CTSRD-CHERI/sail-cheri-riscv/commit/2d7ae22c0a538f37f7e85cb1a55f3438946d803c for corresponding Sail change This is not the nicest approach for area, but integrating with the existing bounds check would delay the result a cycle, and incur additional complexity. --- src_Core/RISCY_OOO/procs/lib/Exec.bsv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src_Core/RISCY_OOO/procs/lib/Exec.bsv b/src_Core/RISCY_OOO/procs/lib/Exec.bsv index 2f74ecd..f904c64 100755 --- a/src_Core/RISCY_OOO/procs/lib/Exec.bsv +++ b/src_Core/RISCY_OOO/procs/lib/Exec.bsv @@ -415,7 +415,7 @@ function ExecResult basicExec(DecodedInst dInst, CapPipe rVal1, CapPipe rVal2, C if (dInst.capChecks.cfromptr_bypass && getAddr(rVal1) == 0) begin capException = Invalid; end - if (dInst.capChecks.ccseal_bypass && (!isValidCap(rVal2) || getAddr(rVal2) == -1 || getKind(rVal1) != UNSEALED) && isValidCap(rVal1)) begin + if (dInst.capChecks.ccseal_bypass && (!isValidCap(rVal2) || getAddr(rVal2) == -1 || getKind(rVal1) != UNSEALED || !isInBounds(rVal2, False)) && isValidCap(rVal1)) begin capException = Invalid; boundsCheck = Invalid; end