From a9a0ffed7ef93dd86695100cf081438a918d6026 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 27 Nov 2024 17:23:09 +0100 Subject: executor: mount gadgetfs We can reach it at least with automatic descriptions. --- executor/common_linux.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'executor/common_linux.h') diff --git a/executor/common_linux.h b/executor/common_linux.h index 5fc1bec2c..e63b0479f 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -3906,6 +3906,7 @@ static void initialize_cgroups() #endif #if SYZ_EXECUTOR || SYZ_SANDBOX_NONE || SYZ_SANDBOX_NAMESPACE +static void setup_gadgetfs(); static void setup_binderfs(); static void setup_fusectl(); // Mount tmpfs and chroot into it in sandbox=none and sandbox=namespace. @@ -3972,11 +3973,27 @@ static void sandbox_common_mount_tmpfs(void) fail("chroot failed"); if (chdir("/")) fail("chdir failed"); + setup_gadgetfs(); setup_binderfs(); setup_fusectl(); } #endif +#if SYZ_EXECUTOR || SYZ_SANDBOX_NONE || SYZ_SANDBOX_NAMESPACE +#include +#include + +static void setup_gadgetfs() +{ + if (mkdir("/dev/gadgetfs", 0777)) { + debug("mkdir(/dev/gadgetfs) failed: %d\n", errno); + } + if (mount("gadgetfs", "/dev/gadgetfs", "gadgetfs", 0, NULL)) { + debug("mount of gadgetfs at /dev/gadgetfs failed: %d\n", errno); + } +} +#endif + #if SYZ_EXECUTOR || SYZ_SANDBOX_NONE || SYZ_SANDBOX_SETUID || SYZ_SANDBOX_NAMESPACE || SYZ_SANDBOX_ANDROID #include #include -- cgit mrf-deployment