FS-Tee Grate.#92
Conversation
|
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(); |
There was a problem hiding this comment.
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!( |
There was a problem hiding this comment.
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. |
| pub fn register_lifecycle_handlers(cage_id: u64) { | ||
| let tee_cage = getcageid(); | ||
|
|
||
| let handlers: &[(u64, SyscallHandler)] = &[ |
There was a problem hiding this comment.
need exit as well right?
| } | ||
| } | ||
|
|
||
| pub static TEE_STATE: Mutex<Option<TeeState>> = Mutex::new(None); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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]) { |
There was a problem hiding this comment.
what if arg0 isnt an fd?
| return primary_result; | ||
| } | ||
|
|
||
| fn record_fd_pair(cage_id: u64, primary_result: i32, secondary_result: i32) { |
There was a problem hiding this comment.
does this need to be used places other than open?
| tee_routes: HashMap::new(), | ||
| primary_target: 0, | ||
| interposition_map: Vec::new(), | ||
| alt_nr: 3000, |
There was a problem hiding this comment.
we probably need to have more of a discussion about syscall numbers
There was a problem hiding this comment.
We haven't ever really discussed collisions for different grates registering alts
rennergade
left a comment
There was a problem hiding this comment.
Left a handful of comments
No description provided.