]> git.proxmox.com Git - mirror_qemu.git/commit - qemu-seccomp.c
seccomp: whitelist syscalls fallocate(), fadvise64(), inotify_init1() and inotify_add...
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Fri, 5 Sep 2014 16:29:31 +0000 (18:29 +0200)
committerEduardo Otubo <eduardo.otubo@profitbricks.com>
Tue, 11 Nov 2014 16:01:35 +0000 (17:01 +0100)
commitf73adec7097ebdbc7168453e638735391a6f7112
tree269ecc21b0b76cf33ba1ceae1b8d3fa2dbcafdbe
parent6e76d125f244e10676b917208f2a074729820246
seccomp: whitelist syscalls fallocate(), fadvise64(), inotify_init1() and inotify_add_watch()

fallocate() is needed for snapshotting. If it isn’t whitelisted

    $ qemu-img create -f qcow2 x.qcow 1G
    Formatting 'x.qcow', fmt=qcow2 size=1073741824 encryption=off cluster_size=65536 lazy_refcounts=off
    $ qemu-kvm -display none -monitor stdio -sandbox on x.qcow
    QEMU 2.1.50 monitor - type 'help' for more information
    (qemu) savevm foo
    (qemu) loadvm foo

will fail, as will subsequent savevm commands on the same image.

fadvise64(), inotify_init1(), inotify_add_watch() are needed by
the SDL display. Without the whitelist entries,

    qemu-kvm -sandbox on

fails immediately.

In my tests fadvise64() is called 50--51 times per VM run. That
number seems independent of the duration of the run. fallocate(),
inotify_init1(), inotify_add_watch() are called once each.
Accordingly, they are added to the whitelist at a very low
priority.

Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com>
Signed-off-by: Eduardo Otubo <eduardo.otubo@profitbricks.com>
qemu-seccomp.c