riscv / riscv-cheri

This repository contains the CHERI extension specification, adding hardware capabilities to RISC-V ISA to enable fine-grained memory protection and scalable compartmentalization.
https://jira.riscv.org/browse/RVG-148
Creative Commons Attribution 4.0 International
47 stars 28 forks source link

ACPERM should clear the tag if reserved bits are set #323

Closed PRugg-Cap closed 2 months ago

PRugg-Cap commented 2 months ago

(This is the follow up I mentioned in https://github.com/riscv/riscv-cheri/issues/295)

We currently clear the tag if we try to do an SCBNDS on a cap with non-zero reserved bits. For consistency, we should do the same on an ACPERM.

Presumably the reason for the SCBNDS behaviour is to pave the way for those extra bits being used to change the bounds interpretation, while still being compatible. Since the bits are more likely to be used for permissions than for bounds, it seems odd to not have the same defence.

(Here's hoping this is the last malformed-related tweak!)

andresag01 commented 2 months ago

@tariqkurd-repo : Are you planning to create a PR for this one? Thanks!

PRugg-Cap commented 2 months ago

(As said in the meeting, I'm happy to make the PR if we agree it should be done: it shouldn't be too tricky)

tariqkurd-repo commented 2 months ago

This sounds ok to me - @PRugg-Cap are you able to make the PR (if you haven't already)?