Revision a2d8f1be

b/Makefile
38 38

  
39 39
ifdef BUILD_DOCS
40 40
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
41
DOCS+=fsdev/virtfs-proxy-helper.1
41 42
else
42 43
DOCS=
43 44
endif
......
289 290
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
290 291
	$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
291 292
endif
292

  
293
ifdef CONFIG_VIRTFS
294
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
295
	$(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
296
endif
293 297
install-sysconfig:
294 298
	$(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)/qemu"
295 299
	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu"
......
373 377
	  pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \
374 378
	  "  GEN   $@")
375 379

  
380
fsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
381
	$(call quiet-command, \
382
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
383
	  pod2man --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
384
	  "  GEN   $@")
385

  
376 386
qemu-nbd.8: qemu-nbd.texi
377 387
	$(call quiet-command, \
378 388
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
b/fsdev/virtfs-proxy-helper.texi
1
@example
2
@c man begin SYNOPSIS
3
usage: virtfs-proxy-helper options
4
@c man end
5
@end example
6

  
7
@c man begin DESCRIPTION
8
@table @description
9
Pass-through security model in QEMU 9p server needs root privilege to do
10
few file operations (like chown, chmod to any mode/uid:gid).  There are two
11
issues in pass-through security model
12

  
13
1) TOCTTOU vulnerability: Following symbolic links in the server could
14
provide access to files beyond 9p export path.
15

  
16
2) Running QEMU with root privilege could be a security issue.
17

  
18
To overcome above issues, following approach is used: A new filesytem
19
type 'proxy' is introduced. Proxy FS uses chroot + socket combination
20
for securing the vulnerability known with following symbolic links.
21
Intention of adding a new filesystem type is to allow qemu to run
22
in non-root mode, but doing privileged operations using socket IO.
23

  
24
Proxy helper(a stand alone binary part of qemu) is invoked with
25
root privileges. Proxy helper chroots into 9p export path and creates
26
a socket pair or a named socket based on the command line parameter.
27
Qemu and proxy helper communicate using this socket. QEMU proxy fs
28
driver sends filesystem request to proxy helper and receives the
29
response from it.
30

  
31
Proxy helper is designed so that it can drop the root privilege with
32
retaining capbilities needed for doing filesystem operations only.
33

  
34
@end table
35
@c man end
36

  
37
@c man begin OPTIONS
38
The following options are supported:
39
@table @option
40
@item -h
41
@findex -h
42
Display help and exit
43
@item -p|--path path
44
Path to export for proxy filesystem driver
45
@item -f|--fd socket-id
46
Use given file descriptor as socket descriptor for communicating with
47
qemu proxy fs drier. Usually a helper like libvirt will create
48
socketpair and pass one of the fds as parameter to -f|--fd
49
@item -n|--nodaemon
50
Run as a normal program. By default program will run in daemon mode
51
@end table
52
@c man end
53

  
54
@setfilename virtfs-proxy-helper
55
@settitle QEMU 9p virtfs proxy filesystem helper
56

  
57
@c man begin AUTHOR
58
M. Mohan Kumar
59
@c man end

Also available in: Unified diff