From 33b9e058838dbe993f943107bcdd0223e831bd84 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Wed, 10 Apr 2024 17:16:55 +0200 Subject: 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. --- pkg/csource/generated.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'pkg/csource') 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 } -- cgit mrf-deployment