From nobody Tue Nov 18 22:53:59 2025 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613500848104547.9815532879949; Tue, 16 Feb 2021 10:40:48 -0800 (PST) Received: from localhost ([::1]:45952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lC5HC-0005mc-Ms for importer@patchew.org; Tue, 16 Feb 2021 13:40:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lC5EL-0004Ij-Tf for qemu-devel@nongnu.org; Tue, 16 Feb 2021 13:37:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:56039) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lC5EK-0000FD-Cy for qemu-devel@nongnu.org; Tue, 16 Feb 2021 13:37:49 -0500 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-290-WRc5bQAiPciWIRQhwGaBQg-1; Tue, 16 Feb 2021 13:37:45 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E996F100CCC0; Tue, 16 Feb 2021 18:37:44 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-109.ams2.redhat.com [10.36.115.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 914495C1B4; Tue, 16 Feb 2021 18:37:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613500667; 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: in-reply-to:in-reply-to:references:references; bh=FNvmS0UWbR7X+p3y1CzZeP+tJAcsEHGhsUwUX4tpClw=; b=Z1V42g++zkMhW6Q73rnXrTO9c/4HeE++jyqr0P9lyDbcT2wDe1K8Z87XIi+Av7kmlYuxRS yv5R6Qoysu86UaOOXi/pQR2WZO53ABktQvFYZrIKT3/GRStMCiIdk19an9546MkXlTeuwM /bxP05GCiNAO9F2h7fLnY9ndd1ayRHU= X-MC-Unique: WRc5bQAiPciWIRQhwGaBQg-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, wainersm@redhat.com, groug@kaod.org, philmd@redhat.com, vgoyal@redhat.com Subject: [PULL 1/6] virtiofsd: Allow to build it without the tools Date: Tue, 16 Feb 2021 18:37:29 +0000 Message-Id: <20210216183734.57810-2-dgilbert@redhat.com> In-Reply-To: <20210216183734.57810-1-dgilbert@redhat.com> References: <20210216183734.57810-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@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=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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: virtio-fs@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Wainer dos Santos Moschetta This changed the Meson build script to allow virtiofsd be built even though the tools build is disabled, thus honoring the --enable-virtiofsd option. Fixes: cece116c939d219070b250338439c2d16f94e3da (configure: add option for = virtiofsd) Signed-off-by: Wainer dos Santos Moschetta Message-Id: <20210201211456.1133364-2-wainersm@redhat.com> Reviewed-by: Misono Tomohiro Reviewed-by: Stefan Hajnoczi Signed-off-by: Dr. David Alan Gilbert --- tools/meson.build | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/meson.build b/tools/meson.build index fdce66857d..3e5a0abfa2 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -10,8 +10,11 @@ if get_option('virtiofsd').enabled() error('virtiofsd requires Linux') elif not seccomp.found() or not libcap_ng.found() error('virtiofsd requires libcap-ng-devel and seccomp-devel') - elif not have_tools or 'CONFIG_VHOST_USER' not in config_host - error('virtiofsd needs tools and vhost-user support') + elif 'CONFIG_VHOST_USER' not in config_host + error('virtiofsd needs vhost-user support') + else + # Disabled all the tools but virtiofsd. + have_virtiofsd =3D true endif endif elif get_option('virtiofsd').disabled() or not have_system --=20 2.29.2 From nobody Tue Nov 18 22:53:59 2025 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613501251218745.305286463349; Tue, 16 Feb 2021 10:47:31 -0800 (PST) Received: from localhost ([::1]:55654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lC5Nh-00024k-QY for importer@patchew.org; Tue, 16 Feb 2021 13:47:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lC5ER-0004Lg-5x for qemu-devel@nongnu.org; Tue, 16 Feb 2021 13:37:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:38595) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lC5EO-0000Ft-FD for qemu-devel@nongnu.org; Tue, 16 Feb 2021 13:37:54 -0500 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-430-67X2meu2NY2J_NedlqFjaQ-1; Tue, 16 Feb 2021 13:37:47 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9945B107ACE4; Tue, 16 Feb 2021 18:37:46 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-109.ams2.redhat.com [10.36.115.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 422D35C1B4; Tue, 16 Feb 2021 18:37:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613500671; 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: in-reply-to:in-reply-to:references:references; bh=ePzcSXu+xFi0EtP7a7da9l5xGiaV91m8gitJFP8nLz8=; b=f//VeBAi7JjokHY2qOBz+Kr8EvWoO2xNCRDHjtO2TPmEJwdsYQa4oKUKNYkhC0+jLw/BJK nJHeVsiuoNPEmRt98i2WiWppzNHj171Izgag6d/yCZxGeXV+uRxYpv+b5N3VV4DMRWBSOf x11Amb6ItwcTV7VYQqW88dYcdB4C67s= X-MC-Unique: 67X2meu2NY2J_NedlqFjaQ-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, wainersm@redhat.com, groug@kaod.org, philmd@redhat.com, vgoyal@redhat.com Subject: [PULL 2/6] virtiofsd: vu_dispatch locking should never fail Date: Tue, 16 Feb 2021 18:37:30 +0000 Message-Id: <20210216183734.57810-3-dgilbert@redhat.com> In-Reply-To: <20210216183734.57810-1-dgilbert@redhat.com> References: <20210216183734.57810-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@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=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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: virtio-fs@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Greg Kurz pthread_rwlock_rdlock() and pthread_rwlock_wrlock() can fail if a deadlock condition is detected or the current thread already owns the lock. They can also fail, like pthread_rwlock_unlock(), if the mutex wasn't properly initialized. None of these are ever expected to happen with fv_VuDev::vu_dispatch_rwlock. Some users already check the return value and assert, some others don't. Introduce rdlock/wrlock/unlock wrappers that just do the former and use them everywhere for improved consistency and robustness. This is just cleanup. It doesn't fix any actual issue. Signed-off-by: Greg Kurz Message-Id: <20210203182434.93870-1-groug@kaod.org> Reviewed-by: Vivek Goyal Reviewed-by: Stefan Hajnoczi Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_virtio.c | 49 +++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c index ddcefee427..523ee64fb7 100644 --- a/tools/virtiofsd/fuse_virtio.c +++ b/tools/virtiofsd/fuse_virtio.c @@ -187,6 +187,31 @@ static void copy_iov(struct iovec *src_iov, int src_co= unt, } } =20 +/* + * pthread_rwlock_rdlock() and pthread_rwlock_wrlock can fail if + * a deadlock condition is detected or the current thread already + * owns the lock. They can also fail, like pthread_rwlock_unlock(), + * if the mutex wasn't properly initialized. None of these are ever + * expected to happen. + */ +static void vu_dispatch_rdlock(struct fv_VuDev *vud) +{ + int ret =3D pthread_rwlock_rdlock(&vud->vu_dispatch_rwlock); + assert(ret =3D=3D 0); +} + +static void vu_dispatch_wrlock(struct fv_VuDev *vud) +{ + int ret =3D pthread_rwlock_wrlock(&vud->vu_dispatch_rwlock); + assert(ret =3D=3D 0); +} + +static void vu_dispatch_unlock(struct fv_VuDev *vud) +{ + int ret =3D pthread_rwlock_unlock(&vud->vu_dispatch_rwlock); + assert(ret =3D=3D 0); +} + /* * Called back by ll whenever it wants to send a reply/message back * The 1st element of the iov starts with the fuse_out_header @@ -240,12 +265,12 @@ int virtio_send_msg(struct fuse_session *se, struct f= use_chan *ch, =20 copy_iov(iov, count, in_sg, in_num, tosend_len); =20 - pthread_rwlock_rdlock(&qi->virtio_dev->vu_dispatch_rwlock); + vu_dispatch_rdlock(qi->virtio_dev); pthread_mutex_lock(&qi->vq_lock); vu_queue_push(dev, q, elem, tosend_len); vu_queue_notify(dev, q); pthread_mutex_unlock(&qi->vq_lock); - pthread_rwlock_unlock(&qi->virtio_dev->vu_dispatch_rwlock); + vu_dispatch_unlock(qi->virtio_dev); =20 req->reply_sent =3D true; =20 @@ -403,12 +428,12 @@ int virtio_send_data_iov(struct fuse_session *se, str= uct fuse_chan *ch, =20 ret =3D 0; =20 - pthread_rwlock_rdlock(&qi->virtio_dev->vu_dispatch_rwlock); + vu_dispatch_rdlock(qi->virtio_dev); pthread_mutex_lock(&qi->vq_lock); vu_queue_push(dev, q, elem, tosend_len); vu_queue_notify(dev, q); pthread_mutex_unlock(&qi->vq_lock); - pthread_rwlock_unlock(&qi->virtio_dev->vu_dispatch_rwlock); + vu_dispatch_unlock(qi->virtio_dev); =20 err: if (ret =3D=3D 0) { @@ -558,12 +583,12 @@ out: fuse_log(FUSE_LOG_DEBUG, "%s: elem %d no reply sent\n", __func__, elem->index); =20 - pthread_rwlock_rdlock(&qi->virtio_dev->vu_dispatch_rwlock); + vu_dispatch_rdlock(qi->virtio_dev); pthread_mutex_lock(&qi->vq_lock); vu_queue_push(dev, q, elem, 0); vu_queue_notify(dev, q); pthread_mutex_unlock(&qi->vq_lock); - pthread_rwlock_unlock(&qi->virtio_dev->vu_dispatch_rwlock); + vu_dispatch_unlock(qi->virtio_dev); } =20 pthread_mutex_destroy(&req->ch.lock); @@ -596,7 +621,6 @@ static void *fv_queue_thread(void *opaque) qi->qidx, qi->kick_fd); while (1) { struct pollfd pf[2]; - int ret; =20 pf[0].fd =3D qi->kick_fd; pf[0].events =3D POLLIN; @@ -645,8 +669,7 @@ static void *fv_queue_thread(void *opaque) break; } /* Mutual exclusion with virtio_loop() */ - ret =3D pthread_rwlock_rdlock(&qi->virtio_dev->vu_dispatch_rwlock); - assert(ret =3D=3D 0); /* there is no possible error case */ + vu_dispatch_rdlock(qi->virtio_dev); pthread_mutex_lock(&qi->vq_lock); /* out is from guest, in is too guest */ unsigned int in_bytes, out_bytes; @@ -672,7 +695,7 @@ static void *fv_queue_thread(void *opaque) } =20 pthread_mutex_unlock(&qi->vq_lock); - pthread_rwlock_unlock(&qi->virtio_dev->vu_dispatch_rwlock); + vu_dispatch_unlock(qi->virtio_dev); =20 /* Process all the requests. */ if (!se->thread_pool_size && req_list !=3D NULL) { @@ -799,7 +822,6 @@ int virtio_loop(struct fuse_session *se) while (!fuse_session_exited(se)) { struct pollfd pf[1]; bool ok; - int ret; pf[0].fd =3D se->vu_socketfd; pf[0].events =3D POLLIN; pf[0].revents =3D 0; @@ -825,12 +847,11 @@ int virtio_loop(struct fuse_session *se) assert(pf[0].revents & POLLIN); fuse_log(FUSE_LOG_DEBUG, "%s: Got VU event\n", __func__); /* Mutual exclusion with fv_queue_thread() */ - ret =3D pthread_rwlock_wrlock(&se->virtio_dev->vu_dispatch_rwlock); - assert(ret =3D=3D 0); /* there is no possible error case */ + vu_dispatch_wrlock(se->virtio_dev); =20 ok =3D vu_dispatch(&se->virtio_dev->dev); =20 - pthread_rwlock_unlock(&se->virtio_dev->vu_dispatch_rwlock); + vu_dispatch_unlock(se->virtio_dev); =20 if (!ok) { fuse_log(FUSE_LOG_ERR, "%s: vu_dispatch failed\n", __func__); --=20 2.29.2 From nobody Tue Nov 18 22:53:59 2025 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=1613501417; cv=none; d=zohomail.com; s=zohoarc; b=TLKdC6+XOEt1oebew5Y888TVhBg+k/ML/vGCBpmcfGBKarxXCBHz07rc5BkoMa+20bnpUKxw5JdpGHKYDq6u1cxzkODdn6lUQB1I2GL1oBIXBy0cGKPmOcJCxPbOOl9JmE2wbAucMfu1aKV1K2/n3rKZ/mNmf5/+MbS0mgVjQys= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613501417; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BCfRkMvnkmlcoYor2lyxQrdDMQrSkS0csvhAugNFYi4=; b=T39khmwdd/g0z8Cpdix+PiAKgAg5imry3+3rjm3HTXBVvOX4tr475NHb0vmg7B4qxx06UdcnpF40QW93oeKfr/+9/v+VTjdohgxnJ4WeSNM+uB7qhbkqyaijFCTz4VgZHd3L8P6BGfoyeiEI1ec4ndDJpfqmdb/TUM7LuxptfTI= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613501417199379.8676717203458; Tue, 16 Feb 2021 10:50:17 -0800 (PST) Received: from localhost ([::1]:33010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lC5QO-0004ZG-1j for importer@patchew.org; Tue, 16 Feb 2021 13:50:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lC5EY-0004OY-Pt for qemu-devel@nongnu.org; Tue, 16 Feb 2021 13:38:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36362) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lC5EW-0000Hn-Im for qemu-devel@nongnu.org; Tue, 16 Feb 2021 13:38:02 -0500 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-309-lbQbO6H1NUue03ULthORJQ-1; Tue, 16 Feb 2021 13:37:49 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 56CDE801965; Tue, 16 Feb 2021 18:37:48 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-109.ams2.redhat.com [10.36.115.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id E74A05C1B4; Tue, 16 Feb 2021 18:37:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613500678; 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: in-reply-to:in-reply-to:references:references; bh=BCfRkMvnkmlcoYor2lyxQrdDMQrSkS0csvhAugNFYi4=; b=Y80uoKT11rRrqVHx5Bjm9p4YqGjQtG0DTrKsLIi5gRZpPm+fmOYgZFWfOpd0REBkI35Wcn TSbV/H5zu5w4EzSwp6f8s1HGzzWpEfwKpOLfCQ/Nel28Ti6MRd0+nIBal8pHg8szS43Tvp YPkzVFkCbZkV2aEAHC9nIeHGXb9mcq8= X-MC-Unique: lbQbO6H1NUue03ULthORJQ-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, wainersm@redhat.com, groug@kaod.org, philmd@redhat.com, vgoyal@redhat.com Subject: [PULL 3/6] tools/virtiofsd: Replace the word 'whitelist' Date: Tue, 16 Feb 2021 18:37:31 +0000 Message-Id: <20210216183734.57810-4-dgilbert@redhat.com> In-Reply-To: <20210216183734.57810-1-dgilbert@redhat.com> References: <20210216183734.57810-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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: virtio-fs@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 Follow the inclusive terminology from the "Conscious Language in your Open Source Projects" guidelines [*] and replace the words "whitelist" appropriately. [*] https://github.com/conscious-lang/conscious-lang-docs/blob/main/faq.md Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Daniel P. Berrang=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20210205171817.2108907-3-philmd@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/passthrough_ll.c | 6 +++--- tools/virtiofsd/passthrough_seccomp.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index 147b59338a..5f3afe8557 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -3204,7 +3204,7 @@ static void setup_mounts(const char *source) } =20 /* - * Only keep whitelisted capabilities that are needed for file system oper= ation + * Only keep capabilities in allowlist that are needed for file system ope= ration * The (possibly NULL) modcaps_in string passed in is free'd before exit. */ static void setup_capabilities(char *modcaps_in) @@ -3214,8 +3214,8 @@ static void setup_capabilities(char *modcaps_in) capng_restore_state(&cap.saved); =20 /* - * Whitelist file system-related capabilities that are needed for a fi= le - * server to act like root. Drop everything else like networking and + * Add to allowlist file system-related capabilities that are needed f= or a + * file server to act like root. Drop everything else like networking= and * sysadmin capabilities. * * Exclusions: diff --git a/tools/virtiofsd/passthrough_seccomp.c b/tools/virtiofsd/passth= rough_seccomp.c index ea852e2e33..62441cfcdb 100644 --- a/tools/virtiofsd/passthrough_seccomp.c +++ b/tools/virtiofsd/passthrough_seccomp.c @@ -21,7 +21,7 @@ #endif #endif =20 -static const int syscall_whitelist[] =3D { +static const int syscall_allowlist[] =3D { /* TODO ireg sem*() syscalls */ SCMP_SYS(brk), SCMP_SYS(capget), /* For CAP_FSETID */ @@ -117,12 +117,12 @@ static const int syscall_whitelist[] =3D { }; =20 /* Syscalls used when --syslog is enabled */ -static const int syscall_whitelist_syslog[] =3D { +static const int syscall_allowlist_syslog[] =3D { SCMP_SYS(send), SCMP_SYS(sendto), }; =20 -static void add_whitelist(scmp_filter_ctx ctx, const int syscalls[], size_= t len) +static void add_allowlist(scmp_filter_ctx ctx, const int syscalls[], size_= t len) { size_t i; =20 @@ -153,10 +153,10 @@ void setup_seccomp(bool enable_syslog) exit(1); } =20 - add_whitelist(ctx, syscall_whitelist, G_N_ELEMENTS(syscall_whitelist)); + add_allowlist(ctx, syscall_allowlist, G_N_ELEMENTS(syscall_allowlist)); if (enable_syslog) { - add_whitelist(ctx, syscall_whitelist_syslog, - G_N_ELEMENTS(syscall_whitelist_syslog)); + add_allowlist(ctx, syscall_allowlist_syslog, + G_N_ELEMENTS(syscall_allowlist_syslog)); } =20 /* libvhost-user calls this for post-copy migration, we don't need it = */ --=20 2.29.2 From nobody Tue Nov 18 22:53:59 2025 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=1613501336; cv=none; d=zohomail.com; s=zohoarc; b=bPwKLWcSKsj214YIbnl+54wvGGeWWin/MmCRes66MUyLRWaDNQETqjDD5syp8vC4nMN5UOQYPhlRfT7w7Je7wbMPClaUrKwJpIxt8kTxwyGFD+GrySrNaqeoR/BtDMbhIGU9aizMmy5y7oU46Hb5gy5hbF4o9f5vMB9+p749/N0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613501336; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ly6cDLLcovd5j+qUNv0TPyzTE/C95+IKsT5ZzEfVeCw=; b=cMoydSUNYeORFAFqpuqSs8JXbmnTfXJwUCq0MiUCryntN7YXcLVH4+tR2BbT7RUefTtNcAyp3z11L01XRyY5rigDHIXiYPWBCqDzyqEZC3gRewzmAeCOZk8ohXRpc/Vdpl26XKXLSD1F0FfyRTcocyxFmk0bshg8V0/yNpQvupQ= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613501336344166.00465738532534; Tue, 16 Feb 2021 10:48:56 -0800 (PST) Received: from localhost ([::1]:57886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lC5P4-00039w-5F for importer@patchew.org; Tue, 16 Feb 2021 13:48:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lC5EW-0004Nm-TG for qemu-devel@nongnu.org; Tue, 16 Feb 2021 13:38:01 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51843) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lC5EU-0000Hf-3v for qemu-devel@nongnu.org; Tue, 16 Feb 2021 13:38:00 -0500 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-34-Kl0pVALBN9CTnRKxjPNqLg-1; Tue, 16 Feb 2021 13:37:53 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D287F6EE20; Tue, 16 Feb 2021 18:37:52 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-109.ams2.redhat.com [10.36.115.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id A57F55C1B4; Tue, 16 Feb 2021 18:37:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613500677; 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: in-reply-to:in-reply-to:references:references; bh=ly6cDLLcovd5j+qUNv0TPyzTE/C95+IKsT5ZzEfVeCw=; b=WPJZVBAj0oorGsluzmkZ4XhVXUOo2QPkh+SP6QgRGuz4ZMyModGl/MZ0PEX3UhFHq39gY+ x/ECrBESfVVH7BEGhkJLhiI0/cdvRa2uysGB7HVS26w09xitweGrgGywaerQ+L3gTrmohE fG6bLG3T+ScUw+ZBXk7l6LElsMiQOTo= X-MC-Unique: Kl0pVALBN9CTnRKxjPNqLg-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, wainersm@redhat.com, groug@kaod.org, philmd@redhat.com, vgoyal@redhat.com Subject: [PULL 4/6] virtiofsd: Save error code early at the failure callsite Date: Tue, 16 Feb 2021 18:37:32 +0000 Message-Id: <20210216183734.57810-5-dgilbert@redhat.com> In-Reply-To: <20210216183734.57810-1-dgilbert@redhat.com> References: <20210216183734.57810-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@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=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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: virtio-fs@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Vivek Goyal Change error code handling slightly in lo_setattr(). Right now we seem to jump to out_err and assume that "errno" is valid and use that to send reply. But if caller has to do some other operations before jumping to out_err, then it does the dance of first saving errno to saverr and the restore errno before jumping to out_err. This makes it more confusing. I am about to make more changes where caller will have to do some work after error before jumping to out_err. I found it easier to change the convention a bit. That is caller saves error in "saverr" before jumping to out_err. And out_err uses "saverr" to send error back and does not rely on "errno" having actual error. v3: Resolved conflicts in lo_setattr() due to lo_inode_open() changes. Signed-off-by: Vivek Goyal Reviewed-by: Dr. David Alan Gilbert Message-Id: <20210208224024.43555-2-vgoyal@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/passthrough_ll.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index 5f3afe8557..216c0bc026 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -698,6 +698,7 @@ static void lo_setattr(fuse_req_t req, fuse_ino_t ino, = struct stat *attr, res =3D fchmodat(lo->proc_self_fd, procname, attr->st_mode, 0); } if (res =3D=3D -1) { + saverr =3D errno; goto out_err; } } @@ -707,6 +708,7 @@ static void lo_setattr(fuse_req_t req, fuse_ino_t ino, = struct stat *attr, =20 res =3D fchownat(ifd, "", uid, gid, AT_EMPTY_PATH | AT_SYMLINK_NOF= OLLOW); if (res =3D=3D -1) { + saverr =3D errno; goto out_err; } } @@ -718,16 +720,15 @@ static void lo_setattr(fuse_req_t req, fuse_ino_t ino= , struct stat *attr, } else { truncfd =3D lo_inode_open(lo, inode, O_RDWR); if (truncfd < 0) { - errno =3D -truncfd; + saverr =3D -truncfd; goto out_err; } } =20 res =3D ftruncate(truncfd, attr->st_size); + saverr =3D res =3D=3D -1 ? errno : 0; if (!fi) { - saverr =3D errno; close(truncfd); - errno =3D saverr; } if (res =3D=3D -1) { goto out_err; @@ -760,6 +761,7 @@ static void lo_setattr(fuse_req_t req, fuse_ino_t ino, = struct stat *attr, res =3D utimensat(lo->proc_self_fd, procname, tv, 0); } if (res =3D=3D -1) { + saverr =3D errno; goto out_err; } } @@ -768,7 +770,6 @@ static void lo_setattr(fuse_req_t req, fuse_ino_t ino, = struct stat *attr, return lo_getattr(req, ino, fi); =20 out_err: - saverr =3D errno; lo_inode_put(lo, &inode); fuse_reply_err(req, saverr); } --=20 2.29.2 From nobody Tue Nov 18 22:53:59 2025 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=1613501039; cv=none; d=zohomail.com; s=zohoarc; b=GpQxkg5XnCig5JQXxUjqSaQEX0/UJVQpuJieg3C9cudrFE7sOyJ/aTM2E5+LyJ4TBXP5M9JMbxAdraXMLoEcJwiiXCWaCESStnhAIC1vxBnargRsWUfeAlv81toXNdkn7BqwPtCiFtIEJe734st4ZvAOYsr5PEvs+hpnsvdWHas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613501039; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Xy7K6Dm2Fkdn6FdB+hnWZuEqtX0jNLdXnVGjv4Zhg/s=; b=RCkm1KPVaytUK0zabsoewGBeGZFheBCMhrXx1LXyUuwOrFQNcY8wQQemM0U+AaHaGZvQtP0eOLfNgjplAgsos4sUok6veak9pawLS4HIZoBRCh4K8DQZyJB2S3MVhQK2kUNcN79gPaRelhJEMjismI/tsnuRsSs5b30ridZhSFo= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613501038780219.55816255813238; Tue, 16 Feb 2021 10:43:58 -0800 (PST) Received: from localhost ([::1]:52146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lC5KH-00006T-LO for importer@patchew.org; Tue, 16 Feb 2021 13:43:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lC5Ea-0004PM-Nc for qemu-devel@nongnu.org; Tue, 16 Feb 2021 13:38:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:32708) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lC5EU-0000Hk-Mf for qemu-devel@nongnu.org; Tue, 16 Feb 2021 13:38:04 -0500 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-426-zhVpu47lNT6BkbcFMKA2UQ-1; Tue, 16 Feb 2021 13:37:55 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 85DCC1934109; Tue, 16 Feb 2021 18:37:54 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-109.ams2.redhat.com [10.36.115.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D47C5C1B4; Tue, 16 Feb 2021 18:37:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613500678; 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: in-reply-to:in-reply-to:references:references; bh=Xy7K6Dm2Fkdn6FdB+hnWZuEqtX0jNLdXnVGjv4Zhg/s=; b=YQVRrIw6n/IQMmrboIvTqPCwMDEi2wkFWWRx7gRvU6aWtFVgNbqQv8puc/NI4e2VAbclc5 PiSCaJTrrBH/8SdNQ7e9y8eqma7TBoonXcD99qke8DtrSpy0pfVF22HwpihtO+j//PmKtY N7sUxB+pOwPwuXbk3FKYQTxrKB15muw= X-MC-Unique: zhVpu47lNT6BkbcFMKA2UQ-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, wainersm@redhat.com, groug@kaod.org, philmd@redhat.com, vgoyal@redhat.com Subject: [PULL 5/6] viriofsd: Add support for FUSE_HANDLE_KILLPRIV_V2 Date: Tue, 16 Feb 2021 18:37:33 +0000 Message-Id: <20210216183734.57810-6-dgilbert@redhat.com> In-Reply-To: <20210216183734.57810-1-dgilbert@redhat.com> References: <20210216183734.57810-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@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=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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: virtio-fs@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Vivek Goyal This patch adds basic support for FUSE_HANDLE_KILLPRIV_V2. virtiofsd can enable/disable this by specifying option "-o killpriv_v2/no_killpriv_v2= ". By default this is enabled as long as client supports it Enabling this option helps with performance in write path. Without this option, currently every write is first preceeded with a getxattr() operation to find out if security.capability is set. (Write is supposed to clear security.capability). With this option enabled, server is signing up for clearing security.capability on every WRITE and also clearing suid/sgid subject to certain rules. This gets rid of extra getxattr() call for every WRITE and improves performance. This is true when virtiofsd is run with option -o xattr. What does enabling FUSE_HANDLE_KILLPRIV_V2 mean for file server implementat= ion. It needs to adhere to following rules. Thanks to Miklos for this summary. - clear "security.capability" on write, truncate and chown unconditionally - clear suid/sgid in case of following. Note, sgid is cleared only if group executable bit is set. o setattr has FATTR_SIZE and FATTR_KILL_SUIDGID set. o setattr has FATTR_UID or FATTR_GID o open has O_TRUNC and FUSE_OPEN_KILL_SUIDGID o create has O_TRUNC and FUSE_OPEN_KILL_SUIDGID flag set. o write has FUSE_WRITE_KILL_SUIDGID >From Linux VFS client perspective, here are the requirements. - caps are always cleared on chown/write/truncate - suid is always cleared on chown, while for truncate/write it is cleared only if caller does not have CAP_FSETID. - sgid is always cleared on chown, while for truncate/write it is cleared only if caller does not have CAP_FSETID as well as file has group execute permission. virtiofsd implementation has not changed much to adhere to above ruls. And reason being that current assumption is that we are running on Linux and on top of filesystems like ext4/xfs which already follow above rules. On write, truncate, chown, seucurity.capability is cleared. And virtiofsd drops CAP_FSETID if need be and that will lead to clearing of suid/sgid. But if virtiofsd is running on top a filesystem which breaks above assumpti= ons, then it will have to take extra actions to emulate above. That's a TODO for later when need arises. Note: create normally is supposed to be called only when file does not exist. So generally there should not be any question of clearing setuid/setgid. But it is possible that after client checks that file is not present, some other client creates file on server and this race can trigger sending FUSE_CREATE. In that case, if O_TRUNC is set, we should clear suid/sgid if FUSE_OPEN_KILL_SUIDGID is also set. v3: - Resolved conflicts due to lo_inode_open() changes. - Moved capability code in lo_do_open() so that both lo_open() and lo_create() can benefit from common code. - Dropped changes to kernel headers as these are part of qemu already. Signed-off-by: Vivek Goyal Acked-by: Stefan Hajnoczi Reviewed-by: Dr. David Alan Gilbert Message-Id: <20210208224024.43555-3-vgoyal@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_common.h | 15 ++++++ tools/virtiofsd/fuse_lowlevel.c | 11 ++++- tools/virtiofsd/fuse_lowlevel.h | 1 + tools/virtiofsd/passthrough_ll.c | 84 +++++++++++++++++++++++++++++--- 4 files changed, 103 insertions(+), 8 deletions(-) diff --git a/tools/virtiofsd/fuse_common.h b/tools/virtiofsd/fuse_common.h index a090040bb2..fa9671872e 100644 --- a/tools/virtiofsd/fuse_common.h +++ b/tools/virtiofsd/fuse_common.h @@ -357,6 +357,21 @@ struct fuse_file_info { */ #define FUSE_CAP_SUBMOUNTS (1 << 27) =20 +/** + * Indicates that the filesystem is responsible for clearing + * security.capability xattr and clearing setuid and setgid bits. Following + * are the rules. + * - clear "security.capability" on write, truncate and chown unconditiona= lly + * - clear suid/sgid if following is true. Note, sgid is cleared only if + * group executable bit is set. + * o setattr has FATTR_SIZE and FATTR_KILL_SUIDGID set. + * o setattr has FATTR_UID or FATTR_GID + * o open has O_TRUNC and FUSE_OPEN_KILL_SUIDGID + * o create has O_TRUNC and FUSE_OPEN_KILL_SUIDGID flag set. + * o write has FUSE_WRITE_KILL_SUIDGID + */ +#define FUSE_CAP_HANDLE_KILLPRIV_V2 (1 << 28) + /** * Ioctl flags * diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowleve= l.c index e94b71110b..f78692ef66 100644 --- a/tools/virtiofsd/fuse_lowlevel.c +++ b/tools/virtiofsd/fuse_lowlevel.c @@ -855,7 +855,7 @@ static void do_setattr(fuse_req_t req, fuse_ino_t nodei= d, FUSE_SET_ATTR_GID | FUSE_SET_ATTR_SIZE | FUSE_SET_ATTR_ATIME | FUSE_SET_ATTR_MTIME | FUSE_SET_ATTR_ATIME_NOW | FUSE_SET_ATTR_MTIME_NOW | - FUSE_SET_ATTR_CTIME; + FUSE_SET_ATTR_CTIME | FUSE_SET_ATTR_KILL_SUIDGID; =20 req->se->op.setattr(req, nodeid, &stbuf, arg->valid, fi); } else { @@ -1069,6 +1069,7 @@ static void do_create(fuse_req_t req, fuse_ino_t node= id, =20 memset(&fi, 0, sizeof(fi)); fi.flags =3D arg->flags; + fi.kill_priv =3D arg->open_flags & FUSE_OPEN_KILL_SUIDGID; =20 req->ctx.umask =3D arg->umask; =20 @@ -1092,6 +1093,7 @@ static void do_open(fuse_req_t req, fuse_ino_t nodeid, =20 memset(&fi, 0, sizeof(fi)); fi.flags =3D arg->flags; + fi.kill_priv =3D arg->open_flags & FUSE_OPEN_KILL_SUIDGID; =20 if (req->se->op.open) { req->se->op.open(req, nodeid, &fi); @@ -1983,6 +1985,9 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, if (arg->flags & FUSE_SUBMOUNTS) { se->conn.capable |=3D FUSE_CAP_SUBMOUNTS; } + if (arg->flags & FUSE_HANDLE_KILLPRIV_V2) { + se->conn.capable |=3D FUSE_CAP_HANDLE_KILLPRIV_V2; + } #ifdef HAVE_SPLICE #ifdef HAVE_VMSPLICE se->conn.capable |=3D FUSE_CAP_SPLICE_WRITE | FUSE_CAP_SPLICE_MOVE; @@ -2114,6 +2119,10 @@ static void do_init(fuse_req_t req, fuse_ino_t nodei= d, outarg.congestion_threshold =3D se->conn.congestion_threshold; outarg.time_gran =3D se->conn.time_gran; =20 + if (se->conn.want & FUSE_CAP_HANDLE_KILLPRIV_V2) { + outarg.flags |=3D FUSE_HANDLE_KILLPRIV_V2; + } + fuse_log(FUSE_LOG_DEBUG, " INIT: %u.%u\n", outarg.major, outarg.mino= r); fuse_log(FUSE_LOG_DEBUG, " flags=3D0x%08x\n", outarg.flags); fuse_log(FUSE_LOG_DEBUG, " max_readahead=3D0x%08x\n", outarg.max_rea= dahead); diff --git a/tools/virtiofsd/fuse_lowlevel.h b/tools/virtiofsd/fuse_lowleve= l.h index 0e10a14bc9..3bf786b034 100644 --- a/tools/virtiofsd/fuse_lowlevel.h +++ b/tools/virtiofsd/fuse_lowlevel.h @@ -143,6 +143,7 @@ struct fuse_forget_data { #define FUSE_SET_ATTR_ATIME_NOW (1 << 7) #define FUSE_SET_ATTR_MTIME_NOW (1 << 8) #define FUSE_SET_ATTR_CTIME (1 << 10) +#define FUSE_SET_ATTR_KILL_SUIDGID (1 << 11) =20 /* * Request methods and replies diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index 216c0bc026..58d24c0010 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -168,6 +168,7 @@ struct lo_data { =20 /* An O_PATH file descriptor to /proc/self/fd/ */ int proc_self_fd; + int user_killpriv_v2, killpriv_v2; }; =20 static const struct fuse_opt lo_opts[] =3D { @@ -198,6 +199,8 @@ static const struct fuse_opt lo_opts[] =3D { { "allow_direct_io", offsetof(struct lo_data, allow_direct_io), 1 }, { "no_allow_direct_io", offsetof(struct lo_data, allow_direct_io), 0 }, { "announce_submounts", offsetof(struct lo_data, announce_submounts), = 1 }, + { "killpriv_v2", offsetof(struct lo_data, user_killpriv_v2), 1 }, + { "no_killpriv_v2", offsetof(struct lo_data, user_killpriv_v2), 0 }, FUSE_OPT_END }; static bool use_syslog =3D false; @@ -630,6 +633,34 @@ static void lo_init(void *userdata, struct fuse_conn_i= nfo *conn) "does not support it\n"); lo->announce_submounts =3D false; } + + if (lo->user_killpriv_v2 =3D=3D 1) { + /* + * User explicitly asked for this option. Enable it unconditionall= y. + * If connection does not have this capability, it should fail + * in fuse_lowlevel.c + */ + fuse_log(FUSE_LOG_DEBUG, "lo_init: enabling killpriv_v2\n"); + conn->want |=3D FUSE_CAP_HANDLE_KILLPRIV_V2; + lo->killpriv_v2 =3D 1; + } else if (lo->user_killpriv_v2 =3D=3D -1 && + conn->capable & FUSE_CAP_HANDLE_KILLPRIV_V2) { + /* + * User did not specify a value for killpriv_v2. By default enable= it + * if connection offers this capability + */ + fuse_log(FUSE_LOG_DEBUG, "lo_init: enabling killpriv_v2\n"); + conn->want |=3D FUSE_CAP_HANDLE_KILLPRIV_V2; + lo->killpriv_v2 =3D 1; + } else { + /* + * Either user specified to disable killpriv_v2, or connection does + * not offer this capability. Disable killpriv_v2 in both the cases + */ + fuse_log(FUSE_LOG_DEBUG, "lo_init: disabling killpriv_v2\n"); + conn->want &=3D ~FUSE_CAP_HANDLE_KILLPRIV_V2; + lo->killpriv_v2 =3D 0; + } } =20 static void lo_getattr(fuse_req_t req, fuse_ino_t ino, @@ -714,7 +745,10 @@ static void lo_setattr(fuse_req_t req, fuse_ino_t ino,= struct stat *attr, } if (valid & FUSE_SET_ATTR_SIZE) { int truncfd; + bool kill_suidgid; + bool cap_fsetid_dropped =3D false; =20 + kill_suidgid =3D lo->killpriv_v2 && (valid & FUSE_SET_ATTR_KILL_SU= IDGID); if (fi) { truncfd =3D fd; } else { @@ -725,8 +759,25 @@ static void lo_setattr(fuse_req_t req, fuse_ino_t ino,= struct stat *attr, } } =20 + if (kill_suidgid) { + res =3D drop_effective_cap("FSETID", &cap_fsetid_dropped); + if (res !=3D 0) { + saverr =3D res; + if (!fi) { + close(truncfd); + } + goto out_err; + } + } + res =3D ftruncate(truncfd, attr->st_size); saverr =3D res =3D=3D -1 ? errno : 0; + + if (cap_fsetid_dropped) { + if (gain_effective_cap("FSETID")) { + fuse_log(FUSE_LOG_ERR, "Failed to gain CAP_FSETID\n"); + } + } if (!fi) { close(truncfd); } @@ -1709,11 +1760,27 @@ static int lo_do_open(struct lo_data *lo, struct lo= _inode *inode, { ssize_t fh; int fd =3D existing_fd; + int err; + bool cap_fsetid_dropped =3D false; + bool kill_suidgid =3D lo->killpriv_v2 && fi->kill_priv; =20 update_open_flags(lo->writeback, lo->allow_direct_io, fi); =20 if (fd < 0) { + if (kill_suidgid) { + err =3D drop_effective_cap("FSETID", &cap_fsetid_dropped); + if (err) { + return err; + } + } + fd =3D lo_inode_open(lo, inode, fi->flags); + + if (cap_fsetid_dropped) { + if (gain_effective_cap("FSETID")) { + fuse_log(FUSE_LOG_ERR, "Failed to gain CAP_FSETID\n"); + } + } if (fd < 0) { return -fd; } @@ -1747,8 +1814,8 @@ static void lo_create(fuse_req_t req, fuse_ino_t pare= nt, const char *name, int err; struct lo_cred old =3D {}; =20 - fuse_log(FUSE_LOG_DEBUG, "lo_create(parent=3D%" PRIu64 ", name=3D%s)\n= ", parent, - name); + fuse_log(FUSE_LOG_DEBUG, "lo_create(parent=3D%" PRIu64 ", name=3D%s)" + " kill_priv=3D%d\n", parent, name, fi->kill_priv); =20 if (!is_safe_path_component(name)) { fuse_reply_err(req, EINVAL); @@ -1981,8 +2048,8 @@ static void lo_open(fuse_req_t req, fuse_ino_t ino, s= truct fuse_file_info *fi) struct lo_inode *inode =3D lo_inode(req, ino); int err; =20 - fuse_log(FUSE_LOG_DEBUG, "lo_open(ino=3D%" PRIu64 ", flags=3D%d)\n", i= no, - fi->flags); + fuse_log(FUSE_LOG_DEBUG, "lo_open(ino=3D%" PRIu64 ", flags=3D%d, kill_= priv=3D%d)" + "\n", ino, fi->flags, fi->kill_priv); =20 if (!inode) { fuse_reply_err(req, EBADF); @@ -2121,12 +2188,14 @@ static void lo_write_buf(fuse_req_t req, fuse_ino_t= ino, out_buf.buf[0].pos =3D off; =20 fuse_log(FUSE_LOG_DEBUG, - "lo_write_buf(ino=3D%" PRIu64 ", size=3D%zd, off=3D%lu)\n", i= no, - out_buf.buf[0].size, (unsigned long)off); + "lo_write_buf(ino=3D%" PRIu64 ", size=3D%zd, off=3D%lu kill_p= riv=3D%d)\n", + ino, out_buf.buf[0].size, (unsigned long)off, fi->kill_priv); =20 /* * If kill_priv is set, drop CAP_FSETID which should lead to kernel - * clearing setuid/setgid on file. + * clearing setuid/setgid on file. Note, for WRITE, we need to do + * this even if killpriv_v2 is not enabled. fuse direct write path + * relies on this. */ if (fi->kill_priv) { res =3D drop_effective_cap("FSETID", &cap_fsetid_dropped); @@ -3534,6 +3603,7 @@ int main(int argc, char *argv[]) .posix_lock =3D 0, .allow_direct_io =3D 0, .proc_self_fd =3D -1, + .user_killpriv_v2 =3D -1, }; struct lo_map_elem *root_elem; struct lo_map_elem *reserve_elem; --=20 2.29.2 From nobody Tue Nov 18 22:53:59 2025 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=1613500909; cv=none; d=zohomail.com; s=zohoarc; b=NKxM6xPECXeLCG248yyDUvLTeG9uARGpQ6BAdDTzbdmy4R+PeNw7Wd/jq1j0qkLcUSXoCioFuRxMDO4r0GFQRgh4zi/iGYpnvFMsWIekHppXlBp/eZG+sNZ2iT9+N3LqN3u24pNx+Ixa9ry5MEBaZcB0sZJTpblYvezIqkNB9hk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613500909; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6bPppjYUr8n0R4SImxdmVnZA7LVYOuJ5fA7nHO7XOr8=; b=JNStv1//SrWgyfBaIdpWegXNMlwQr1sipgLdUx/EhjZgP7+9xnd4a34dpl2pynyzieyw3pzJkwE+4HXs3AQgVAny4ZF/N44+LUNDSzs4gpiiyDz2kCLCHfBl5kq86r0yPCtm1VIOxV29Wru9+h7VcvFnJMoN4kWHiEAocCU6rgQ= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1613500909404819.770254912756; Tue, 16 Feb 2021 10:41:49 -0800 (PST) Received: from localhost ([::1]:47862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lC5I8-0006ff-3I for importer@patchew.org; Tue, 16 Feb 2021 13:41:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lC5Eg-0004U7-76 for qemu-devel@nongnu.org; Tue, 16 Feb 2021 13:38:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23562) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lC5Ee-0000If-KM for qemu-devel@nongnu.org; Tue, 16 Feb 2021 13:38:09 -0500 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-559-PVJAtutHObS5YUqkpHJBJw-1; Tue, 16 Feb 2021 13:38:03 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4ECF884E254; Tue, 16 Feb 2021 18:38:02 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-109.ams2.redhat.com [10.36.115.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id D3B0E5C1B4; Tue, 16 Feb 2021 18:37:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613500686; 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: in-reply-to:in-reply-to:references:references; bh=6bPppjYUr8n0R4SImxdmVnZA7LVYOuJ5fA7nHO7XOr8=; b=Rh0PCgHlj+jSYdiFbrDKdSMW+auvw401lwD/GdYUmozcneprtDHmiLmuhqxJFuXqosQyDh Yfz0L9Ju/GwFviIsBq7kashIQhQNvek2qE52XKtZ5HxpKHEshdXKfSV5IbRD6e9MludIxl 3MFX7k7L5/iJ6BZa4WWBSHQEmRlA0Qk= X-MC-Unique: PVJAtutHObS5YUqkpHJBJw-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, wainersm@redhat.com, groug@kaod.org, philmd@redhat.com, vgoyal@redhat.com Subject: [PULL 6/6] virtiofsd: Do not use a thread pool by default Date: Tue, 16 Feb 2021 18:37:34 +0000 Message-Id: <20210216183734.57810-7-dgilbert@redhat.com> In-Reply-To: <20210216183734.57810-1-dgilbert@redhat.com> References: <20210216183734.57810-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@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=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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: virtio-fs@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Vivek Goyal Currently we created a thread pool (With 64 max threads per pool) for each virtqueue. We hoped that this will provide us with better scalability and performance. But in practice, we are getting better numbers in most of the cases when we don't create a thread pool at all and a single thread per virtqueue receives the request and processes it. Hence, I am proposing that we switch to no thread pool by default (equivalent of --thread-pool-size=3D0). This will provide out of box better performance to most of the users. In fact other users have confirmed that not using a thread pool gives them better numbers. So why not use this as default. It can be changed when somebody can fix the issues with thread pool performance. Signed-off-by: Vivek Goyal Message-Id: <20210210182744.27324-2-vgoyal@redhat.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_lowlevel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowleve= l.c index f78692ef66..1aa26c6333 100644 --- a/tools/virtiofsd/fuse_lowlevel.c +++ b/tools/virtiofsd/fuse_lowlevel.c @@ -18,7 +18,7 @@ =20 #include =20 -#define THREAD_POOL_SIZE 64 +#define THREAD_POOL_SIZE 0 =20 #define OFFSET_MAX 0x7fffffffffffffffLL =20 --=20 2.29.2