diff options
author | Bernd Schubert <bernd@bsbernd.com> | 2025-07-15 20:09:17 +0200 |
---|---|---|
committer | Bernd Schubert <bernd@bsbernd.com> | 2025-07-16 23:38:59 +0200 |
commit | 069745b21b90709a863ae5f62fb746667768f989 (patch) | |
tree | c709ca43271e568d41cbb634b1443544ea795f97 /lib/util.h | |
parent | 5105080b6bdc45a2a0ed9f2bccc9b511c572d1b6 (diff) | |
download | libfuse-069745b21b90709a863ae5f62fb746667768f989.tar.gz |
Avoid double unmount on FUSE_DESTROY
This is a long standing issue, a system could have unmounted
/path/to/mnt and then fuse-client/kernel would send FUSE_DESTROY,
which would then again try a umount.
Given that FUSE_DESTROY is async, that umount might arrive
any time later and might possibly unmount a wrong mount point.
A warning as in issue #1286 is just minor to that.
Code wise this uses atomics to free the char *, as FUSE_DESTROY
might race with a signal and a double free might be possible
without proctection. A lock might run into the same issue,
if the signal would arrive at the wrong time a double lock
would be possible.
Additionally, fuse_session_mount() is updated, to first
duplicatate the pointer and to then do the kernel mount -
reverting the kernel mount in case of strdup() failure
is much harder.
Closes: https://github.com/libfuse/libfuse/issues/1286
Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
(cherry picked from commit d8253770ac2cf4b8769e8cf41eb3c629f30ee80f)
Diffstat (limited to 'lib/util.h')
0 files changed, 0 insertions, 0 deletions