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

Changes in stubs and linker.py for Authentic Execution #36

Merged
merged 27 commits into from
Oct 26, 2021
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d58d972
linker.py: add KEEP to input_callbacks to preserve input symbols
gianlu33 Aug 23, 2021
ec7dbee
changes in stubs and linker.py for Authentic Execution
gianlu33 Aug 23, 2021
c05544c
add assertion for the Connection struct, add global var in linker.py
gianlu33 Sep 30, 2021
62d2bf3
fix sancus_is_outside_sm
gianlu33 Sep 30, 2021
1b1f009
sm_input: O(1) lookup of conn using index returned by set_key
gianlu33 Sep 30, 2021
967f06a
sancus_is_outside_sm: check for int overflow
jovanbulck Sep 30, 2021
588605d
Fix brackets sancus_is_outside_sm
jovanbulck Oct 1, 2021
2fc4ce6
declare extern vars for the public/secret regions, sanitize sm_attest()
gianlu33 Oct 1, 2021
7d29fb2
sanitize inputs of __sm_set_key and __sm_handle_input
gianlu33 Oct 1, 2021
0554693
reactive: declare symbols for the public/secret regions
jovanbulck Oct 1, 2021
bb6edf2
fix declaration of symbols for public/secret regions
gianlu33 Oct 5, 2021
09f2bfd
__sm_handle_input: return a value to indicate success/error
gianlu33 Oct 5, 2021
6152f0e
__sm_attest: return a value to indicate success/error
gianlu33 Oct 6, 2021
6f8cb87
simplify __sm_handle_input
gianlu33 Oct 6, 2021
e8f5890
small fix return value in __sm_handle_input
gianlu33 Oct 6, 2021
3ae4774
use config file for `num_connections` parameter
gianlu33 Oct 15, 2021
ce71396
add num_connections property in SmConfig
gianlu33 Oct 15, 2021
5621e27
add comments in linker.py to explain the connection array
gianlu33 Oct 15, 2021
16ae05c
add num_connections parameter in sm-config-example.yaml
gianlu33 Oct 15, 2021
b50bb02
move io_id check from set_key to handle_input
gianlu33 Oct 20, 2021
0a81ca0
fix sm_{}_io_connections buffer allocation if num_connections is zero
gianlu33 Oct 20, 2021
7ee6635
return values of stubs as ResultCode values
gianlu33 Oct 21, 2021
e5cb9ce
handle_output: check if allocated buffer is outside SM
gianlu33 Oct 21, 2021
e760cea
remove unused include
gianlu33 Oct 21, 2021
537c3a0
return a value from `output` functions
gianlu33 Oct 21, 2021
b27b130
use uintptr_t type instead of void* in is_buffer_outside_region
gianlu33 Oct 25, 2021
d57b76d
fix: cast from void* to uintptr_t inside is_buffer_outside_region
gianlu33 Oct 26, 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
2 changes: 1 addition & 1 deletion src/stubs/sm_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SM_FUNC(SM_NAME) void __sm_send_output(io_index index,
continue;

uint8_t* payload = malloc(payload_len);
gianlu33 marked this conversation as resolved.
Show resolved Hide resolved
if (payload == NULL)
if (payload == NULL || !sancus_is_outside_sm(SM_NAME, (void *) payload, payload_len))
Copy link
Member Author

@gianlu33 gianlu33 Oct 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be wrong to free the memory if the buffer is inside the SM, right?

Also, should we just raise an error if this happens (how?) instead of continuing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes shouldn't free (although free is outside the enclave anyway).

the current continue seems fine, but indeed since it's really wrong, I'd simply return here. And maybe add a return value instead of void so you can return an error code as with the other functions?

continue;

// associated data only contains the nonce, therefore we can use this
Expand Down