|
|
9ae3a8 |
From 982a3d6d0569bed08ee7d31380271abe69d836b4 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
9ae3a8 |
Date: Thu, 30 Apr 2015 10:31:57 +0200
|
|
|
9ae3a8 |
Subject: [PATCH 1/4] seccomp: add timerfd_create and timerfd_settime to the
|
|
|
9ae3a8 |
whitelist
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Message-id: <1430389917-29237-2-git-send-email-kraxel@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 64959
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.1 qemu-kvm PATCH 1/1] seccomp: add timerfd_create and timerfd_settime to the whitelist
|
|
|
9ae3a8 |
Bugzilla: 1185737
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Felix Geyer <debfx@fobos.de>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
libusb calls timerfd_create() and timerfd_settime() when it's built with
|
|
|
9ae3a8 |
timerfd support.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Command to reproduce:
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-device usb-host,hostbus=1,hostaddr=3,id=hostdev0
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Log messages:
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
audit(1390730418.924:135): auid=4294967295 uid=121 gid=103 ses=4294967295
|
|
|
9ae3a8 |
pid=5232 comm="qemu-system-x86" sig=31 syscall=283
|
|
|
9ae3a8 |
compat=0 ip=0x7f2b0f4e96a7 code=0x0
|
|
|
9ae3a8 |
audit(1390733100.580:142): auid=4294967295 uid=121 gid=103 ses=4294967295
|
|
|
9ae3a8 |
pid=16909 comm="qemu-system-x86" sig=31 syscall=286
|
|
|
9ae3a8 |
compat=0 ip=0x7f03513a06da code=0x0
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Reading a few hundred MB from a USB drive on x86_64 shows this syscall distribution.
|
|
|
9ae3a8 |
Therefore the timerfd_settime priority is set to 242.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
calls syscall
|
|
|
9ae3a8 |
--------- ----------------
|
|
|
9ae3a8 |
5303600 write
|
|
|
9ae3a8 |
2240554 read
|
|
|
9ae3a8 |
2167030 ppoll
|
|
|
9ae3a8 |
2134828 ioctl
|
|
|
9ae3a8 |
704023 timerfd_settime
|
|
|
9ae3a8 |
689105 poll
|
|
|
9ae3a8 |
83122 futex
|
|
|
9ae3a8 |
803 writev
|
|
|
9ae3a8 |
476 rt_sigprocmask
|
|
|
9ae3a8 |
287 recvmsg
|
|
|
9ae3a8 |
178 brk
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Felix Geyer <debfx@fobos.de>
|
|
|
9ae3a8 |
Signed-off-by: Eduardo Otubo <otubo@linux.vnet.ibm.com>
|
|
|
9ae3a8 |
(cherry picked from commit 84397618529f920bea45d0bab22ec097766244fc)
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Conflicts:
|
|
|
9ae3a8 |
qemu-seccomp.c
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
qemu-seccomp.c | 4 +++-
|
|
|
9ae3a8 |
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
qemu-seccomp.c | 4 +++-
|
|
|
9ae3a8 |
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/qemu-seccomp.c b/qemu-seccomp.c
|
|
|
9ae3a8 |
index 59cae8e..5e60fce 100644
|
|
|
9ae3a8 |
--- a/qemu-seccomp.c
|
|
|
9ae3a8 |
+++ b/qemu-seccomp.c
|
|
|
9ae3a8 |
@@ -154,6 +154,7 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
|
|
|
9ae3a8 |
{ SCMP_SYS(getsockname), 242 },
|
|
|
9ae3a8 |
{ SCMP_SYS(getpeername), 242 },
|
|
|
9ae3a8 |
{ SCMP_SYS(accept4), 242 },
|
|
|
9ae3a8 |
+ { SCMP_SYS(timerfd_settime), 242 },
|
|
|
9ae3a8 |
{ SCMP_SYS(newfstatat), 241 },
|
|
|
9ae3a8 |
{ SCMP_SYS(shutdown), 241 },
|
|
|
9ae3a8 |
{ SCMP_SYS(getsockopt), 241 },
|
|
|
9ae3a8 |
@@ -246,7 +247,8 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
|
|
|
9ae3a8 |
{ SCMP_SYS(shmctl), 240 },
|
|
|
9ae3a8 |
{ SCMP_SYS(mlock), 240 },
|
|
|
9ae3a8 |
{ SCMP_SYS(munlock), 240 },
|
|
|
9ae3a8 |
- { SCMP_SYS(semctl), 240 }
|
|
|
9ae3a8 |
+ { SCMP_SYS(semctl), 240 },
|
|
|
9ae3a8 |
+ { SCMP_SYS(timerfd_create), 240 },
|
|
|
9ae3a8 |
};
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
int seccomp_start(void)
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|