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

Support the handle type in IPC #53

Open
nuta opened this issue Jun 15, 2021 · 2 comments
Open

Support the handle type in IPC #53

nuta opened this issue Jun 15, 2021 · 2 comments

Comments

@nuta
Copy link
Owner

nuta commented Jun 15, 2021

Currently, the handle management library (libs/resea/handle.c) use the pair of a client task ID and task-local ID (handle_t) as a handle, e.g., file handle in fs servers and TCP sockets in tcpip server. The problem is that, since it checks the client task ID to deny accessing other tasks' handles, user programs can't transfer their own handles to others.

This is the tracking issue for supporting handle type in IPC to allow handle transferring like SCM_RIGHTS in Linux.

@nuta
Copy link
Owner Author

nuta commented Jun 15, 2021

Idea: use a sufficiently-long random ID

  • A server allocates a sufficiently-long ID (say 2^128 bits) as a handle.
  • Clients simply use or share the allocated ID to use the resource.

Pros

  • We don't need to implement anything in kernel.

Cons

  • We can't move the handle ownership: every tasks that know the handle ID can use the handle.

@nuta
Copy link
Owner Author

nuta commented Jun 15, 2021

Idea: encrypted handle

  • IIRC, this idea is inspired by a IPC mechanism in a L4 microkernel implementation.
  • A server encrypts a 32/64-bits long value (like a user pointer to the server's control block for the handle) using server's private key.
  • Encrypted value is used as the handle. Clients can use or share the handle by simply copying it.

Pros

  • Like JWT, the handle is self-contained: the server don't have to manage a table to manage handles.

Cons

  • We can't move the handle ownership: every tasks that know the handle ID can use the handle.

@nuta nuta self-assigned this Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant