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=-6.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 58A66C388F9 for ; Sun, 1 Nov 2020 10:38:39 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (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 D179A2071A; Sun, 1 Nov 2020 10:38:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="W5+lEcXs"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="ZtTi7StD"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="xag3wNPN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D179A2071A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1kZAks-0000aD-VP; Sun, 01 Nov 2020 10:38:34 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZAks-0000Zo-8q for linux-f2fs-devel@lists.sourceforge.net; Sun, 01 Nov 2020 10:38:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version :Message-ID:In-Reply-To:Date:From:Cc:To:Subject:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=NukVe76WLoqX0FMlea8EkPeCIB4gBY8eC1UX7f1P5C4=; b=W5+lEcXss2s07PO73eD7PyFXvp E5KG4zYhXWmXxVThlij0Wl+cbyXLyK3hj5Eae0OVNsKXmaW0eILrNf/7PjoAUbaPZVNnFlDY552I9 1u/l0r3UqyEHzUZwmxQ4y3Ex2YyN1jo4r4myxrcO4qjqBBA/S5CoNjAWWUSGBMxkKAtQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:From:Cc:To:Subject:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=NukVe76WLoqX0FMlea8EkPeCIB4gBY8eC1UX7f1P5C4=; b=ZtTi7StDejnag4x5s9/xUdOwf3 fd4CyRqqTzSi6lnMDpb0ommowv/7BfKx6obNgC5m/4mbhQNPq9haItLhNSxU/usXdRdL+qt1vIzkS Mckps5wYjPVIVUVHSnsee0qRrDyRcLZya9lcEuqd9svXmTY0ws8X+j2uGQz1q6VjdYVk=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1kZAkq-0053vm-01 for linux-f2fs-devel@lists.sourceforge.net; Sun, 01 Nov 2020 10:38:34 +0000 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 C5B7C2071A; Sun, 1 Nov 2020 10:38:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604227098; bh=xR+9Q6L+wKEyIZDuGGpAuB2SwvzwqkLJaS4lNusDwjI=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=xag3wNPNGlG1/7KDu/+UZI5Q84X4MaHquUO28r2owU/ZMn4PQ5WgSvNtzdyB0sykG e5X2Sl+c56pjGNJJKg9ZAq4SHPZmL8aYTAao4VzPWrVy0/6Yq8Ir39CShS2ga+CFEg LWh51tN4qbixx6d3BaXML64JTxgFYdrzsNTEpTqg= To: ebiggers@google.com, ebiggers@kernel.org, gregkh@linuxfoundation.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, sarthakkukreti@chromium.org, tytso@mit.edu From: Date: Sun, 01 Nov 2020 11:39:02 +0100 In-Reply-To: <20201031220553.1085782-4-ebiggers@kernel.org> Message-ID: <16042271428367@kroah.com> MIME-Version: 1.0 X-stable: commit X-Patchwork-Hint: ignore X-Headers-End: 1kZAkq-0053vm-01 Subject: [f2fs-dev] Patch "fs, fscrypt: clear DCACHE_ENCRYPTED_NAME when unaliasing directory" has been added to the 4.19-stable tree X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stable-commits@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net This is a note to let you know that I've just added the patch titled fs, fscrypt: clear DCACHE_ENCRYPTED_NAME when unaliasing directory to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: fs-fscrypt-clear-dcache_encrypted_name-when-unaliasing-directory.patch and it can be found in the queue-4.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From foo@baz Sun Nov 1 11:35:18 AM CET 2020 From: Eric Biggers Date: Sat, 31 Oct 2020 15:05:51 -0700 Subject: fs, fscrypt: clear DCACHE_ENCRYPTED_NAME when unaliasing directory To: stable@vger.kernel.org Cc: linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, Sarthak Kukreti , Theodore Ts'o Message-ID: <20201031220553.1085782-4-ebiggers@kernel.org> From: Eric Biggers commit 0bf3d5c1604ecbbd4e49e9f5b3c79152b87adb0d upstream. Make __d_move() clear DCACHE_ENCRYPTED_NAME on the source dentry. This is needed for when d_splice_alias() moves a directory's encrypted alias to its decrypted alias as a result of the encryption key being added. Otherwise, the decrypted alias will incorrectly be invalidated on the next lookup, causing problems such as unmounting a mount the user just mount()ed there. Note that we don't have to support arbitrary moves of this flag because fscrypt doesn't allow dentries with DCACHE_ENCRYPTED_NAME to be the source or target of a rename(). Fixes: 28b4c263961c ("ext4 crypto: revalidate dentry after adding or removing the key") Reported-by: Sarthak Kukreti Signed-off-by: Eric Biggers Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/dcache.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2713,6 +2713,20 @@ static void copy_name(struct dentry *den } /* + * When d_splice_alias() moves a directory's encrypted alias to its decrypted + * alias as a result of the encryption key being added, DCACHE_ENCRYPTED_NAME + * must be cleared. Note that we don't have to support arbitrary moves of this + * flag because fscrypt doesn't allow encrypted aliases to be the source or + * target of a rename(). + */ +static inline void fscrypt_handle_d_move(struct dentry *dentry) +{ +#if IS_ENABLED(CONFIG_FS_ENCRYPTION) + dentry->d_flags &= ~DCACHE_ENCRYPTED_NAME; +#endif +} + +/* * __d_move - move a dentry * @dentry: entry to move * @target: new dentry @@ -2787,6 +2801,7 @@ static void __d_move(struct dentry *dent list_move(&dentry->d_child, &dentry->d_parent->d_subdirs); __d_rehash(dentry); fsnotify_update_flags(dentry); + fscrypt_handle_d_move(dentry); write_seqcount_end(&target->d_seq); write_seqcount_end(&dentry->d_seq); Patches currently in stable-queue which might be from ebiggers@kernel.org are queue-4.19/fscrypt-only-set-dentry_operations-on-ciphertext-dentries.patch queue-4.19/fscrypt-clean-up-and-improve-dentry-revalidation.patch queue-4.19/fscrypt-fix-race-allowing-rename-and-link-of-ciphertext-dentries.patch queue-4.19/fs-fscrypt-clear-dcache_encrypted_name-when-unaliasing-directory.patch queue-4.19/fscrypt-fix-race-where-lookup-marks-plaintext-dentry-as-ciphertext.patch _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel