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

Implement basic secure gate infrastructure #166

Merged
merged 11 commits into from
Jan 14, 2024
Merged

Implement basic secure gate infrastructure #166

merged 11 commits into from
Jan 14, 2024

Conversation

dbittman
Copy link
Contributor

This PR continues towards secure gates, implementing the following:

  • An attribute proc_macro that can be applied to functions to turn them into secure gates, auto-generating the necessary code.
  • Basic secure gate library code that supports such calls, including ways to move args and return values around, and pass them safely between compartments.

This is pretty limited right now in terms of the types that can be passed and the functions that can be made into secure gates, and it does not currently do any security enforcement. This PR is about getting rust itself on board with this nonsense :)

A side effect that is noteworthy is that we now set CC and CFLAGS env vars in xtask so that crates that compile C code can do so with our patched clang.

@dbittman dbittman added enhancement New feature or request build system Relating to the build system labels Jan 12, 2024
@dbittman dbittman requested a review from PandaZ3D January 12, 2024 20:52
@dbittman dbittman self-assigned this Jan 12, 2024
@dbittman dbittman requested a review from gvnn3 as a code owner January 12, 2024 20:52
Copy link
Contributor

@gvnn3 gvnn3 left a comment

Choose a reason for hiding this comment

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

OK, this is going to be an odd request. Can you not call it hello_world? That's always considered a demo program to do printf("Hello world"). I'd call it hello_gate(way) so that we're specific of what it's doing and testing.

@dbittman
Copy link
Contributor Author

Yup, makes sense. Had originally intended to remove this for the PR but forgot.

@dbittman dbittman requested a review from gvnn3 January 14, 2024 18:48
Copy link
Contributor

@gvnn3 gvnn3 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

Copy link
Contributor

@PandaZ3D PandaZ3D left a comment

Choose a reason for hiding this comment

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

LGTM

@dbittman dbittman merged commit 0d5d5ca into main Jan 14, 2024
1 check passed
@dbittman dbittman deleted the dbittman-secgate3 branch January 14, 2024 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build system Relating to the build system enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants