All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-mtd@lists.infradead.org, ceph-devel@vger.kernel.org,
	Daniel Rosenberg <drosen@google.com>
Subject: Re: [PATCH v3 13/13] fscrypt: make fscrypt_set_test_dummy_encryption() take a 'const char *'
Date: Thu, 17 Sep 2020 12:33:26 -0400	[thread overview]
Message-ID: <197468586b4a9b933755d2f9a462a234d654e280.camel@kernel.org> (raw)
In-Reply-To: <20200917152907.GB855@sol.localdomain>

On Thu, 2020-09-17 at 08:29 -0700, Eric Biggers wrote:
> On Thu, Sep 17, 2020 at 08:32:39AM -0400, Jeff Layton wrote:
> > On Wed, 2020-09-16 at 21:11 -0700, Eric Biggers wrote:
> > > From: Eric Biggers <ebiggers@google.com>
> > > 
> > > fscrypt_set_test_dummy_encryption() requires that the optional argument
> > > to the test_dummy_encryption mount option be specified as a substring_t.
> > > That doesn't work well with filesystems that use the new mount API,
> > > since the new way of parsing mount options doesn't use substring_t.
> > > 
> > > Make it take the argument as a 'const char *' instead.
> > > 
> > > Instead of moving the match_strdup() into the callers in ext4 and f2fs,
> > > make them just use arg->from directly.  Since the pattern is
> > > "test_dummy_encryption=%s", the argument will be null-terminated.
> > > 
> > 
> > Are you sure about that? I thought the point of substring_t was to give
> > you a token from the string without null terminating it.
> > 
> > ISTM that when you just pass in ->from, you might end up with trailing
> > arguments in your string like this. e.g.:
> > 
> >     "v2,foo,bar,baz"
> > 
> > ...and then that might fail to match properly
> > in fscrypt_set_test_dummy_encryption.
> > 
> 
> Yes I'm sure, and I had also tested it.  The use of match_token() here is to
> parse one null-terminated mount option at a time.
> 
> The reason that match_token() can return multiple substrings is that the pattern
> might be something like "foo=%d:%d".
> 
> But here it's just "test_dummy_encryption=%s". "%s" matches until end-of-string.

Got it. Thanks for explaining!
-- 
Jeff Layton <jlayton@kernel.org>


WARNING: multiple messages have this Message-ID (diff)
From: Jeff Layton <jlayton@kernel.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Daniel Rosenberg <drosen@google.com>,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-fscrypt@vger.kernel.org, linux-mtd@lists.infradead.org,
	ceph-devel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: [f2fs-dev] [PATCH v3 13/13] fscrypt: make fscrypt_set_test_dummy_encryption() take a 'const char *'
Date: Thu, 17 Sep 2020 12:33:26 -0400	[thread overview]
Message-ID: <197468586b4a9b933755d2f9a462a234d654e280.camel@kernel.org> (raw)
In-Reply-To: <20200917152907.GB855@sol.localdomain>

On Thu, 2020-09-17 at 08:29 -0700, Eric Biggers wrote:
> On Thu, Sep 17, 2020 at 08:32:39AM -0400, Jeff Layton wrote:
> > On Wed, 2020-09-16 at 21:11 -0700, Eric Biggers wrote:
> > > From: Eric Biggers <ebiggers@google.com>
> > > 
> > > fscrypt_set_test_dummy_encryption() requires that the optional argument
> > > to the test_dummy_encryption mount option be specified as a substring_t.
> > > That doesn't work well with filesystems that use the new mount API,
> > > since the new way of parsing mount options doesn't use substring_t.
> > > 
> > > Make it take the argument as a 'const char *' instead.
> > > 
> > > Instead of moving the match_strdup() into the callers in ext4 and f2fs,
> > > make them just use arg->from directly.  Since the pattern is
> > > "test_dummy_encryption=%s", the argument will be null-terminated.
> > > 
> > 
> > Are you sure about that? I thought the point of substring_t was to give
> > you a token from the string without null terminating it.
> > 
> > ISTM that when you just pass in ->from, you might end up with trailing
> > arguments in your string like this. e.g.:
> > 
> >     "v2,foo,bar,baz"
> > 
> > ...and then that might fail to match properly
> > in fscrypt_set_test_dummy_encryption.
> > 
> 
> Yes I'm sure, and I had also tested it.  The use of match_token() here is to
> parse one null-terminated mount option at a time.
> 
> The reason that match_token() can return multiple substrings is that the pattern
> might be something like "foo=%d:%d".
> 
> But here it's just "test_dummy_encryption=%s". "%s" matches until end-of-string.

Got it. Thanks for explaining!
-- 
Jeff Layton <jlayton@kernel.org>



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Jeff Layton <jlayton@kernel.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Daniel Rosenberg <drosen@google.com>,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-fscrypt@vger.kernel.org, linux-mtd@lists.infradead.org,
	ceph-devel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: [PATCH v3 13/13] fscrypt: make fscrypt_set_test_dummy_encryption() take a 'const char *'
Date: Thu, 17 Sep 2020 12:33:26 -0400	[thread overview]
Message-ID: <197468586b4a9b933755d2f9a462a234d654e280.camel@kernel.org> (raw)
In-Reply-To: <20200917152907.GB855@sol.localdomain>

On Thu, 2020-09-17 at 08:29 -0700, Eric Biggers wrote:
> On Thu, Sep 17, 2020 at 08:32:39AM -0400, Jeff Layton wrote:
> > On Wed, 2020-09-16 at 21:11 -0700, Eric Biggers wrote:
> > > From: Eric Biggers <ebiggers@google.com>
> > > 
> > > fscrypt_set_test_dummy_encryption() requires that the optional argument
> > > to the test_dummy_encryption mount option be specified as a substring_t.
> > > That doesn't work well with filesystems that use the new mount API,
> > > since the new way of parsing mount options doesn't use substring_t.
> > > 
> > > Make it take the argument as a 'const char *' instead.
> > > 
> > > Instead of moving the match_strdup() into the callers in ext4 and f2fs,
> > > make them just use arg->from directly.  Since the pattern is
> > > "test_dummy_encryption=%s", the argument will be null-terminated.
> > > 
> > 
> > Are you sure about that? I thought the point of substring_t was to give
> > you a token from the string without null terminating it.
> > 
> > ISTM that when you just pass in ->from, you might end up with trailing
> > arguments in your string like this. e.g.:
> > 
> >     "v2,foo,bar,baz"
> > 
> > ...and then that might fail to match properly
> > in fscrypt_set_test_dummy_encryption.
> > 
> 
> Yes I'm sure, and I had also tested it.  The use of match_token() here is to
> parse one null-terminated mount option at a time.
> 
> The reason that match_token() can return multiple substrings is that the pattern
> might be something like "foo=%d:%d".
> 
> But here it's just "test_dummy_encryption=%s". "%s" matches until end-of-string.

Got it. Thanks for explaining!
-- 
Jeff Layton <jlayton@kernel.org>


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2020-09-17 16:33 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17  4:11 [PATCH v3 00/13] fscrypt: improve file creation flow Eric Biggers
2020-09-17  4:11 ` Eric Biggers
2020-09-17  4:11 ` [f2fs-dev] " Eric Biggers
2020-09-17  4:11 ` [PATCH v3 01/13] fscrypt: add fscrypt_prepare_new_inode() and fscrypt_set_context() Eric Biggers
2020-09-17  4:11   ` Eric Biggers
2020-09-17  4:11   ` [f2fs-dev] " Eric Biggers
2020-09-17  4:11 ` [PATCH v3 02/13] ext4: factor out ext4_xattr_credits_for_new_inode() Eric Biggers
2020-09-17  4:11   ` Eric Biggers
2020-09-17  4:11   ` [f2fs-dev] " Eric Biggers
2020-09-17  4:11 ` [PATCH v3 03/13] ext4: use fscrypt_prepare_new_inode() and fscrypt_set_context() Eric Biggers
2020-09-17  4:11   ` Eric Biggers
2020-09-17  4:11   ` [f2fs-dev] " Eric Biggers
2020-09-17  4:11 ` [PATCH v3 04/13] f2fs: " Eric Biggers
2020-09-17  4:11   ` Eric Biggers
2020-09-17  4:11   ` [f2fs-dev] " Eric Biggers
2020-09-17  4:11 ` [PATCH v3 05/13] ubifs: " Eric Biggers
2020-09-17  4:11   ` Eric Biggers
2020-09-17  4:11   ` [f2fs-dev] " Eric Biggers
2020-09-17  4:11 ` [PATCH v3 06/13] fscrypt: adjust logging for in-creation inodes Eric Biggers
2020-09-17  4:11   ` Eric Biggers
2020-09-17  4:11   ` [f2fs-dev] " Eric Biggers
2020-09-17  4:11 ` [PATCH v3 07/13] fscrypt: remove fscrypt_inherit_context() Eric Biggers
2020-09-17  4:11   ` Eric Biggers
2020-09-17  4:11   ` [f2fs-dev] " Eric Biggers
2020-09-17  4:11 ` [PATCH v3 08/13] fscrypt: require that fscrypt_encrypt_symlink() already has key Eric Biggers
2020-09-17  4:11   ` Eric Biggers
2020-09-17  4:11   ` [f2fs-dev] " Eric Biggers
2020-09-17  4:11 ` [PATCH v3 09/13] fscrypt: stop pretending that key setup is nofs-safe Eric Biggers
2020-09-17  4:11   ` Eric Biggers
2020-09-17  4:11   ` [f2fs-dev] " Eric Biggers
2020-09-17  4:11 ` [PATCH v3 10/13] fscrypt: make "#define fscrypt_policy" user-only Eric Biggers
2020-09-17  4:11   ` Eric Biggers
2020-09-17  4:11   ` [f2fs-dev] " Eric Biggers
2020-09-17  4:11 ` [PATCH v3 11/13] fscrypt: move fscrypt_prepare_symlink() out-of-line Eric Biggers
2020-09-17  4:11   ` Eric Biggers
2020-09-17  4:11   ` [f2fs-dev] " Eric Biggers
2020-09-17  4:11 ` [PATCH v3 12/13] fscrypt: handle test_dummy_encryption in more logical way Eric Biggers
2020-09-17  4:11   ` Eric Biggers
2020-09-17  4:11   ` [f2fs-dev] " Eric Biggers
2020-09-17  4:11 ` [PATCH v3 13/13] fscrypt: make fscrypt_set_test_dummy_encryption() take a 'const char *' Eric Biggers
2020-09-17  4:11   ` Eric Biggers
2020-09-17  4:11   ` [f2fs-dev] " Eric Biggers
2020-09-17 12:32   ` Jeff Layton
2020-09-17 12:32     ` Jeff Layton
2020-09-17 12:32     ` [f2fs-dev] " Jeff Layton
2020-09-17 15:29     ` Eric Biggers
2020-09-17 15:29       ` Eric Biggers
2020-09-17 15:29       ` [f2fs-dev] " Eric Biggers
2020-09-17 16:33       ` Jeff Layton [this message]
2020-09-17 16:33         ` Jeff Layton
2020-09-17 16:33         ` [f2fs-dev] " Jeff Layton
2020-09-21 22:35 ` [PATCH v3 00/13] fscrypt: improve file creation flow Eric Biggers
2020-09-21 22:35   ` Eric Biggers
2020-09-21 22:35   ` [f2fs-dev] " Eric Biggers
2020-09-22 11:29   ` Jeff Layton
2020-09-22 11:29     ` Jeff Layton
2020-09-22 11:29     ` [f2fs-dev] " Jeff Layton
2020-09-22 13:50     ` Eric Biggers
2020-09-22 13:50       ` Eric Biggers
2020-09-22 13:50       ` [f2fs-dev] " Eric Biggers

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=197468586b4a9b933755d2f9a462a234d654e280.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=drosen@google.com \
    --cc=ebiggers@kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.