Skip to content

Commit

Permalink
executor: linux: bump fs.mount-max to 100000
Browse files Browse the repository at this point in the history
Android sets fs.mount-max to 100, making it impossible to create new chroots.
Relax the limit, setting it to a value used on desktops.

Tracking bug: #4972
  • Loading branch information
ramosian-glider authored and dvyukov committed Jul 3, 2024
1 parent 6f1d331 commit 409d975
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions executor/common_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -3899,6 +3899,9 @@ static void initialize_cgroups()
// See https://github.com/google/syzkaller/issues/4939 for more details.
static void sandbox_common_mount_tmpfs(void)
{
// Android systems set fs.mount-max to a very low value, causing ENOSPC when doing the mounts below
// (see https://github.com/google/syzkaller/issues/4972). 100K mounts should be enough for everyone.
write_file("/proc/sys/fs/mount-max", "100000");
if (mkdir("./syz-tmp", 0777))
fail("mkdir(syz-tmp) failed");
if (mount("", "./syz-tmp", "tmpfs", 0, NULL))
Expand Down

0 comments on commit 409d975

Please sign in to comment.