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

Add support for CPU and Memory Sandboxing #388

Closed
wants to merge 2 commits into from
Closed

Add support for CPU and Memory Sandboxing #388

wants to merge 2 commits into from

Conversation

bytemaster
Copy link

The proposed set of changes allow WREN to be built with WREN_SANDBOX defined. When this is defined the WrenConfig object will have two extra parameters:

+  int64_t maxRunOps;
+  size_t maxHeapSize;

Every time memory is allocated or an op is executed a counter is incremented. The program will halt if it runs too long or too much memory is allocated.

These changes are part of work that would enable WREN to be used as a Crypto Currency Virtual Machine. If adopted with use in a crypto currency, WREN would likely get much more attention and developer interest.


#if WREN_SANDBOX
/// Specifies the maximum number of virtual machine instructions to execute, this
/// field is only used when WREN_
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment appears to have been truncated.

@acook
Copy link
Contributor

acook commented Aug 20, 2016

Is there an RFC or a specification that you're implementing here?

@bytemaster
Copy link
Author

@acook I haven't implemented any specific specification, I am just looking for ways to run untrusted code in a deterministic manner.

I will clean up the patch and try to get it passing unit tests.

@bytemaster bytemaster closed this Oct 24, 2016
@bjorn
Copy link
Contributor

bjorn commented Oct 24, 2016

Superseded by #393.

Note that you can update existing pull requests by force-pushing (push -f) to the same branch (needed if you changed some existing commits).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants