cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-tools-virtiofsd-Add-fstatfs64-syscall-to-the-seccomp.patch

a83cc2
From 2f84739e8f2928b98190f76035e00db82ef6dc7e Mon Sep 17 00:00:00 2001
a83cc2
From: Thomas Huth <thuth@redhat.com>
a83cc2
Date: Tue, 14 Sep 2021 13:29:59 +0200
a83cc2
Subject: [PATCH] tools/virtiofsd: Add fstatfs64 syscall to the seccomp
a83cc2
 allowlist
a83cc2
MIME-Version: 1.0
a83cc2
Content-Type: text/plain; charset=UTF-8
a83cc2
Content-Transfer-Encoding: 8bit
a83cc2
a83cc2
RH-Author: Thomas Huth <thuth@redhat.com>
a83cc2
RH-MergeRequest: 37: tools/virtiofsd: Add fstatfs64 syscall to the seccomp allowlist
a83cc2
RH-Commit: [1/1] 464231b7cfa7159d9adfc4fc01b26bc3b3a66ecd
a83cc2
RH-Bugzilla: 2001728
a83cc2
RH-Acked-by: Daniel P. Berrangé <berrange@redhat.com>
a83cc2
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
a83cc2
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
a83cc2
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
a83cc2
a83cc2
The virtiofsd currently crashes on s390x when doing something like
a83cc2
this in the guest:
a83cc2
a83cc2
 mkdir -p /mnt/myfs
a83cc2
 mount -t virtiofs myfs /mnt/myfs
a83cc2
 touch /mnt/myfs/foo.txt
a83cc2
 stat -f /mnt/myfs/foo.txt
a83cc2
a83cc2
The problem is that the fstatfs64 syscall is called in this case
a83cc2
from the virtiofsd. We have to put it on the seccomp allowlist to
a83cc2
avoid that the daemon gets killed in this case.
a83cc2
a83cc2
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2001728
a83cc2
Suggested-by: Vivek Goyal <vgoyal@redhat.com>
a83cc2
Signed-off-by: Thomas Huth <thuth@redhat.com>
a83cc2
---
a83cc2
 tools/virtiofsd/passthrough_seccomp.c | 1 +
a83cc2
 1 file changed, 1 insertion(+)
a83cc2
a83cc2
diff --git a/tools/virtiofsd/passthrough_seccomp.c b/tools/virtiofsd/passthrough_seccomp.c
a83cc2
index 62441cfcdb..2edbd3af95 100644
a83cc2
--- a/tools/virtiofsd/passthrough_seccomp.c
a83cc2
+++ b/tools/virtiofsd/passthrough_seccomp.c
a83cc2
@@ -51,6 +51,7 @@ static const int syscall_allowlist[] = {
a83cc2
     SCMP_SYS(fsetxattr),
a83cc2
     SCMP_SYS(fstat),
a83cc2
     SCMP_SYS(fstatfs),
a83cc2
+    SCMP_SYS(fstatfs64),
a83cc2
     SCMP_SYS(fsync),
a83cc2
     SCMP_SYS(ftruncate),
a83cc2
     SCMP_SYS(futex),
a83cc2
-- 
a83cc2
2.27.0
a83cc2