Skip to content

FS-Tee Grate.#92

Open
stupendoussuperpowers wants to merge 6 commits intomainfrom
tee-grate
Open

FS-Tee Grate.#92
stupendoussuperpowers wants to merge 6 commits intomainfrom
tee-grate

Conversation

@stupendoussuperpowers
Copy link
Copy Markdown
Contributor

No description provided.

@rennergade
Copy link
Copy Markdown
Contributor

should just be 'fs-tee' now

arg_cages: &[u64; 6],
) -> i32 {
let (primary, secondary) = with_tee(|s| {
let route_entry = s.tee_routes.get(&(arg_cages[0], syscall_number)).unwrap();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should these be unwraps? Do we want this to panic if its not in tee_routes?

if let Some(secondary_syscall) = secondary {
let secondary_result = do_syscall(cage_id, secondary_syscall, &secondary_args, arg_cages);

println!(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

eventually need to remove debug prints

// Copy the fd table so the child knows which fds are clamped.
let _ = fdtables::copy_fdtable_for_cage(arg1cage, child_cage_id);

// Register our lifecycle handlers on the child so we can track it.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

commented out?

pub fn register_lifecycle_handlers(cage_id: u64) {
let tee_cage = getcageid();

let handlers: &[(u64, SyscallHandler)] = &[
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

need exit as well right?

}
}

pub static TEE_STATE: Mutex<Option<TeeState>> = Mutex::new(None);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

does this need to be locked/accessed across forks?

arg_cages: &[u64; 6],
) -> i32 {
let (primary, secondary) = with_tee(|s| {
let route_entry = s.tee_routes.get(&(arg_cages[0], syscall_number)).unwrap();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should be consistent with using arg[0] vs cageid

(route_entry.primary_alt, route_entry.secondary_alt)
});

let secondary_fd = match fdtables::translate_virtual_fd(arg_cages[0], args[0]) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what if arg0 isnt an fd?

return primary_result;
}

fn record_fd_pair(cage_id: u64, primary_result: i32, secondary_result: i32) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

does this need to be used places other than open?

tee_routes: HashMap::new(),
primary_target: 0,
interposition_map: Vec::new(),
alt_nr: 3000,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we probably need to have more of a discussion about syscall numbers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We haven't ever really discussed collisions for different grates registering alts

Copy link
Copy Markdown
Contributor

@rennergade rennergade left a comment

Choose a reason for hiding this comment

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

Left a handful of comments

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.

2 participants