mirror of
https://github.com/libfuse/libfuse.git
synced 2026-07-07 14:47:41 +08:00
dc6ce72129
Bernd received a complaint via github that the "unmount" command in the
new fuse service API is prone to malicious symlink creation races
because the umount2 call doesn't use UMOUNT_NOFOLLOW. Therefore, if you
can trick a fuse service into asking the mount service helper to undo
the mount just after you've replaced the mount with a symlink to a
sensitive mount (e.g. /sys) then you whack a system hard.
I don't know why this unmounting functionality exists in libfuse, and
apparently Bernd doesn't like it. Since the fuse service API has not
yet been released, let's just rip out the command and pretend it never
existed.
Fixes: 5d8b9a39a1 ("mount_service: add systemd socket service mounting helper")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
115 lines
2.3 KiB
C
115 lines
2.3 KiB
C
/*
|
|
* FUSE: Filesystem in Userspace
|
|
* Copyright (C) 2025-2026 Oracle.
|
|
* Author: Darrick J. Wong <djwong@kernel.org>
|
|
*
|
|
* Stub functions for platforms where we cannot have fuse servers run as "safe"
|
|
* systemd containers.
|
|
*
|
|
* This program can be distributed under the terms of the GNU LGPLv2.
|
|
* See the file LGPL2.txt
|
|
*/
|
|
|
|
/* we don't use any parameters at all */
|
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
|
|
|
#define _GNU_SOURCE
|
|
#include <errno.h>
|
|
|
|
#include "fuse_config.h"
|
|
#include "fuse_i.h"
|
|
#include "fuse_service.h"
|
|
|
|
int fuse_service_receive_file(const struct fuse_service *sf, const char *path,
|
|
int *fdp)
|
|
{
|
|
*fdp = -1;
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
int fuse_service_request_file(const struct fuse_service *sf, const char *path,
|
|
int open_flags, mode_t create_mode,
|
|
unsigned int request_flags)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
int fuse_service_request_blockdev(const struct fuse_service *sf,
|
|
const char *path,
|
|
int open_flags, mode_t create_mode,
|
|
unsigned int request_flags,
|
|
unsigned int block_size)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
int fuse_service_send_goodbye(struct fuse_service *sf, int error)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
int fuse_service_accept(struct fuse_service **sfp)
|
|
{
|
|
*sfp = NULL;
|
|
return 0;
|
|
}
|
|
|
|
bool fuse_service_can_allow_other(const struct fuse_service *sf)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool fuse_service_can_fuseblk(const struct fuse_service *sf)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
int fuse_service_append_args(struct fuse_service *sf,
|
|
struct fuse_args *existing_args)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
char *fuse_service_cmdline(int argc, const char * const *argv,
|
|
struct fuse_args *args)
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
int fuse_service_finish_file_requests(const struct fuse_service *sf)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
void fuse_service_expect_mount_format(struct fuse_service *sf,
|
|
mode_t expected_fmt)
|
|
{
|
|
}
|
|
|
|
int fuse_service_session_mount(struct fuse_service *sf, struct fuse_session *se,
|
|
mode_t expected_fmt,
|
|
struct fuse_cmdline_opts *opts)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
void fuse_service_release(struct fuse_service *sf)
|
|
{
|
|
}
|
|
|
|
void fuse_service_destroy(struct fuse_service **sfp)
|
|
{
|
|
*sfp = NULL;
|
|
}
|
|
|
|
int fuse_service_parse_cmdline_opts(struct fuse_args *args,
|
|
struct fuse_cmdline_opts *opts)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
int fuse_service_exit(int ret)
|
|
{
|
|
return ret;
|
|
}
|