Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1751695pxb; Wed, 20 Oct 2021 11:01:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUgUxh44MrpaOCz2fBi3TfgUDcygMmUWtmgw5vKwOu5rgZUr9f2Nh6Kj0UpKC1/cneAEc2 X-Received: by 2002:a17:902:e5cc:b0:13f:4afd:1c60 with SMTP id u12-20020a170902e5cc00b0013f4afd1c60mr547764plf.37.1634752862890; Wed, 20 Oct 2021 11:01:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634752862; cv=none; d=google.com; s=arc-20160816; b=lATy/icSAlridPG+6N+JCPgXEBEq52QHJPC/CCE50B+NO/if2xRLbxJK9GWYI4xtrb IRPyEy22WCxrKyn+H85S/BtwACZPc0R0FWDaKcNz17ig08twnsG5Y/5GooEBh4S+UgSC BD9+FJztrIVob04mtPGJR4mLw5EiRJKylgrWRT8L1kQGHeUKMgBoa0W/l1sa1seBRE4r eRlzMCh5HIDDh7BnYmzO0F2sa/gTdTo8QROaDOEiAxZVYI0SH+QrENxSir3TxrBgwqOs fGXwpxNLHBfrfd/T9YLJuqMdy2j+RQiA0bz8ejPkKpEnGPVwJQj0J3WWUmhRle41n5jB WysQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=toabXZEV3QSOzdg1WxTHTkF1BdT9IQx1b1f2fsUlKXM=; b=eiSZu4E0s2MHdrRSg3bSbTllctaZavOTq1lZ1/If7HCRQ9AvyvVacLy8QmREMtr7Hc ORCDYLqEyeUmrVbwTx6yAUqXRxjeO9Ma33I77iWVga3X+n8TgvKwjz4mYivF8A3SJ7rB aeuz5JW0Kv3LuExJrFz5k/yqqOQi9iZgzqDKquyUrhzunhyOqN8FD416662PxGS5jWGR QHBq62cgp5oXKU2pz6ExpN8PQc4jMm+Enj7T12tSJtyu1FCRLV4wNZsDTHesYV3flV7K wP0kRNc4FRaRNRDnvbjSR7eG50eEuazU6mYDSWXFxOJt8KOV7jtZZdsa6kXHZg1AVnS6 s3wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=GIW8w1bY; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v21si3399343pjg.65.2021.10.20.11.00.47; Wed, 20 Oct 2021 11:01:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=GIW8w1bY; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231148AbhJTSDA (ORCPT + 99 others); Wed, 20 Oct 2021 14:03:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230445AbhJTSC7 (ORCPT ); Wed, 20 Oct 2021 14:02:59 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A776C06161C for ; Wed, 20 Oct 2021 11:00:45 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id EA4026C8A; Wed, 20 Oct 2021 14:00:43 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org EA4026C8A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1634752843; bh=toabXZEV3QSOzdg1WxTHTkF1BdT9IQx1b1f2fsUlKXM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GIW8w1bYBrTosQ5JY3qOEn7G0bltAvcibu+R2OuQ1WfjSfOlHyA/d96hlIdMp23FB kPmXrG7TatckK0K6DXxF2HhPrZOheCWqb7/XL4tQPghDwB/1QBURIDGvNy++uOBQ7J c8Iu02qourC/odnuxnD/wPUaa/J4DoRaNtadcY+Q= Date: Wed, 20 Oct 2021 14:00:43 -0400 From: "J. Bruce Fields" To: Olga Kornievskaia Cc: linux-nfs , Dai Ngo , Steve Dickson , Chuck Lever Subject: Re: server-to-server copy by default Message-ID: <20211020180043.GD597@fieldses.org> References: <20211020155421.GC597@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, Oct 20, 2021 at 12:37:08PM -0400, Olga Kornievskaia wrote: > On Wed, Oct 20, 2021 at 11:54 AM J. Bruce Fields wrote: > > > > knfsd has supported server-to-server copy for a couple years (since > > 5.5). You have set a module parameter to enable it. I'm getting asked > > when we could turn that parameter on by default. > > > > I've got a couple vague criteria: one just general maturity, the other a > > security question: > > > > 1. General maturity: the only reports I recall seeing are from testers. > > Is anyone using this? Does it work for them? Do they find a benefit? > > Maybe we could turn it on by default in one distro (Fedora?) and promote > > it a little and see what that turns up? > > > > 2. Security question: with server-to-server copy enabled, you can send > > the server a COPY call with any random address, and the server will > > mount that address, open a file, and read from it. Is that safe? (Whoops, I forgot, there's no open, just reads. And I don't know how much actual protocol there is involved in the mount.) > How about adding a piece then on the server (a policy) that would only > control that? The concept behind the server-to-server was that servers > might have a private/fast network between them that they would want to > utilize. A more restrictive policy could be to only allow predefined > network space to do the COPY? I know that more work. But sound like > perhaps it might be something that provides more control to the > server. That sounds like a step backwards if you're trying to enable it by default. But in the case there's a special server-to-server network, the way to handle that is by configuring the source server to return addresses on that network in the cnr_source_server field of the COPY_NOTIFY reply, right? > But as Chuck pointed out perhaps the kerberos piece would make this > concern irrelevant. I don't think kerberos addresses this. (It may make increase the attack surface, in fact.) > > Normally we only mount servers that were chosen by root. Here we'll > > mount any random server that some client told us to. What's the worst > > that random server can do? Do we trust our xdr decoding? Can it DOS us > > by throwing the client's state recovery code into some loop with weird > > error returns? Etc. > > Client code has been modified to know about special copy stateids that > if the client gets BAD_STATEID it knows not to try to do recovery and > instead it errors back to the "application", it being nfsd. Good to know, thanks. What are the list of rpc calls that are made to the source server--is it just READ, or does it at least need to create a client and a session? Are there any other error handling paths that we wouldn't want to go down? Etc. --b. > > Maybe it's fine. I'm OK with some level of risk. I just want to make > > sure somebody's thought this through. > > > > There's also interest in allowing unprivileged NFS mounts, but I don't > > think we've turned that on yet, partly for similar reasons. This is a > > subset of that problem. > > > > --b.