summaryrefslogtreecommitdiffstats
path: root/python/guestfs.py
diff options
context:
space:
mode:
authorRichard Jones <rjones@trick.home.annexia.org>2009-09-21 15:27:20 +0100
committerRichard Jones <rjones@trick.home.annexia.org>2009-09-22 11:03:16 +0100
commitae2e569489eea72083aab8109d8012f74587f692 (patch)
treec1e84d581640cfa60626d4f5fa51f2a1410e0446 /python/guestfs.py
parentdcb5aa01835c2cc2310fd8427988a2f2af8924f9 (diff)
downloadlibguestfs-ae2e569489eea72083aab8109d8012f74587f692.tar.gz
libguestfs-ae2e569489eea72083aab8109d8012f74587f692.tar.xz
libguestfs-ae2e569489eea72083aab8109d8012f74587f692.zip
Implement "null vmchannel" - no vmchannel needed!
This commit removes the requirement for vmchannel, although retaining support for it. In this configuration, known as "null vmchannel", the library listens on a random loopback port. It passes the number of this port to the appliance (guestfs_vmchannel=tcp:10.0.2.2:12345), and the daemon then connects back. The library, instead of connecting, listens and accepts the connection during guestfs_launch. QEMU SLIRP (user mode networking) is still required to make this work: SLIRP forwards the TCP connection transparently (instead of explicitly as with guestfwd) to 127.0.0.1:<port> There is a window in which any other local process on the machine could see the port number in the qemu command line and try to connect to it. This would be a devastating security hole, because any local process could pretend to be the daemon and feed back malicious replies to our remote procedure calls. To prevent this, we check the UID of the other side of the TCP connection. If the UID is different from the library's EUID, then we reject the connection. To do this we have to parse /proc/net/tcp. (On Solaris we could use getsockopt (SO_PEERCRED), but this doesn't work on Linux TCP sockets). Other vmchannel(s) are still supported. This is important, because we can't in general be sure the qemu will always support SLIRP. In particular, in recent versions of qemu it is possible to compile out SLIRP.
Diffstat (limited to 'python/guestfs.py')
0 files changed, 0 insertions, 0 deletions