Skip to contentSkip to conversation

QEMU/seccomp fixes for PulseAudio

PATCH In review Paul Moore 2 participants 7 messages Jan 15, 2014 – Jan 16, 2014

lore
Share & tools
lore

Paul Moore

author
#0 lore raw

cover QEMU/seccomp fixes for PulseAudio

It turns out we need to add some additional syscalls to QEMU to make PulseAudio happy. Two minor patches follow ...

---

Paul Moore (2):
seccomp: add mkdir() and fchmod() to the whitelist
seccomp: add some basic shared memory syscalls to the whitelist

 qemu-seccomp.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
author
#1 lore raw

PATCH 1/2 seccomp: add mkdir() and fchmod() to the whitelist

The PulseAudio library attempts to do a mkdir(2) and fchmod(2) on "/run/user/<UID>/pulse" which is currently blocked by the syscall filter; this patch adds the two missing syscalls to the whitelist. You can reproduce this problem with the following command:

 # qemu -monitor stdio -device intel-hda -device hda-duplex

If watched under strace the following syscalls are shown:

mkdir("/run/user/0/pulse", 0700)
fchmod(11, 0700) [NOTE: 11 is the fd for /run/user/0/pulse]

---
 qemu-seccomp.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
qemu-seccomp.c +3 -1
index b7c1253..89f244f 100644
@@ -220,7 +220,9 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
     { SCMP_SYS(io_cancel), 241 },
     { SCMP_SYS(io_setup), 241 },
     { SCMP_SYS(io_destroy), 241 },
-    { SCMP_SYS(arch_prctl), 240 }
+    { SCMP_SYS(arch_prctl), 240 },
+    { SCMP_SYS(mkdir), 240 },
+    { SCMP_SYS(fchmod), 240 }
 };
 
 int seccomp_start(void)
author
#3 lore raw

PATCH 2/2 seccomp: add some basic shared memory syscalls to the whitelist

In reply to Paul Moore

PulseAudio requires the use of shared memory so add shmget(), shmat(), and shmdt() to the syscall whitelist.

---
 qemu-seccomp.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
qemu-seccomp.c +4 -1
index 89f244f..caa926e 100644
@@ -222,7 +222,10 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
     { SCMP_SYS(io_destroy), 241 },
     { SCMP_SYS(arch_prctl), 240 },
     { SCMP_SYS(mkdir), 240 },
-    { SCMP_SYS(fchmod), 240 }
+    { SCMP_SYS(fchmod), 240 },
+    { SCMP_SYS(shmget), 240 },
+    { SCMP_SYS(shmat), 240 },
+    { SCMP_SYS(shmdt), 240 }
 };
 
 int seccomp_start(void)
#5 lore raw
In reply to Paul Moore
Quoted 5 lines · Paul Moore

It turns out we need to add some additional syscalls to QEMU to make PulseAudio happy. Two minor patches follow ...

---

Quoted 9 lines

Paul Moore (2):
seccomp: add mkdir() and fchmod() to the whitelist
seccomp: add some basic shared memory syscalls to the whitelist

  qemu-seccomp.c |    7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)

Paul, sorry for the so late review. I was on vacation until yesterday and I'm still trying to empty my inbox.

Signature · 2 lines
Eduardo Otubo
IBM Linux Technology Center
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] seccomp: add mkdir() and fchmod() to the whitelist

In reply to Paul Moore

I have tested and reviewed both patches. And if nothing more comes up, I'll send a pull request by tomorrow EOD.

Quoted 23 lines · Paul Moore

The PulseAudio library attempts to do a mkdir(2) and fchmod(2) on "/run/user/<UID>/pulse" which is currently blocked by the syscall filter; this patch adds the two missing syscalls to the whitelist. You can reproduce this problem with the following command:

  # qemu -monitor stdio -device intel-hda -device hda-duplex

If watched under strace the following syscalls are shown:

mkdir("/run/user/0/pulse", 0700)
fchmod(11, 0700) [NOTE: 11 is the fd for /run/user/0/pulse]

---
  qemu-seccomp.c |    4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
qemu-seccomp.c +0 -0
index b7c1253..89f244f 100644

qemu-seccomp.c static const struct QemuSeccompSyscall seccomp_whitelist[] = { · line 225

Quoted 7 lines
qemu-seccomp.c +3 -1
@@ -220,7 +220,9 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
      { SCMP_SYS(io_cancel), 241 },
      { SCMP_SYS(io_setup), 241 },
      { SCMP_SYS(io_destroy), 241 },
-    { SCMP_SYS(arch_prctl), 240 }
+    { SCMP_SYS(arch_prctl), 240 },
+    { SCMP_SYS(mkdir), 240 },
+    { SCMP_SYS(fchmod), 240 }

ACK.

Signature · 2 lines
Eduardo Otubo
IBM Linux Technology Center
#4 lore raw

Re: [Qemu-devel] [PATCH 2/2] seccomp: add some basic shared memory syscalls to the whitelist

In reply to Paul Moore
Quoted 14 lines · Paul Moore

PulseAudio requires the use of shared memory so add shmget(), shmat(), and shmdt() to the syscall whitelist.

---
  qemu-seccomp.c |    5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
qemu-seccomp.c +0 -0
index 89f244f..caa926e 100644

qemu-seccomp.c static const struct QemuSeccompSyscall seccomp_whitelist[] = { · line 228

Quoted 8 lines
qemu-seccomp.c +4 -1
@@ -222,7 +222,10 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
      { SCMP_SYS(io_destroy), 241 },
      { SCMP_SYS(arch_prctl), 240 },
      { SCMP_SYS(mkdir), 240 },
-    { SCMP_SYS(fchmod), 240 }
+    { SCMP_SYS(fchmod), 240 },
+    { SCMP_SYS(shmget), 240 },
+    { SCMP_SYS(shmat), 240 },
+    { SCMP_SYS(shmdt), 240 }

ACK.

Signature · 2 lines
Eduardo Otubo
IBM Linux Technology Center
author
#6 lore raw
In reply to Eduardo Otubo
Quoted 10 lines · Eduardo Otubo
Quoted 9 lines · Paul Moore

It turns out we need to add some additional syscalls to QEMU to make PulseAudio happy. Two minor patches follow ...

---

Paul Moore (2):
seccomp: add mkdir() and fchmod() to the whitelist
seccomp: add some basic shared memory syscalls to the whitelist

Quoted 5 lines
Quoted 2 lines
  qemu-seccomp.c |    7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)

Paul, sorry for the so late review. I was on vacation until yesterday and I'm still trying to empty my inbox.

No worries. Personally, I wouldn't call a one day turnaround as a late review, I'd call that pretty good :)

Signature · 2 lines
paul moore
security and virtualization @ redhat