mystikos
mystikos copied to clipboard
/tmp/myst* files are not cleaned up in case a program fails
If a program aborts or segfaults when run with mystikos, we don't get a chance to clean /tmp files.
@vtikoo , please add more information about the issue
Discussed some concerns and possible approaches with @paulcallen and @mikbras. Potential solutions include:
- use a ramfs for the temp dir, or
- use a stream object for signing or file mutations, or
- declare signal traps to clean up the directory, and/or
- always use a per-process unique temp dir (e.g.,
/tmp/mysql-abc123/*
), and never place files directly in/tmp/
looks like rootfs and elf image files. There is also empty directories that are owned by root
Here is a solution but will require some rework.
int fd = mkstemp(template);
unlink(template);
// use fd to access file; file blocks are reclaimed on close or when process dies.