aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2024-07-03 10:29:35 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-07-03 10:41:14 +0000
commit409d975c59d9dbae9424c533c1d0d903fd51564f (patch)
tree9fbd0da4607b0c6bda0f25195a36226526a421ca
parent6f1d3312ccfbc19933ecfdf7e4e53f2a62f35057 (diff)
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
-rw-r--r--executor/common_linux.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h
index 2c230a619..da27f1075 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))