From 409d975c59d9dbae9424c533c1d0d903fd51564f Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Wed, 3 Jul 2024 10:29:35 +0200 Subject: [PATCH] executor: linux: bump fs.mount-max to 100000 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: https://github.com/google/syzkaller/issues/4972 --- executor/common_linux.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/executor/common_linux.h b/executor/common_linux.h index 2c230a619a0..da27f10759c 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -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))