public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <eguan@redhat.com>
To: Eric Biggers <ebiggers3@gmail.com>
Cc: fstests@vger.kernel.org, Eric Biggers <ebiggers@google.com>,
	linux-fscrypt@vger.kernel.org
Subject: Re: [PATCH] generic: test revalidation of encrypted dentries
Date: Fri, 5 May 2017 18:12:06 +0800	[thread overview]
Message-ID: <20170505101206.GS7250@eguan.usersys.redhat.com> (raw)
In-Reply-To: <20170504215548.13698-1-ebiggers3@gmail.com>

On Thu, May 04, 2017 at 02:55:48PM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> Add a test which verifies that dentries in an encrypted directory are
> invalidated when an encryption key is added --- which should cause the
> plaintext filenames to be visible and accessible, replacing the encoded
> ciphertext filenames and any negative dentries for the plaintext names.
> This primarily tests for a bug which was fixed in the v4.5 kernel, plus
> a v4.6 fix for incorrect RCU usage in the earlier fix.
> 
> Cc: linux-fscrypt@vger.kernel.org
> Signed-off-by: Eric Biggers <ebiggers@google.com>

Looks good to me, ext4 passed this test with 4.11-rc8 kernel.

...
> +_filter_ciphertext_filenames()
> +{
> +	_filter_scratch | sed 's|edir/[a-zA-Z0-9+,_]\+|edir/ENCRYPTED_NAME|g'
> +}
> +
> +_show_file_contents()
> +{
> +	echo "--- Contents of files using plaintext names:"
> +	cat $SCRATCH_MNT/edir/@@@ |& _filter_scratch
> +	cat $SCRATCH_MNT/edir/abcd |& _filter_scratch
> +	echo "--- Contents of files using ciphertext names:"
> +	cat ${ciphertext_names[@]} |& _filter_ciphertext_filenames
> +}
> +
> +_show_directory_with_key()
> +{
> +	echo "--- Directory listing:"
> +	find $SCRATCH_MNT/edir -mindepth 1 | sort | _filter_scratch
> +	_show_file_contents
> +}

I just removed the leading underscore from above three local functions,
leading underscores are reserved for global helpers.

Thanks,
Eryu

      reply	other threads:[~2017-05-05 10:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-04 21:55 [PATCH] generic: test revalidation of encrypted dentries Eric Biggers
2017-05-05 10:12 ` Eryu Guan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170505101206.GS7250@eguan.usersys.redhat.com \
    --to=eguan@redhat.com \
    --cc=ebiggers3@gmail.com \
    --cc=ebiggers@google.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox