gramineproject / gramine

A library OS for Linux multi-process applications, with Intel SGX support
GNU Lesser General Public License v3.0
602 stars 201 forks source link

[LibOS] Checkpoint-restore refactoring #423

Open dimakuv opened 2 years ago

dimakuv commented 2 years ago

This describes the current state of the checkpoint-restore refactoring project.

Legend:

:heavy_check_mark: Done (merged to master) :construction: In progress (usually has a PR open) :star: Next (usually will be unlocked by current "in progress")

Bug fixes and new features

Gramine leaks FDs of named pipes

Gramine can leak FDs (i.e., have holes in the FD map) if the user app never actually opens the named pipe.

pipe/fs.c file contains the implementation of named pipes (fifos). We create two temporary handles for read and write end of pipe, with corresponding PAL handles, and put them in process FD table.

It would be better to store the temporary handles directly, without allocating FDs for them. However, using FDs makes it easier to checkpoint a named pipe. So the checkpoint rewrite should consider this corner case.

Support for SCM_RIGHTS

In Linux, it is possible to send/receive FDs via SCM_RIGHTS on a UNIX domain socket. In Gramine, this would require a way to checkpoint one particular FD and its associated shim handle & PAL handle.

See comments in https://github.com/gramineproject/graphene/pull/1511.

pwmarcz commented 2 years ago

Features to keep

Important features of the current system:

Wishlist