Closed jovanbulck closed 3 years ago
Is this still relevant after #33 and the discussion in #13 ? It looks to me like we cover most of it and should maybe create new specific issues to deal with stuff that we missed so far.
yes this is covered and can be closed when the PR is merged
Atomicity requirements for
sm_entry/exit/verify
are currently not always properly enforced.(Note: we assume a cooperating multitasking model: SM can protect itself from being interrupted using
eint/dint
. Cooperating SMs should try to keep atomic sections as short as possible.)SM entry. The following should happen in atomic section:
sancus_get_caller_id
(this should become a compiler intrinsic insm_support.h
as it can change after IRQ)SM exit. The following should happen in atomic section:
sancus_get_id
with the stored ID (this needs changes in the LLVM pass which callssm_verify.S
)SM reti entry. Could be we need to execute
dint; nop
beforereti
? If SM was executing with interrupts enabled,reti
will re-enable interrupts. If SM was interrupted at the start of an atomic section (i.e., directly afterdint
as above), this ensures that an attacker cannot interrupt first instruction afterreti
? This needs testing...