From nobody Wed Nov 12 10:25:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1570193864; cv=none; d=zoho.com; s=zohoarc; b=joJWo5JLiylfbrlaO89axmQyyK7N2lwI4NrMBbYtgjvvPfycP+jAYqUADsshTL8EW33R73KsSuLeSSZA8N6XNQYSy+G5uKA8vs6HGIxQnhjUycHsnMCGFgO55V2Dl0jXixEOhhEkRdRN8y/L5QLb9iYd75vWCfeMQtdz+VxqGCU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570193864; 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:ARC-Authentication-Results; bh=YTB7kEeSSkWKLidqrvOSRDNoPUXWu2FbpRN88kNXSFU=; b=SGLVjJRdeZd48OfZzGJIehu2Ob9hOm68bHpPKmfVGL1hGNwrwNbnZSpYHxv+6PY4qivRLUO7Qez/h4f0nIZ7HDj1mjqizs2hLX2lQcvTdpiugQfdahBdlKuZf26KUh7PiF+qx5ZKTP8xi21ejC05Q0N4xCXsSm9S2E1HCuQlvEE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1570193864964933.2140150121933; Fri, 4 Oct 2019 05:57:44 -0700 (PDT) Received: from localhost ([::1]:48306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGN9T-0007E2-Cn for importer@patchew.org; Fri, 04 Oct 2019 08:57:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46668) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGLLA-0007Jv-Sb for qemu-devel@nongnu.org; Fri, 04 Oct 2019 07:01:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iGLL7-0006JK-Mn for qemu-devel@nongnu.org; Fri, 04 Oct 2019 07:01:39 -0400 Received: from mgwym04.jp.fujitsu.com ([211.128.242.43]:12948) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iGLKz-0005ul-I1 for qemu-devel@nongnu.org; Fri, 04 Oct 2019 07:01:37 -0400 Received: from yt-mxoi1.gw.nic.fujitsu.com (unknown [192.168.229.67]) by mgwym04.jp.fujitsu.com with smtp id 255e_808b_6e3b8c25_83d6_403b_96fa_b1a4298d9cf8; Fri, 04 Oct 2019 20:01:09 +0900 Received: from g01jpfmpwkw01.exch.g01.fujitsu.local (g01jpfmpwkw01.exch.g01.fujitsu.local [10.0.193.38]) by yt-mxoi1.gw.nic.fujitsu.com (Postfix) with ESMTP id 8BB1CAC014A for ; Fri, 4 Oct 2019 20:01:08 +0900 (JST) Received: from g01jpexchkw35.g01.fujitsu.local (unknown [10.0.193.4]) by g01jpfmpwkw01.exch.g01.fujitsu.local (Postfix) with ESMTP id AD4A569228E; Fri, 4 Oct 2019 20:01:07 +0900 (JST) Received: from luna3.soft.fujitsu.com (10.124.196.199) by g01jpexchkw35.g01.fujitsu.local (10.0.193.50) with Microsoft SMTP Server id 14.3.439.0; Fri, 4 Oct 2019 20:01:07 +0900 From: Misono Tomohiro To: Subject: [Virtio-fs] [PATCH] virtiofsd: Add pread64() to seccomp list for posix_fallocate() Date: Fri, 4 Oct 2019 20:07:58 +0900 Message-ID: <20191004110759.32665-1-misono.tomohiro@jp.fujitsu.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SecurityPolicyCheck-GC: OK by FENCE-Mail X-TM-AS-GCONF: 00 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 211.128.242.43 X-Mailman-Approved-At: Fri, 04 Oct 2019 08:49:27 -0400 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-devel@nongnu.org, misono.tomohiro@jp.fujitsu.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" I test virtiofs with NFS 4.0 as backend and notice that fallocate causes system hang (kernel: 5.4-rc1, qemu: virtio-fs-dev branch): $ mount -t virtiofs myfs /mnt $ dd if=3D/dev/urandom bs=3D1000 seek=3D1 count=3D1 of=3D/mnt/file $ fallocate -l 2000 /mnt/file # system hang This is because: 1. virtiofs supports fallocate syscall while NFS 4.0 does not. 2. virtiofsd uses posix_fallocate() and it fallbacks to pread64()/ pwrite64() sequence to reserve blocks if fallocate syscall is not available. 3. pread64() syscall is prohibited by seccomp and virtiofsd thread is killed by SIGSYS. So, just add pread64() to seccomp white list to fix this problem. Signed-off-by: Misono Tomohiro --- contrib/virtiofsd/seccomp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/virtiofsd/seccomp.c b/contrib/virtiofsd/seccomp.c index 93b679271d..88b61bca42 100644 --- a/contrib/virtiofsd/seccomp.c +++ b/contrib/virtiofsd/seccomp.c @@ -61,6 +61,7 @@ static const int syscall_whitelist[] =3D { SCMP_SYS(ppoll), SCMP_SYS(prctl), /* TODO restrict to just PR_SET_NAME? */ SCMP_SYS(preadv), + SCMP_SYS(pread64), SCMP_SYS(pwritev), SCMP_SYS(pwrite64), SCMP_SYS(read), --=20 2.21.0