Skip to contentSkip to conversation

seccomp branch queue

GIT PULL Applied Eduardo Otubo 2 participants 4 messages Nov 11, 2014

lore
Share & tools
lore
#0 lore raw

Hi,

This is the seccomp branch queue with fixes regarding a build crach on armv7l and adding new syscalls to the whitelist. Details below.

The following changes since commit 6e76d125f244e10676b917208f2a074729820246:

Update version for v2.2.0-rc0 release (2014-11-05 15:21:04 +0000)

are available in the git repository at:

git://github.com/otubo/qemu.git tags/pull-seccomp-20141111

for you to fetch changes up to 4cc47f8b3cc4f32586ba2f7fce1dc267da774a69:

seccomp: change configure to avoid arm 32 to break (2014-11-11 17:05:21 +0100)

----------------------------------------------------------------
seccomp: change configure to avoid arm 32 to break
seccomp: whitelist syscalls fallocate(), fadvise64(), inotify_init1() and inotify_add_watch()
----------------------------------------------------------------
Eduardo Otubo (1):
seccomp: change configure to avoid arm 32 to break

Philipp Gesang (1):
seccomp: whitelist syscalls fallocate(), fadvise64(), inotify_init1() and inotify_add_watch()

 configure      | 3 ++-
 qemu-seccomp.c | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

Eduardo Otubo (1):
seccomp: change configure to avoid arm 32 to break

Philipp Gesang (1):
seccomp: whitelist syscalls fallocate(), fadvise64(), inotify_init1()
and inotify_add_watch()

 configure      | 3 ++-
 qemu-seccomp.c | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

[Qemu-devel] [PULL 2/2] seccomp: change configure to avoid arm 32 to break

Current stable version of libseccomp (2.1.1) only supports i386 and x86_64 archs correctly. This patch limits the usage of the syscall filter for those archs and updates to the correct last version of libseccomp.

This patch also fixes the bug:
https://bugs.launchpad.net/qemu/+bug/1363641

---
 configure | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
configure +2 -1
index 2f17bf3..47048f0 100755
@@ -1823,7 +1823,8 @@ fi
 # libseccomp check
 
 if test "$seccomp" != "no" ; then
-    if $pkg_config --atleast-version=2.1.0 libseccomp; then
+    if test "$cpu" = "i386" || test "$cpu" = "x86_64" &&
+        $pkg_config --atleast-version=2.1.1 libseccomp; then
         libs_softmmu="$libs_softmmu `$pkg_config --libs libseccomp`"
         QEMU_CFLAGS="$QEMU_CFLAGS `$pkg_config --cflags libseccomp`"
 	seccomp="yes"
Signature · 1 line
1.9.1
#2 lore raw

[Qemu-devel] [PULL 1/2] seccomp: whitelist syscalls fallocate(), fadvise64(), inotify_init1() and inotify_add_watch()

In reply to Eduardo Otubo

From: Philipp Gesang <[email protected]>

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.

---
 qemu-seccomp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
qemu-seccomp.c +5 -1
index 0503764..af6a375 100644
@@ -231,7 +231,11 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
     { SCMP_SYS(shmctl), 240 },
     { SCMP_SYS(mlock), 240 },
     { SCMP_SYS(munlock), 240 },
-    { SCMP_SYS(semctl), 240 }
+    { SCMP_SYS(semctl), 240 },
+    { SCMP_SYS(fallocate), 240 },
+    { SCMP_SYS(fadvise64), 240 },
+    { SCMP_SYS(inotify_init1), 240 },
+    { SCMP_SYS(inotify_add_watch), 240 }
 };
 
 int seccomp_start(void)
Signature · 1 line
1.9.1
#3 lore raw
In reply to Eduardo Otubo
Quoted 13 lines · Eduardo Otubo

Hi,

This is the seccomp branch queue with fixes regarding a build crach on armv7l and adding new syscalls to the whitelist. Details below.

The following changes since commit 6e76d125f244e10676b917208f2a074729820246:

Update version for v2.2.0-rc0 release (2014-11-05 15:21:04 +0000)

are available in the git repository at:

git://github.com/otubo/qemu.git tags/pull-seccomp-20141111

Quoted 8 lines

for you to fetch changes up to 4cc47f8b3cc4f32586ba2f7fce1dc267da774a69:

seccomp: change configure to avoid arm 32 to break (2014-11-11 17:05:21 +0100)

----------------------------------------------------------------
seccomp: change configure to avoid arm 32 to break
seccomp: whitelist syscalls fallocate(), fadvise64(), inotify_init1() and inotify_add_watch()
----------------------------------------------------------------

Applied, thanks.

-- PMM