diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2021-10-28 14:00:16 +0000 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2021-10-29 10:10:32 +0200 |
| commit | 96a31541954f67fa12c6b8361fa77d9c7a3b7665 (patch) | |
| tree | 55f3db4e52e66eb9c89f2eb850e084355d1eeaa0 /executor | |
| parent | c40503e1fa86f3027e003118aaf91646a82f2b5d (diff) | |
executor: do not follow symlinks during umount
Add a UMOUNT_NOFOLLOW flag to umount2 in order to prevent remove_dir
from unmounting what was not mounted by the executed program.
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/common_linux.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h index 6875c88a0..7df9476eb 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -4206,7 +4206,7 @@ retry: #if SYZ_EXECUTOR if (!flag_sandbox_android) #endif - while (umount2(dir, MNT_DETACH) == 0) { + while (umount2(dir, MNT_DETACH | UMOUNT_NOFOLLOW) == 0) { debug("umount(%s)\n", dir); } #endif @@ -4232,7 +4232,7 @@ retry: #if SYZ_EXECUTOR if (!flag_sandbox_android) #endif - while (umount2(filename, MNT_DETACH) == 0) { + while (umount2(filename, MNT_DETACH | UMOUNT_NOFOLLOW) == 0) { debug("umount(%s)\n", filename); } #endif @@ -4270,7 +4270,7 @@ retry: if (!flag_sandbox_android) { #endif debug("umount(%s)\n", filename); - if (umount2(filename, MNT_DETACH)) + if (umount2(filename, MNT_DETACH | UMOUNT_NOFOLLOW)) exitf("umount(%s) failed", filename); #if SYZ_EXECUTOR } @@ -4305,7 +4305,7 @@ retry: if (!flag_sandbox_android) { #endif debug("umount(%s)\n", dir); - if (umount2(dir, MNT_DETACH)) + if (umount2(dir, MNT_DETACH | UMOUNT_NOFOLLOW)) exitf("umount(%s) failed", dir); #if SYZ_EXECUTOR } |
