Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with the new SSA convention #33

Merged
merged 33 commits into from
Oct 8, 2021
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f4af149
Adding linker and stub changes for SSA modification
Aug 14, 2020
4610beb
Adding sm-config feature through yaml file and sm_isr_basic stub
Oct 19, 2020
efca2ec
Simplified sm_entry stack setup, add caller id and renamed sm_sp
Oct 20, 2020
1eba6cc
Adding SSA data section symbols to sym map in linker
Nov 23, 2020
c268832
Adding improved configuration parser and option for peripheral offset
Nov 23, 2020
33e96c8
adjusted SM entry for new clix instruction
Jan 12, 2021
f67e8b5
Bugfix for empty configurations
Jan 15, 2021
b359af4
Move untrusted variable in memory for peripheral offset
Jan 15, 2021
7c4ea61
Adjusting clix length to 100 on SM ENTRY
Jan 21, 2021
ca013a1
Compiler support for interrupt-restart crypto.
jovanbulck Jan 28, 2021
d90fb26
Merge branch 'master' into irq_ssa
jovanbulck Jan 28, 2021
56d59a2
Adding restartable crypto and fixing r2 pop
Jan 30, 2021
4c7fc60
Merge branch 'irq_ssa' of github.com:fritzalder/sancus-compiler into …
Jan 30, 2021
1efad0a
Overwrite ssa_caller_id after OCALL return
Oct 1, 2021
86cb32a
More documentation and clear markings on clix ends
Oct 1, 2021
0470bf6
Add draft for sancus_disable warning
Oct 1, 2021
5f2f8fb
Proposal for compiler intrinsic get_caller_id
Oct 1, 2021
ffcb6e7
sancus_support: Update sancus_disable atomicity note.
jovanbulck Oct 1, 2021
6ce7416
Merge branch 'irq_ssa' of github.com:fritzalder/sancus-compiler into …
jovanbulck Oct 1, 2021
7b51d8e
sm_entry: fill sm_ssa_caller_id on ocall return
jovanbulck Oct 1, 2021
392ed98
Revert "Overwrite ssa_caller_id after OCALL return"
jovanbulck Oct 1, 2021
f734b0e
llvm: simplify sancus_get_caller_id intrinsic
jovanbulck Oct 1, 2021
33a1d1a
Remove support for sancus_verify_caller.
jovanbulck Oct 1, 2021
3602b14
For returns, the compiler may use r12 and not r15.
Oct 7, 2021
7630fa3
Verify caller ID on ECALL and on OCALL return
Oct 7, 2021
1dd1beb
sm_entry: proposal to disallow nested ecalls.
jovanbulck Oct 7, 2021
fa95a6c
sm_entry: sanitize r6 ret_entry idx
jovanbulck Oct 8, 2021
efb3b98
sm_entry: simplify stack initialization out of atomic entry.
jovanbulck Oct 8, 2021
2610b35
sm_entry: fix r6 sanitization and->or
jovanbulck Oct 8, 2021
9b01837
sm_entry: fixes + provoke violation on error
jovanbulck Oct 8, 2021
63c2700
Revert "sm_entry: simplify stack initialization out of atomic entry."
jovanbulck Oct 8, 2021
c9dc870
use sm_sp as OCALL marker
Oct 8, 2021
160c7fd
Remove unused ssa_thread_id
Oct 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/sancus_support/sm_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,13 @@ sm_id sancus_enable_wrapped(struct SancusModule* sm, unsigned nonce, void* tag);
#define always_inline static inline __attribute__((always_inline))

/**
* Disable the protection of the calling module.
* DANGEROUS: Disable the protection of the calling module.
* NOTE: When utilizing Aion with availability guarantees, this can be very dangerous.
* If this SM is being called by another one, the other SM may be interrupted between
* the sm_verify check and the actual call into the function. If sancus_disable is
* executed in this window, an attacker could fully control the SM call and the return to
* the other SM.
* Thus, be very careful with disabling an SM if other SMs rely on it to be calleable.
*/
always_inline void sancus_disable(void *continuation)
{
Expand Down Expand Up @@ -580,6 +586,20 @@ always_inline sm_id sancus_get_caller_id(void)
return ret;
}

// always_inline sm_id sancus_get_original_caller_id(struct SancusModule* sm)
fritzalder marked this conversation as resolved.
Show resolved Hide resolved
// {
// sm_id ret;
// asm("mov %1 r15\n\t"
// "mov r15 %0"
// : "=m"(ret)
// // secret_end - 2 is ssa_base_addr that points to ssa_base.
// // We want sm_caller_id that lies at ssa_base + 4
// : "m"(*( (void **)(sm->secret_end - 2)) + 4)
// : "15"
// );
// return ret;
// }

/**
* Perform a call to a Sancus module.
*
Expand Down