Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3249492imc; Wed, 13 Mar 2019 12:43:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLdJ2NZscvzFhzRJN24uvsFRZfQRnH3npQYvkQEpqnG/MDk0YXCklHxx3uP/eOq9E85U+f X-Received: by 2002:a62:1d90:: with SMTP id d138mr39421966pfd.232.1552506233928; Wed, 13 Mar 2019 12:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552506233; cv=none; d=google.com; s=arc-20160816; b=OVQk2rD8V5+ij7XvaVybQ8s+wMYQGAmbWKH2ux1c3zX/4+ifjfNgtU8JNw2Rwy4gIu cRr3iKfLJ56J3eDkceetbMCLpuVgRw7bnBm6CH8vNfXGVOqWeZGB64djkxXC5dqxVXir hdpKbqNGcopsyBTWvzAzIBRlXqqX2HemeUkvwbHykOSZX+4Syrw7rS2x5Y/2u/hI7tpk T1QuyBHiTW4K+axYotLstPRbVik4mnccWWi01r92JgP5jGXyo+xM5xOPr3LX6azkTwu9 LNDFXH+jGzAd3BI02lpPflsbjeqXY2Bp0KNvNulIcFtryyKotLR3+PftVpxWi2H+Jedp Arkg== 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:cc :to:from:date:dkim-signature; bh=17AMuv68zpKuEUF26Mt1zEHHxdGx0QWp4VvwVn0tU/I=; b=m4xkCoMJacg3OfGNjNE+MSF7BBmo3A3e4ArZZtpLak2yXRVh6mFXMUyenF1A4CXoax 118wWKitWw/gQ3gFcscB9wv5hf26uKyacPNdlu2d2HVJNMN6n4S+wod/d/Db+jKdoh1J 0tEtcxt0xWk+HoKTd2cxWzPqRjq8sVZZ+ZTY2YiD2U5GQILJzXn+3OoOogb2sAfYMs/z 2EeUQZrG4aD7LifaoDyZzDJ7mE1Si/5jXvY7TfgVg/HjUVlrC5eACp7hXupbRmSF5c2B fTM93FvRXDZQqdh5zT6oj9tbkNaSWhJ4z6hZthF7RMm1T8Rg0gkpRaOsYrtUlTpB+Y3C Uwfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Lfao3a2y; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 27si388643pft.257.2019.03.13.12.43.37; Wed, 13 Mar 2019 12:43:53 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Lfao3a2y; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726962AbfCMTnR (ORCPT + 99 others); Wed, 13 Mar 2019 15:43:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:60776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726420AbfCMTnQ (ORCPT ); Wed, 13 Mar 2019 15:43:16 -0400 Received: from gmail.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C09612077B; Wed, 13 Mar 2019 19:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552506196; bh=xBwVO4J7+eKGefYtgEY/HJuhWOaBPz4oCLZzazWEaIU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Lfao3a2yNDBGTn48W4IJg/exfnGDI0vjAZOTO7Xg9OJFsTg3p+1pvgDJlbEziB8Qy IfrAQoOPFLsr0Z4s4pQ2l6Npw4PQWaCp+BgSQ66U959WHVAKxLpM8a/D9cNpRziHCo F0qenrDxIXY5wYMtX4INBTFWG1AyF5URvxr2lQ0s= Date: Wed, 13 Mar 2019 12:43:14 -0700 From: Eric Biggers To: Al Viro Cc: 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: <20190313194313.GB10169@gmail.com> References: <4603533.ZIfxmiEf7K@blindfold> <1854703.ve7plDhYWt@blindfold> <4066872.KGdO14EQMx@blindfold> <20190313151633.GA672@mit.edu> <20190313160616.GR2217@ZenIV.linux.org.uk> <20190313164432.GE703@sol.localdomain> <20190313191945.GT2217@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190313191945.GT2217@ZenIV.linux.org.uk> 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 07:19:46PM +0000, Al Viro wrote: > On Wed, Mar 13, 2019 at 09:44:33AM -0700, Eric Biggers wrote: > > > > 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? > > > > Isn't this handled by d_splice_alias() already, by moving the old dentry to the > > new name? > > ... which means that if somebody without the key chdirs into subdirectory > they only see by encrypted name and waits for proper owner to look it up, > they suddenly see it by _un_encrypted name. Or does O_PATH open, for > that matter, so exec permissions on that thing are not required. Is there a real problem here? After the key is added, the filenames are supposed to be shown in plaintext, not ciphertext. This is intrinsic to the fact that we don't support both "views" at the same time. Either the directory has the key or it does not. If someone is using ciphertext view (e.g. doing a directory traversal) concurrently with the key being added, that can certainly break things. But the ciphertext view only allows a very restricted set of actions such as deleting files. And if such actions are necessary, the system userspace is meant to be designed in such a way that adding the key can't race with it. - Eric