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

[Req] Extend root share to mount temporary folders #84

Open
xiota opened this issue Jan 6, 2024 · 7 comments
Open

[Req] Extend root share to mount temporary folders #84

xiota opened this issue Jan 6, 2024 · 7 comments

Comments

@xiota
Copy link

xiota commented Jan 6, 2024

Description

Related to #61. Extend root share to mount temporary folders, using bwrap --tmpfs. For reference, from man bwrap:

 --tmpfs DEST
	  Mount new tmpfs on DEST. If the previous option was --perms, it sets
	  the mode of the tmpfs. Otherwise, the tmpfs has mode 0755. If the
	  previous option was --size, it sets the size in bytes of the tmpfs.
	  Otherwise, the tmpfs has the default size.

This is useful to automatically discard temporary data (~/.cache) and to prevent sensitive data from being written to disk.

@rusty-snake
Copy link
Contributor

prevent sensitive data from being written to disk.

swap

@igo95862
Copy link
Owner

igo95862 commented Jan 6, 2024

prevent sensitive data from being written to disk.

swap

I wonder if memory.swap.max cgroups memory controller could be used to disable swap: https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html#memory

@rusty-snake
Copy link
Contributor

  • Bubblejail: Limited options, maybe memory.swap.max.
  • Bubblewrap: Could add a --ramfs or --noswap --tmpfs.
  • Sysadmin: Can configure system to use only zram swap.

@igo95862
Copy link
Owner

igo95862 commented Jan 6, 2024

I don't see how Bubblewrap can add --noswap. It does not setup cgroups. I actually had several ideas on adding the cgroups support for bubblejail.

@rusty-snake
Copy link
Contributor

Well it has already --perms and --size. I see no reason why --noswap should not be possible.

tmpfs blocks may be swapped out, when there is a shortage of memory. tmpfs has a mount option to disable its use of swap:

noswap Disables swap. Remounts must respect the original settings. By default swap is enabled.

src: https://www.kernel.org/doc/html/latest/filesystems/tmpfs.html

@igo95862
Copy link
Owner

igo95862 commented Jan 6, 2024

I didn't know there was such option. Although it seems to be very new: https://lwn.net/Articles/924251/ https://www.spinics.net/lists/linux-man/msg25288.html

@xiota
Copy link
Author

xiota commented Mar 5, 2024

--tmpfs works with new debug service.

I don't see any --noswap option at https://github.com/containers/bubblewrap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants