From nobody Fri Mar 29 13:00:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631623104; cv=none; d=zohomail.com; s=zohoarc; b=capovtD7B5Ag4yW/WhkQR5WiFuYIHUrugeq/bPiKcdwor7pz6lKdGQzhDKlzGUNClVAaNyA6L/5VUjksNCPN1j1ry4KpC62l6QfXnjYkjuyuLvkn+JHQzgHsUpO5iuF8FRj0c8SFC+Y7TGbOZjjUYh50bAGWwHMIQ9tDm0f06ew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631623104; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=fg1N306RcDyMZNsEoKJgAan2OpA9i+fkPT3vtCeFUHM=; b=HQZ01NnxQxTCU1XlPiRIKVsoDRSZg/Sao2rslHkACHTcahaSMe6nj/l9PgqiPJLs9eIHbrtpoZy9wATBJm3kpwlT9C4JDn6Ztc8Ic0Lv6UDe0JmdLNDGl7H3RiGT3Iaqf4dXdtENfQW6XnHAXTuwVZ0zDJYXIfVAC0NOdA2d/PI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1631623104517527.4315651795105; Tue, 14 Sep 2021 05:38:24 -0700 (PDT) Received: from localhost ([::1]:37320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQ7hf-0003M9-EN for importer@patchew.org; Tue, 14 Sep 2021 08:38:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQ7c5-0003q3-Uw for qemu-devel@nongnu.org; Tue, 14 Sep 2021 08:32:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:49797) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQ7c4-0001E2-07 for qemu-devel@nongnu.org; Tue, 14 Sep 2021 08:32:37 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-308-ryE-sHCbPI2VvlR7BEStzA-1; Tue, 14 Sep 2021 08:32:33 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9766E1808312; Tue, 14 Sep 2021 12:32:32 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.118]) by smtp.corp.redhat.com (Postfix) with ESMTP id 70D2260C2B; Tue, 14 Sep 2021 12:32:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631622754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fg1N306RcDyMZNsEoKJgAan2OpA9i+fkPT3vtCeFUHM=; b=CvRXsB14aeuC5GvqJSN4uQTSlBr2oarnXnsPP2JjAn0Attn36VWl6mDq7/XVcTZX8Fw+AT UrWI6fYCtUSFKJhzF3Bl0Gk9+fPFIHS2LyUSVPEBs4l5SKA7RbH+arSUKd3HE1S2HZ6wx3 IXG/IzjR11zqu8vdpsFrcy2IbC/ilbs= X-MC-Unique: ryE-sHCbPI2VvlR7BEStzA-1 From: Thomas Huth To: qemu-devel@nongnu.org, virtio-fs@redhat.com, "Dr. David Alan Gilbert" , Stefan Hajnoczi Subject: [PATCH] tools/virtiofsd: Add fstatfs64 syscall to the seccomp allowlist Date: Tue, 14 Sep 2021 14:32:14 +0200 Message-Id: <20210914123214.181885-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.398, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-s390x@nongnu.org, Vivek Goyal Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631623105086100001 Content-Type: text/plain; charset="utf-8" The virtiofsd currently crashes on s390x when doing something like this in the guest: mkdir -p /mnt/myfs mount -t virtiofs myfs /mnt/myfs touch /mnt/myfs/foo.txt stat -f /mnt/myfs/foo.txt The problem is that the fstatfs64 syscall is called in this case from the virtiofsd. We have to put it on the seccomp allowlist to avoid that the daemon gets killed in this case. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=3D2001728 Suggested-by: Vivek Goyal Signed-off-by: Thomas Huth Reviewed-by: Sergio Lopez Reviewed-by: Vivek Goyal --- tools/virtiofsd/passthrough_seccomp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/virtiofsd/passthrough_seccomp.c b/tools/virtiofsd/passth= rough_seccomp.c index f49ed94b5e..a3ce9f898d 100644 --- a/tools/virtiofsd/passthrough_seccomp.c +++ b/tools/virtiofsd/passthrough_seccomp.c @@ -51,6 +51,7 @@ static const int syscall_allowlist[] =3D { SCMP_SYS(fsetxattr), SCMP_SYS(fstat), SCMP_SYS(fstatfs), + SCMP_SYS(fstatfs64), SCMP_SYS(fsync), SCMP_SYS(ftruncate), SCMP_SYS(futex), --=20 2.27.0