blob: 679488e5ee853c5c294b2cc22a64b4886c4e3eb4 [file] [log] [blame]
Miklos Szeredi8cffdb92001-11-09 14:49:18 +00001General Information
2===================
3
4FUSE (Filesystem in USErspace) is a simple interface for userspace
5programs to export a virtual filesystem to the linux kernel. FUSE
6also aims to provide a secure method for non privileged users to
7create and mount their own filesystem implementations.
8
9You can download the source code releases from
10
11 http://sourceforge.net/projects/avf
12
13or alternatively you can use CVS to get the very latest development
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000014version by setting the cvsroot to
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000015
16 :pserver:anonymous@cvs.avf.sourceforge.net:/cvsroot/avf
17
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000018and checking out the 'fuse' module.
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000019
20Installation
21============
22
23See the file 'INSTALL'
24
25IMPORTANT NOTE: If you run a system with untrusted users, installing
26this program is not recommended, as it could be used to breach
27security (see the 'Security' section for explanation).
28
29How To Use
30==========
31
32FUSE is made up of three main parts:
33
34 - A kernel filesystem module (kernel/fuse.o)
35
36 - A userspace library (lib/libfuse.a)
37
38 - A mount/unmount program (util/fusermount)
39
40
41Here's how to create your very own virtual filesystem in five easy
42steps:
43
44 1) Edit the file example/fusexmp.c to do whatever you want...
45
46 2) Build the fusexmp program
47
48 3) run 'util/fusermount /mnt/whatever example/fusexmp -d'
49
50 4) ls -al /mnt/whatever
51
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000052 5) Be glad
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000053
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000054If it doesn't work out, please ask! Also see the file 'include/fuse.h' for
55detailed documentation of the library interface.
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000056
57
58Security
59========
60
61If you run 'make install', the fusermount program is installed
62set-user-id to root. This is done to allow normal users to mount
63their own filesystem implementations.
64
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000065There must however be some limitations, in order to prevent Bad User from
66doing nasty things. Currently those limitations are:
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000067
68 - The user can only mount on a mountpoint, for which it has write
69 permission
70
71 - The mountpoint is not a sticky directory which isn't owned by the
72 user (like /tmp usually is)
73
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000074 - No other user (including root) can access the contents of the mounted
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000075 filesystem.
76
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000077When linux will have private namespaces (as soon as version 2.5 comes out
78hopefully) then this third condition is useless and can be gotten rid of.
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000079
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000080Currently the first two conditions are checked by the fusermount program
81before doing the mount. This has the nice feature, that it's totally
82useless. Here's why:
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000083
84 - user creates /tmp/mydir
85 - user starts fusermount
86 - user removes /tmp/mydir just after fusermount checked that it is OK
87 - user creates symlink: ln -s / /tmp/mydir
88 - fusermount actually mounts user's filesystem on '/'
89 - this is bad :(
90
91So to make this secure, the checks must be done by the kernel. And so
92there is a patch (patch/ms_permission.patch) which does exactly this.
93This is against 2.4.14, but applies to some earlier kernels (not too
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000094much earlier though), and possibly some later.
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000095