Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3113217imc; Wed, 13 Mar 2019 09:08:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmqrelcnzF29cO2jTdTu2uQEyhb5XbmZvxTSUYybT+WlN+LAt5jZc2AIv8rtYIOnGjDDxd X-Received: by 2002:a63:6c43:: with SMTP id h64mr39180798pgc.22.1552493282323; Wed, 13 Mar 2019 09:08:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552493282; cv=none; d=google.com; s=arc-20160816; b=0/WO70gkpIOCamWfWjo//ZUmLb3eyST/v3CiOoAlZM6x1IPuUVUDSTJtSOD4Gmiwpn oZDQ9cZ1qcRc21NYhyk/zkYKzAe/0uP+x6Q5a+4p+MgvkJtRld4aleqwJWqI6+H+9S7c dUgpih2DgGyqIDf5PaF0xee5NvQpVNXnXwibv9BojXgxJWf5hTLkyYOKolBzz+4l9Dwm pkrPty4cGbgYMQNUjIkwYnCqFuY9QiWKe2cg8CXQR5KBQtyLMuNRldJIa/dKEgf64A7A i9G4LTJoE9AvEwC2C7bWiLauBjnDtsay8Mzmm9y/pSK8HXzeSXw9NgaPF7w1NE6WGpb2 uwXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :from:date; bh=XROZbZSTfXB/b5NZvAL/QADa8Suo6b6HomUGxMIYVzo=; b=xSFgo4crVBm31zEgnJk+KywmAietw00Oxdqvj/bU+ck69fOzWn2qbPaw7SGIIcc5Q7 NSF09JpY0LDLbGFyPPYl6bJlWvnb6NysfIiQRj39b+ZhwA64z1rKHqjgttIjk9MbK+6W 3IAGMmP3Qn1z65oMu0RpvrE7WFi0I3Lsy3nkZ7LKOxFZo1cu+JEROuMCEsgh4HeHtW25 95gHSfvSp6QsP7KGRReZ6cd1/gQKXqVuHksH2NRoA73cPJj3tAyqjIJE6lhHRl8jqUtx kD8ne0uSE0yZWejsjVvOi1XO0DWnPS6Bae66vwxx0C1cHvLfEHYjo4+Anf+OpnkSp/ia EUGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 136si11636502pfc.170.2019.03.13.09.07.44; Wed, 13 Mar 2019 09:08:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727097AbfCMQGa (ORCPT + 99 others); Wed, 13 Mar 2019 12:06:30 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:60698 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727062AbfCMQG3 (ORCPT ); Wed, 13 Mar 2019 12:06:29 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1h46OW-0000OV-TI; Wed, 13 Mar 2019 16:06:17 +0000 Date: Wed, 13 Mar 2019 16:06:16 +0000 From: Al Viro To: Theodore Ts'o , Amir Goldstein , Richard Weinberger , Miklos Szeredi , linux-fsdevel , linux-fscrypt@vger.kernel.org, overlayfs , linux-kernel , Paul Lawrence Subject: Re: overlayfs vs. fscrypt Message-ID: <20190313160616.GR2217@ZenIV.linux.org.uk> References: <4603533.ZIfxmiEf7K@blindfold> <1854703.ve7plDhYWt@blindfold> <4066872.KGdO14EQMx@blindfold> <20190313151633.GA672@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190313151633.GA672@mit.edu> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 13, 2019 at 11:16:33AM -0400, Theodore Ts'o wrote: > Actually, the original use was for ChromeOS, but the primary > assumption is that keying is per user (or profile), and that users are > mutually distrustful. So when Alice logs out of the system, her keys > will be invalidated and removed from the kernel. We can (and do) try > to flush cache entries via "echo 3 > /proc/sys/vm/drop_caches" on > logout. However, this does not guarantee that all dcache entries will > be removed --- a dcache entry can be pinned due to an open file, a > process's current working directory, a bind mount, etc. > > The other issue is negative dentries; if you try open a file in an > encrypted file, the file system won't even *know* whether or not a > file exists, since the directory entries are encrypted; hence, there > may be some negative dentries that need to be invalidated. > > So a fundamental assumption with fscrypt is that keys will be added > and removed, and that when this happens, dentries will need to be > invalidated. This is going to surprise overlayfs, so if overlayfs is > going to support fscrypt it *has* to be aware of the fact that this > can happen. It's not even clear what the proper security semantics > should be; *especially* if the upper and lower directories aren't > similarly protected using the same fscrypt encryption key. Suppose > the lower directory is encrypted, and the upper is not. Now on a copy > up operation, the previously encrypted file, which might contain > credit card numbers, medical records, or other things that would cause > a GDPR regulator to have a freak out attack, would *poof* become > decrypted. Just to make sure - you do realize that ban on multiple dentries refering to the same directory inode is *NOT* conditional upon those dentries being hashed, right?