-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QEMU VMs have access to host filesystem via 9p #2385
Comments
Filtering additional options seems to be easier than expected. Here my diff against v2.2.47: It also forbids "-drive" in additional options, as with this option one can pass any host file as a disk device to a VM. Update: Also forbids "-blockdev" and "-hda" .. "-hdd".
|
One side effect: The appliance |
Thanks, I will also add a config option to bypass any filtering. |
QEMU supports the 9p filesystem, a very nice way to access host files from the QEMU VM. For details have a look into the QEMU documentation https://wiki.qemu.org/Documentation/9psetup.
As a GNS3 user can pass any option via the advanced settings to QEMU, he can enable this host access in QEMU. On the VM side a Linux VM is needed with 9p filesystem support. As most Linux distributions support 9p, most Linux VMs can be used, for example the
Alpine Linux Virt
appliance.For a test I enabled 9p to access the full host filesystem by adding
-fsdev local,path=/,security_model=none,id=hostfsdev -device virtio-9p-pci,fsdev=hostfsdev,mount_tag=hostfs
to the advanced settings. In the VM I can access the host by mounting the 9p filesystem.As the QEMU process accesses the host files, the VM has only the privileges of the QEMU user, in the GNS3VM that's user
gns3
. But that is enough to access and even modify quite a lot of the GNS3 server system.This is not a bug in QEMU or Linux, it is the consequence of a GNS3 user being able to pass any option to QEMU. But filtering dangerous options is quite difficult, so I don't know how to deal with this and similar problems.
The text was updated successfully, but these errors were encountered: