Skip to content

FreeBSD support #38

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

Closed
jdm opened this issue Oct 2, 2017 · 2 comments
Closed

FreeBSD support #38

jdm opened this issue Oct 2, 2017 · 2 comments

Comments

@jdm
Copy link
Member

jdm commented Oct 2, 2017

   Compiling gaol v0.0.1 (https://github.com/servo/gaol#227ff0ba)
error[E0432]: unresolved import `platform::process`
  --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/sandbox.rs:13:25
   |
13 | use platform::process::{self, Process};
   |                         ^^^^ no `process` in `platform`

error[E0432]: unresolved import `platform::process`
  --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/sandbox.rs:13:15
   |
13 | use platform::process::{self, Process};
   |               ^^^^^^^ Could not find `process` in `platform`

error[E0432]: unresolved import `platform::ChildSandbox`
  --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/sandbox.rs:22:20
   |
22 | pub use platform::{ChildSandbox, Sandbox};
   |                    ^^^^^^^^^^^^ no `ChildSandbox` in `platform`

error[E0432]: unresolved import `platform::Sandbox`
  --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/sandbox.rs:22:34
   |
22 | pub use platform::{ChildSandbox, Sandbox};
   |                                  ^^^^^^^ no `Sandbox` in `platform`

error[E0412]: cannot find type `Operation` in module `platform`
  --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/profile.rs:99:32
   |
99 |     PlatformSpecific(platform::Operation),
   |                                ^^^^^^^^^ not found in `platform`
   |
help: possible candidate is found in another module, you can import it into scope
   |
13 | use profile::Operation;
   |

error[E0599]: no method named `support` found for type `&profile::Operation` in the current scope
   --> /path/to/servo/.cargo/git/checkouts/gaol-c3a1e33941376f84/227ff0b/profile.rs:132:29
    |
132 |             match operation.support() {
    |                             ^^^^^^^
    |
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following trait defines an item `support`, perhaps you need to implement it:
            candidate #1: `profile::OperationSupport`

error: aborting due to 6 previous errors

error: Could not compile `gaol`.
@valpackett
Copy link
Contributor

(I was just writing this in servo/servo#11625 … :D)

Gaol is designed around a syscall filtering model like seccomp/pledge, not an object-capability model like Capsicum. (I made a little crate that's better suited for Capsicum — including the awesome openat trick.)

I can add a Capsicum backend for Gaol that disallows everything :) but Servo would have to pass all the descriptors from a privileged process or open them beforehand.

Looks like the content process sandbox only needs /dev/urandom and a resources directory! So it should be possible to open these things before starting the sandbox, and use the openat crate to open the resources under the directory.

@valpackett
Copy link
Contributor

Actually /dev/urandom might not even be necessary. If Servo uses the rand crate (I haven't checked), it uses sysctl kern.arandom :)

bors-servo pushed a commit that referenced this issue Dec 2, 2018
Add FreeBSD Capsicum support

Fixes #38.
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

No branches or pull requests

2 participants