From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53585C433DB for ; Thu, 18 Mar 2021 12:01:04 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C809B64F2A for ; Thu, 18 Mar 2021 12:01:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C809B64F2A Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=crudebyte.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMrKo-00076a-KD for qemu-devel@archiver.kernel.org; Thu, 18 Mar 2021 08:01:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMrJ9-0006Xa-9y for qemu-devel@nongnu.org; Thu, 18 Mar 2021 07:59:19 -0400 Received: from kylie.crudebyte.com ([5.189.157.229]:36275) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMrJ7-00024C-4R for qemu-devel@nongnu.org; Thu, 18 Mar 2021 07:59:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Content-Type:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Content-ID:Content-Description; bh=FVNGMxw1Tu/ULPujLuXi4JIfnYLOLclI5Uy/fyQzbQo=; b=P1N1JMy4JcgwxiBIzw2XDOV80y A9esKRmwwbaLQdFVNiBefUYR6kNiwask4eGVHk9U/E9UwVLjyX9IwOdPTVSwZoO11NuC4GftfGMf4 +LmVKMGMOKGHLts4awWHocsalKgD+bZ6tNJHz96fIUNmYLqXWdSws3GTNXCUxEFL1PbhrocNtWkmj udXL2WuENOAqgYjU9+1/tPBOfACYVXAtDvxZTqm5X85pGGD+nh/ljBUvrajppS6TxeC2j7lwWPbkX a8iJ/d2JdRw+P0ZhX5FRDY7LRrXoQsQEfZSSxEiqyY55x4cloGL72T25RXgQZsmtr4rq4zzuk9CBZ mVibXmekJS5jzV3lOVxUdeKtoq/tL3m5n5rXBIwzrRN2kX3UVpk73CvzEeqwOXCTW6Q56u8sbcVX0 yVoSwWoGMdIKDhRaPZsJRdYrKWnbVuAQrK4zKw+VVOJNQxhksPgxsTBiGE47cxhA51ARXyKD1cBZo 78JrS1Z2/WvjH21/IZa0AKVnrATuoLU9KvjtclPSsxgfAajvwYIhMVBCFREofH1wkR40jb3a8o4he hU/CHaI1ErtHqo2d28bX32fynavSR8qtGF3drQOaUX/IbywdnhoClCyotH5cModT2GUF+sefBJQ7e GdGdBsRhbsG+DRt47R5AieJjZZDLoJ+f4Rt0hYgk0=; From: Christian Schoenebeck To: qemu-devel@nongnu.org Cc: Jiachen Zhang , "Daniel P. Berrange" , slp@redhat.com, "Michael S . Tsirkin" , "Dr . David Alan Gilbert" , virtio-fs@redhat.com, Xie Yongji , =?ISO-8859-1?Q?Marc=2DAndr=E9?= Lureau , Stefan Hajnoczi Subject: Re: [External] Re: [RFC PATCH 0/9] Support for Virtio-fs daemon crash reconnection Date: Thu, 18 Mar 2021 12:58:46 +0100 Message-ID: <1711593.yAA9ihpmTb@silver> In-Reply-To: References: <20201215162119.27360-1-zhangjiachen.jaycee@bytedance.com> <1709993.NBFj2RoZ23@silver> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Received-SPF: pass client-ip=5.189.157.229; envelope-from=qemu_oss@crudebyte.com; helo=kylie.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Mittwoch, 17. M=E4rz 2021 13:57:47 CET Jiachen Zhang wrote: > On Wed, Mar 17, 2021 at 7:50 PM Christian Schoenebeck < >=20 > qemu_oss@crudebyte.com> wrote: > > On Mittwoch, 17. M=E4rz 2021 11:05:32 CET Stefan Hajnoczi wrote: > > > On Fri, Dec 18, 2020 at 05:39:34PM +0800, Jiachen Zhang wrote: > > > > Thanks for the suggestions. Actually, we choose to save all state > > > > information to QEMU because a virtiofsd has the same lifecycle as i= ts > > > > QEMU master. However, saving things to a file do avoid communication > >=20 > > with > >=20 > > > > QEMU, and we no longer need to increase the complexity of vhost-user > > > > protocol. The suggestion to save fds to the systemd is also very > > > > reasonable > > > > if we don't consider the lifecycle issues, we will try it. > > >=20 > > > Hi, > > > We recently discussed crash recovery in the virtio-fs bi-weekly call = and > > > I read some of this email thread because it's a topic I'm interested = in. > >=20 > > I just had a quick fly over the patches so far. Shouldn't there be some > > kind > > of constraint for an automatic reconnection feature after a crash to > > prevent > > this being exploited by ROP brute force attacks? > >=20 > > E.g. adding some (maybe continuously increasing) delay and/or limiting = the > > amount of reconnects within a certain time frame would come to my mind. > >=20 > > Best regards, > > Christian Schoenebeck >=20 > Thanks, Christian. I am still trying to figure out the details of the ROP > attacks. >=20 > However, QEMU's vhost-user reconnection is based on chardev socket > reconnection. The socket reconnection can be enabled by the "--chardev > socket,...,reconnect=3DN" in QEMU command options, in which N means QEMU = will > try to connect the disconnected socket every N seconds. We can increase N > to increase the reconnect delay. If we want to change the reconnect delay > dynamically, I think we should change the chardev socket reconnection cod= e. > It is a more generic mechanism than vhost-user-fs and vhost-user backend. >=20 > By the way, I also considered the socket reconnection delay time in the > performance aspect. As the reconnection delay increase, if an application > in the guest is doing I/Os, it will suffer larger tail latency. And for > now, the smallest delay is 1 second, which is rather large for > high-performance virtual I/O devices today. I think maybe a more performa= nt > and safer reconnect delay adjustment mechanism should be considered in the > future. What are your thoughts? So with N=3D1 an attacker could e.g. bypass a 16-bit PAC by brute-force in = ~18=20 hours (e.g. on Arm if PAC + MTE was enabled). With 24-bit PAC (no MTE) it=20 would be ~194 days. Independent of what architecture and defend mechanism i= s=20 used, there is always the possibility though that some kind of side channel= =20 attack exists that might require a much lower amount of attempts. So in an= =20 untrusted environment I would personally limit the amount of automatic=20 reconnects and rather accept a down time for further investigation if a=20 suspicious high amount of crashes happened. And yes, if a dynamic delay scheme was deployed in future then starting wit= h a=20 value smaller than 1 second would make sense. Best regards, Christian Schoenebeck