microsoft / microsoft/litebox

FD cleanup

Open
#31 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement layer-litebox
Dominant language
Rust
Stars
2.7k
Forks
144
Avg merge
12h 21m
Merged PRs (30d)
146

Description

[!NOTE]

Current status of this issue

Most of the bits of this issue have now been handled; latest status of remaining bits is at https://github.com/microsoft/litebox/issues/31#issuecomment-4071407039

Currently, we end up having two different type-distinct namespaces for FileSystem FDs and Socket FDs. This requires the Linux shim to maintain its own storage for FDs that translates between the two. It would likely be better to remove this indirect storage, and instead provide a safe way to maintain the two types of FDs, stored in LiteBox itself, such that the shim doesn't need to deal with the storage.

A fundamental issue with this is that it is unclear whether it is feasible to make a clean type-based separation between the types, and statically prevent FD-confusion bugs (for users who are not a POSIX-like shim, but have better higher-level concepts available), while also giving the simple integer-based handling that the Linux-shim would prefer.

I think with some careful design, this may be feasible, but the details do need to be fleshed out.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the latest status in the issue comment and trace how the Linux shim stores and translates FileSystem FDs and Socket FDs. Review the corresponding LiteBox FD handling and define completion as a settled design that preserves safe type separation while supporting the Linux shim's integer-based handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems, security
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.