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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham 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 4A2DDC43381 for ; Sun, 17 Mar 2019 20:38:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1780D214AF for ; Sun, 17 Mar 2019 20:38:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726702AbfCQUi0 (ORCPT ); Sun, 17 Mar 2019 16:38:26 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:37674 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726333AbfCQUi0 (ORCPT ); Sun, 17 Mar 2019 16:38:26 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1h5cY2-0003ZP-Lc; Sun, 17 Mar 2019 20:38:22 +0000 Date: Sun, 17 Mar 2019 20:38:22 +0000 From: Al Viro To: Eric Biggers Cc: linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, linux-unionfs@vger.kernel.org, Sarthak Kukreti , Gao Xiang Subject: Re: [PATCH 1/5] fscrypt: clean up and improve dentry revalidation Message-ID: <20190317203822.GH2217@ZenIV.linux.org.uk> References: <20190317200444.5967-1-ebiggers@kernel.org> <20190317200444.5967-2-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190317200444.5967-2-ebiggers@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sun, Mar 17, 2019 at 01:04:40PM -0700, Eric Biggers wrote: > + /* > + * Ciphertext name; valid if the directory's key is still unavailable. > + * > + * Note: since fscrypt forbids rename() on ciphertext names, it should > + * be safe to access ->d_parent directly here. No, it is not. Again, d_splice_alias() on buggered fs image picking a reference to your subdirectory when doing a lookup elsewhere. It can relocate the damn thing, without rename() being allowed for _anything_. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH 1/5] fscrypt: clean up and improve dentry revalidation Date: Sun, 17 Mar 2019 20:38:22 +0000 Message-ID: <20190317203822.GH2217@ZenIV.linux.org.uk> References: <20190317200444.5967-1-ebiggers@kernel.org> <20190317200444.5967-2-ebiggers@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1h5cYF-0004Xx-SC for linux-f2fs-devel@lists.sourceforge.net; Sun, 17 Mar 2019 20:38:35 +0000 Received: from zeniv.linux.org.uk ([195.92.253.2]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1h5cYD-009PFq-G7 for linux-f2fs-devel@lists.sourceforge.net; Sun, 17 Mar 2019 20:38:35 +0000 Content-Disposition: inline In-Reply-To: <20190317200444.5967-2-ebiggers@kernel.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: Eric Biggers Cc: linux-unionfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fscrypt@vger.kernel.org, linux-mtd@lists.infradead.org, Sarthak Kukreti , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org On Sun, Mar 17, 2019 at 01:04:40PM -0700, Eric Biggers wrote: > + /* > + * Ciphertext name; valid if the directory's key is still unavailable. > + * > + * Note: since fscrypt forbids rename() on ciphertext names, it should > + * be safe to access ->d_parent directly here. No, it is not. Again, d_splice_alias() on buggered fs image picking a reference to your subdirectory when doing a lookup elsewhere. It can relocate the damn thing, without rename() being allowed for _anything_. 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=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham 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 E93AEC43381 for ; Sun, 17 Mar 2019 20:40:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 B389120657 for ; Sun, 17 Mar 2019 20:40:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hwQ/U8V2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B389120657 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rc+nQ7tWaw97gmEqQoKoRm+03vv5NCta3jk3QKZw2Mg=; b=hwQ/U8V2wOWOR9 BHMfOOom9OSX3HXNKla0ho6DfLO4en+F5LuVJJ6LNEND8SoPlrzW8UeBxjOFxmC+W6u0/pWr2jyc+ lT7lgR7hR4C4/u0zLFCbEyu9OyLksBwXXvLSyAn2wub60LFuk09Yw94UucW9KFRuGiwuLddv642nc 13h2icN71GGVkOKePWUxe07UjAJMOWMGbhTkWxlVYHwzLxOv0R42exd8W5mSvaLQFReZ3ZJYvoxx/ RuxZa4ig1Pol9SRxBAMz/svGC2R4MmAj6njFn9TME8Faxf5pmRY6WU3Hy5gMBzyVKJ/3kvHC2Pbng mobm5tmzgQjm3XHeyK/g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5caE-0006Co-Ef; Sun, 17 Mar 2019 20:40:38 +0000 Received: from zeniv.linux.org.uk ([195.92.253.2]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h5caA-0004wk-Dx for linux-mtd@lists.infradead.org; Sun, 17 Mar 2019 20:40:37 +0000 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1h5cY2-0003ZP-Lc; Sun, 17 Mar 2019 20:38:22 +0000 Date: Sun, 17 Mar 2019 20:38:22 +0000 From: Al Viro To: Eric Biggers Subject: Re: [PATCH 1/5] fscrypt: clean up and improve dentry revalidation Message-ID: <20190317203822.GH2217@ZenIV.linux.org.uk> References: <20190317200444.5967-1-ebiggers@kernel.org> <20190317200444.5967-2-ebiggers@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190317200444.5967-2-ebiggers@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190317_134034_471597_A432B111 X-CRM114-Status: UNSURE ( 6.16 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gao Xiang , linux-unionfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fscrypt@vger.kernel.org, linux-mtd@lists.infradead.org, Sarthak Kukreti , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Sun, Mar 17, 2019 at 01:04:40PM -0700, Eric Biggers wrote: > + /* > + * Ciphertext name; valid if the directory's key is still unavailable. > + * > + * Note: since fscrypt forbids rename() on ciphertext names, it should > + * be safe to access ->d_parent directly here. No, it is not. Again, d_splice_alias() on buggered fs image picking a reference to your subdirectory when doing a lookup elsewhere. It can relocate the damn thing, without rename() being allowed for _anything_. ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/