Definitions
~~~~~~~~~~~
Userspace filesystem:
A filesystem in which data and metadata are provided by an ordinary
userspace process. The filesystem can be accessed normally through
the kernel interface.
Filesystem daemon:
The process(es) providing the data and metadata of the filesystem.
Non-privileged mount (or user mount):
A userspace filesystem mounted by a non-privileged (non-root) user.
The filesystem daemon is running with the privileges of the mounting
user. NOTE: this is not the same as mounts allowed with the "user"
option in /etc/fstab, which is not discussed here.
Filesystem connection:
A connection between the filesystem daemon and the kernel. The
connection exists until either the daemon dies, or the filesystem is
umounted. Note that detaching (or lazy umounting) the filesystem
does _not_ break the connection, in this case it will exist until
the last reference to the filesystem is released.
Mount owner:
The user who does the mounting.
User:
The user who is performing filesystem operations.
What is FUSE?
~~~~~~~~~~~~~
FUSE is a userspace filesystem framework. It consists of a kernel
module (fuse.ko), a userspace library (libfuse.*) and a mount utility
(fusermount).
One of the most important features of FUSE is allowing secure,
non-privileged mounts. This opens up new possibilities for the use of
filesystems. A good example is sshfs: a secure network filesystem
using the sftp protocol.
The userspace library and utilities are available from the FUSE
homepage:
http://fuse.sourceforge.net/
Filesystem type
~~~~~~~~~~~~~~~
The filesystem type given to mount(2) can be one of the following:
'fuse'
This is the usual way to mount a FUSE filesystem. The first
argument of the mount system call may contain an arbitrary string,
which is not interpreted by the kernel.
'fuseblk'
The filesystem is block device based. The first argument of the
mount system call is interpreted as the name of the device.
Mount options
~~~~~~~~~~~~~
'fd=N'
The file descriptor to use for communication between the userspace
filesystem and the kernel. The file descriptor must have been
obtained by opening the FUSE device ('/dev/fuse').
'rootmode=M'
The file mode of the filesystem's root in octal representation.
'user_id=N'
The numeric user id of the mount owner.
'group_id=N'
The numeric group id of the mount owner.
'default_permissions'
By default FUSE doesn't check file access permissions, the
filesystem is free to implement it's access policy or leave it to
the underlying file access mechanism (e.g. in case of network
filesystems). This option enables permission checking, restricting
access based on file mode. It is usually useful together with the
'allow_other' mount option.
'allow_other'
This option overrides the security measure restricting file access
to the user mounting the filesystem. This option is by default only
allowed to root, but this restriction can be removed with a
(userspace) configuration option.
'max_read=N'
With this option the maximum size of read operations can be set.
The default is infinite. Note that the size of read requests is
limited anyway to 32 pages (which is 128kbyte on i386).
'blksize=N'
Set the block size for the filesystem. The default is 512. This
option is only valid for 'fuseblk' type mounts.
Control filesystem
~~~~~~~~~~~~~~~~~~
There's a control filesystem for FUSE, which can be mounted by:
mount -t fusectl none /sys/fs/fuse/connections
Mounting it under the '/sys/fs/fuse/connections' directory makes it
backwards compatible with earlier versions.
Under the fuse control filesystem each connection has a directory
named by a unique number.
For each connection the following files exist within this directory:
'waiting'
The number of requests which are waiting to be transferred to
userspace or being processed by the filesystem daemon. If there is
no filesystem activity and 'waiting' is non-zero, then the
filesystem is hung or deadlocked.
'abort'
Writing anything into this file will abort the filesystem
connection. This means that all waiting requests will be aborted an
error returned for all aborted and new requests.
Only the owner of the mount may read or write these files.
Interrupting filesystem operations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If a process issuing a FUSE filesystem request is interrupted, the
following will happen:
1) If the request is not yet sent to userspace AND the signal is
fatal (SIGKILL or unhandled fatal signal), then the request is
dequeued and returns immediately.
2) If the request is not yet sent to userspace AND the signal is not
fatal, then an 'interrupted' flag is set for the request. When
the request has been successfully transferred to userspace and
this flag is set, an INTERRUPT request is queued.
3) If the request is already sent to userspace, then an INTERRUPT
request is queued.
INTERRUPT requests take precedence over other requests, so the
userspace filesystem will receive queued INTERRUPTs before any others.
The userspace filesystem may ignore the INTERRUPT requests entirely,
or may honor them by sending a reply to the _original_ request, with
the error set to EINTR.
It is also possible that there's a race between processing the
original request and it's INTERRUPT request. There are two possibilities:
1) The INTERRUPT request is processed before the original request is
processed
2) The INTERRUPT request is processed after the original request has
been answered
If the filesystem cannot find the original request, it should wait for
some timeout and/or a number of new requests to arrive, after which it
should reply to the INTERRUPT request with an EAGAIN error. In case
1) the INTERRUPT request will be requeued. In case 2) the INTERRUPT
reply will be ignored.
Aborting a filesystem connection
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is possible to get into certain situations where the filesystem is
not responding. Reasons for this may be:
a) Broken userspace filesystem implementation
b) Network connection down
c) Accidental deadlock
d) Malicious deadlock
(For more on c) and d) see later sections)
In either of these cases it may be useful to abort the connection to
the filesystem. There are several ways to do this:
- Kill the filesystem daemon. Works in case of a) and b)
- Kill the filesystem daemon and all users of the filesystem. Works
in all cases except some malicious deadlocks
- Use forced umount (umount -f). Works in all cases but only if
filesystem is still attached (it hasn't been lazy unmounted)
- Abort filesystem through the FUSE control filesystem. Most
powerful method, always works.
How do non-privileged mounts work?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Since the mount() system call is a privileged operation, a helper
program (fusermount) is needed, which is installed setuid root.
The implication of providing non-privileged mounts is that the mount
owner must not be able to use this capability to compromise the
system. Obvious requirements arising from this are:
A) mount owner should not be able to get elevated privileges with the
help of the mounted filesystem
B) mount owner should not get illegitimate access to information from
other users' and the super user's processes
C) mount owner should not be able to induce undesired behavior in
other users' or the super user's processes
How are requirements fulfilled?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A) The mount owner could gain elevated privileges by either:
1) creating a filesystem containing a device file, then opening
this device
2) creating a filesystem containing a suid or sgid application,
then executing this application
The solution is not to allow opening device files and ignore
setuid and setgid bits when executing programs. To
没有合适的资源?快使用搜索试试~ 我知道了~
fuse-2.8.5.tar.gz
5星 · 超过95%的资源 需积分: 39 25 下载量 144 浏览量
2017-10-17
14:04:13
上传
评论
收藏 492KB GZ 举报
温馨提示
共89个文件
c:30个
h:15个
in:8个
mfs客户端连接插件,安装用的是三招:./configure;make ;make install
资源推荐
资源详情
资源评论
收起资源包目录
fuse-2.8.5.tar.gz (89个子文件)
fuse-2.8.5
README.NFS 1KB
example
fioclient.c 2KB
cusexmp.c 6KB
hello.c 2KB
fioc.c 4KB
fusexmp.c 6KB
Makefile.am 498B
fselclient.c 1KB
Makefile.in 21KB
hello_ll.c 4KB
fsel.c 6KB
fusexmp_fh.c 8KB
fioc.h 747B
null.c 2KB
FAQ 15KB
COPYING.LIB 25KB
m4
ltversion.m4 701B
ltsugar.m4 4KB
ltoptions.m4 12KB
libtool.m4 254KB
lt~obsolete.m4 6KB
depcomp 18KB
include
fuse_kernel.h 12KB
old
fuse.h 246B
fuse_opt.h 7KB
fuse_lowlevel_compat.h 7KB
ulockmgr.h 679B
config.h.in 2KB
fuse_common.h 8KB
fuse.h 29KB
Makefile.am 344B
Makefile.in 15KB
fuse_compat.h 8KB
fuse_common_compat.h 714B
fuse_lowlevel.h 43KB
cuse_lowlevel.h 3KB
aclocal.m4 87KB
Filesystems 256B
compile 4KB
config.guess 44KB
Makefile.am 321B
config.sub 34KB
configure.in 3KB
README 11KB
fuse.pc.in 242B
Makefile.in 24KB
INSTALL 15KB
missing 11KB
install-sh 13KB
AUTHORS 84B
doc
kernel.txt 16KB
how-fuse-works 2KB
Doxyfile 58KB
configure 459KB
ltmain.sh 238KB
lib
fuse_kern_chan.c 2KB
cuse_lowlevel.c 9KB
mount_bsd.c 8KB
ulockmgr.c 9KB
fuse_signals.c 2KB
fuse_versionscript 3KB
helper.c 10KB
fuse_loop_mt.c 5KB
fuse_mt.c 2KB
Makefile.am 933B
mount.c 13KB
fuse_opt.c 9KB
fuse.c 91KB
Makefile.in 21KB
fuse_session.c 4KB
fuse_misc.h 2KB
mount_util.c 8KB
fuse_lowlevel.c 45KB
fuse_i.h 2KB
mount_util.h 657B
fuse_loop.c 865B
modules
iconv.c 15KB
subdir.c 14KB
NEWS 6KB
ChangeLog 91KB
util
init_script 2KB
ulockmgr_server.c 8KB
udev.rules 28B
Makefile.am 2KB
Makefile.in 23KB
fusermount.c 27KB
mount.fuse.c 4KB
config.rpath 18KB
COPYING 18KB
共 89 条
- 1
资源评论
- ICT_杜臻2018-03-07很好用,可以试试
- buster1332018-02-05还不错,能用
超级大饭粒
- 粉丝: 95
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于SpringBoot+Vue3快速开发平台、自研工作流引擎源码设计.zip
- docker安装部署全流程
- 基于树莓派的人脸识别系统python源码+项目部署说明+超详细代码注释.zip
- Python和R爬取分析赶集网北京二手房数据.zip
- Python和R爬取分析赶集网北京二手房数据.zip
- Java知识体系最强总结(2021版).txt
- Python知识点Python知识点Python知识点Python知识点Python知识点PythonPython知识点.txt
- Java开发基于seetaface6的人脸识别(活体检测)的封装源码.zip
- JSP在线失物招领管理平台源码.zip
- JSP在线旅游美食展现管理系统源码.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功