aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-04-10 17:16:55 +0200
committerAleksandr Nogikh <nogikh@google.com>2024-04-10 16:06:33 +0000
commit33b9e058838dbe993f943107bcdd0223e831bd84 (patch)
tree1e59a020dd3791e1b9f53fbd74bc8280c73b6f9e /pkg/csource
parent5b968ccf1481a8bae7fce49cca01cf3597da4be8 (diff)
executor: cleanup mounts with MNT_FORCE
Starting from v6.9, we can no longer reuse a loop device while some filesystem is mounted on it. It conflicts with the MNT_DETACH approach we were previously using. Let's umount synchronously instead, but also with a MNT_FORCE flag to abort potentially long graceful cleanup operations. We don't need them for the filesystems mounted only for fuzzing purposes.
Diffstat (limited to 'pkg/csource')
-rw-r--r--pkg/csource/generated.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go
index f603e77d0..83d58ab09 100644
--- a/pkg/csource/generated.go
+++ b/pkg/csource/generated.go
@@ -10823,10 +10823,11 @@ static void remove_dir(const char* dir)
DIR* dp = 0;
retry:
#if SYZ_EXECUTOR || !SYZ_SANDBOX_ANDROID
+ const int umount_flags = MNT_FORCE | UMOUNT_NOFOLLOW;
#if SYZ_EXECUTOR
if (!flag_sandbox_android)
#endif
- while (umount2(dir, MNT_DETACH | UMOUNT_NOFOLLOW) == 0) {
+ while (umount2(dir, umount_flags) == 0) {
debug("umount(%s)\n", dir);
}
#endif
@@ -10847,7 +10848,7 @@ retry:
#if SYZ_EXECUTOR
if (!flag_sandbox_android)
#endif
- while (umount2(filename, MNT_DETACH | UMOUNT_NOFOLLOW) == 0) {
+ while (umount2(filename, umount_flags) == 0) {
debug("umount(%s)\n", filename);
}
#endif
@@ -10884,7 +10885,7 @@ retry:
if (!flag_sandbox_android) {
#endif
debug("umount(%s)\n", filename);
- if (umount2(filename, MNT_DETACH | UMOUNT_NOFOLLOW))
+ if (umount2(filename, umount_flags))
exitf("umount(%s) failed", filename);
#if SYZ_EXECUTOR
}
@@ -10918,7 +10919,7 @@ retry:
if (!flag_sandbox_android) {
#endif
debug("umount(%s)\n", dir);
- if (umount2(dir, MNT_DETACH | UMOUNT_NOFOLLOW))
+ if (umount2(dir, umount_flags))
exitf("umount(%s) failed", dir);
#if SYZ_EXECUTOR
}