seccomp: really fix blocking of setns/execveat/unshare
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)
Signed-off-by Daniel P. Berrangé <[email protected]>
--- system/qemu-seccomp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
system/qemu-seccomp.c +3 -3
@@ -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
Quoted 8 lines · Daniel P. Berrangé
The previous fix for setns/execveat/unshare mistakenly copy and pasted the
clone_argsfilter, which is inappropriate for these syscalls and had the effect of weakening the seccomp filter.Fixes f33fb19cab (seccomp: fix blocking of setns/execveat/unshare)Signed-off-by Daniel P. Berrangé <[email protected]>
Reviewed-by Marc-André Lureau <[email protected]>
Quoted 28 lines
--- system/qemu-seccomp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)system/qemu-seccomp.c +3
-4@@ -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