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

Add inode limits to tmpfs #187

Open
wookie184 opened this issue Aug 30, 2023 · 1 comment
Open

Add inode limits to tmpfs #187

wookie184 opened this issue Aug 30, 2023 · 1 comment
Labels
area: backend Related to internal functionality and utilities area: nsjail Related to NsJail and its configuration priority: 3 - low

Comments

@wookie184
Copy link
Contributor

Adding an inode limit would limit the number of files/directories that can exist in the tmpfs we use for file IO. Given we already have file size limits, a maximum number of files we'll read, and a timeout, it shouldn't be too important, but it may be worth putting a limit to be safe. Currently it seems to be limited by the cgroup memory limit using (allowing for about 50_000 files with the current config).

This can be done by passing the nr_inodes argument here:

mount("", self.path, "tmpfs", size=self.instance_size)

@wookie184 wookie184 added area: backend Related to internal functionality and utilities area: nsjail Related to NsJail and its configuration priority: 3 - low labels Aug 30, 2023
@jb3
Copy link
Member

jb3 commented Sep 2, 2023

We should probably add a similar nr_inodes limit for the tmpfs we spawn for /dev/shm. This would be specified in the nsjail config file though. See #113.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: backend Related to internal functionality and utilities area: nsjail Related to NsJail and its configuration priority: 3 - low
Projects
None yet
Development

No branches or pull requests

2 participants