pub struct SystemIO { /* private fields */ }
Expand description

A RuleSet representing syscalls that perform IO - open/close/read/write/seek/stat.

Configurable to allow subsets of IO syscalls and specific fds.

Implementations

By default, allow no IO syscalls.

Allow all IO syscalls.

Allow read syscalls.

Allow write syscalls.

Allow open syscalls.

Security

The reason this function returns a YesReally is because it’s easy to accidentally combine it with another ruleset that allows write - for example the Network ruleset - even if you only want to read files.

Allow open syscalls but not with write flags.

Note that the openat2 syscall (which is not exposed by glibc anyway according to the syscall manpage, and so probably isn’t very common) is not supported here because it has a separate configuration struct instead of a flag bitset.

Allow stat syscalls.

Allow ioctl and fcntl syscalls.

Allow close syscalls.

Allow reading from stdin

Allow writing to stdout

Allow writing to stderr

Allow reading a given open File. Note that with just this function, you will not be able to close the file under this context.

Security considerations

If another file or socket is opened after the file provided to this function is closed, it’s possible that the fd will be reused and therefore may be read from.

Allow writing to a given open File. Note that with just this, you will not be able to close the file under this context.

Security considerations

If another file or socket is opened after the file provided to this function is closed, it’s possible that the fd will be reused and therefore may be written to.

Trait Implementations

A simple rule is one that just allows the syscall without restriction.

A conditional rule is a rule that uses a condition to restrict the syscall, e.g. only specific flags as parameters. Read more

The name of the profile.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.