Skip to contentSkip to conversation

seccomp: really fix blocking of setns/execveat/unshare

PATCH In review Daniel P. Berrangé 2 participants 2 messages Oct 12

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 seccomp: really fix blocking of setns/execveat/unshare

The previous fix for setns/execveat/unshare mistakenly copy and pasted the clone_args filter, which is inappropriate for these syscalls and had the effect of weakening the seccomp filter.

Fixes f33fb19cab (seccomp: fix blocking of setns/execveat/unshare)
---
 system/qemu-seccomp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
system/qemu-seccomp.c +3 -3
index 3889d48b4f2..cd2c1b0b747 100644
@@ -250,12 +250,12 @@ static const struct QemuSeccompSyscall denylist[] = {
 #endif
 #ifdef __SNR_execveat
     { SCMP_SYS(execveat),               QEMU_SECCOMP_SET_SPAWN,
-      ARRAY_SIZE(clone_arg_none), clone_arg_none, SCMP_ACT_ERRNO(EPERM) },
+      0, NULL, SCMP_ACT_ERRNO(EPERM) },
 #endif
     { SCMP_SYS(setns),                  QEMU_SECCOMP_SET_SPAWN,
-      ARRAY_SIZE(clone_arg_none), clone_arg_none, SCMP_ACT_ERRNO(EPERM) },
+      0, NULL, SCMP_ACT_ERRNO(EPERM) },
     { SCMP_SYS(unshare),                QEMU_SECCOMP_SET_SPAWN,
-      ARRAY_SIZE(clone_arg_none), clone_arg_none, SCMP_ACT_ERRNO(EPERM) },
+      0, NULL, SCMP_ACT_ERRNO(EPERM) },
     /* resource control */
     { SCMP_SYS(setpriority),            QEMU_SECCOMP_SET_RESOURCECTL,
       0, NULL, SCMP_ACT_ERRNO(EPERM) },
Signature · 1 line
2.56.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Daniel P. Berrangé

The previous fix for setns/execveat/unshare mistakenly copy and pasted the clone_args filter, which is inappropriate for these syscalls and had the effect of weakening the seccomp filter.

Fixes f33fb19cab (seccomp: fix blocking of setns/execveat/unshare)
Quoted 28 lines
---
 system/qemu-seccomp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
system/qemu-seccomp.c +3 -4
index 3889d48b4f2..cd2c1b0b747 100644
@@ -250,12 +250,12 @@ static const struct QemuSeccompSyscall denylist[] = {
 #endif
 #ifdef __SNR_execveat
     { SCMP_SYS(execveat),               QEMU_SECCOMP_SET_SPAWN,
-      ARRAY_SIZE(clone_arg_none), clone_arg_none, SCMP_ACT_ERRNO(EPERM) },
+      0, NULL, SCMP_ACT_ERRNO(EPERM) },
 #endif
     { SCMP_SYS(setns),                  QEMU_SECCOMP_SET_SPAWN,
-      ARRAY_SIZE(clone_arg_none), clone_arg_none, SCMP_ACT_ERRNO(EPERM) },
+      0, NULL, SCMP_ACT_ERRNO(EPERM) },
     { SCMP_SYS(unshare),                QEMU_SECCOMP_SET_SPAWN,
-      ARRAY_SIZE(clone_arg_none), clone_arg_none, SCMP_ACT_ERRNO(EPERM) },
+      0, NULL, SCMP_ACT_ERRNO(EPERM) },
     /* resource control */
     { SCMP_SYS(setpriority),            QEMU_SECCOMP_SET_RESOURCECTL,
       0, NULL, SCMP_ACT_ERRNO(EPERM) },
--

2.56.0

Signature · 1 line
Marc-André Lureau