All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: linux-fscrypt@vger.kernel.org
Cc: linux-ext4@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	Jeff Layton <jlayton@kernel.org>,
	Paul Crowley <paulcrowley@google.com>
Subject: Re: [PATCH] fscrypt: restrict IV_INO_LBLK_32 to ino_bits <= 32
Date: Mon, 7 Sep 2020 15:51:51 -0700	[thread overview]
Message-ID: <20200907225151.GC68127@sol.localdomain> (raw)
In-Reply-To: <20200824203841.1707847-1-ebiggers@kernel.org>

On Mon, Aug 24, 2020 at 01:38:41PM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> When an encryption policy has the IV_INO_LBLK_32 flag set, the IV
> generation method involves hashing the inode number.  This is different
> from fscrypt's other IV generation methods, where the inode number is
> either not used at all or is included directly in the IVs.
> 
> Therefore, in principle IV_INO_LBLK_32 can work with any length inode
> number.  However, currently fscrypt gets the inode number from
> inode::i_ino, which is 'unsigned long'.  So currently the implementation
> limit is actually 32 bits (like IV_INO_LBLK_64), since longer inode
> numbers will have been truncated by the VFS on 32-bit platforms.
> 
> Fix fscrypt_supported_v2_policy() to enforce the correct limit.
> 
> This doesn't actually matter currently, since only ext4 and f2fs support
> IV_INO_LBLK_32, and they both only support 32-bit inode numbers.  But we
> might as well fix it in case it matters in the future.
> 
> Ideally inode::i_ino would instead be made 64-bit, but for now it's not
> needed.  (Note, this limit does *not* prevent filesystems with 64-bit
> inode numbers from adding fscrypt support, since IV_INO_LBLK_* support
> is optional and is useful only on certain hardware.)
> 
> Fixes: e3b1078bedd3 ("fscrypt: add support for IV_INO_LBLK_32 policies")
> Reported-by: Jeff Layton <jlayton@kernel.org>
> Signed-off-by: Eric Biggers <ebiggers@google.com>

Applied to fscrypt.git#master for 5.10.

- Eric

WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers <ebiggers@kernel.org>
To: linux-fscrypt@vger.kernel.org
Cc: Paul Crowley <paulcrowley@google.com>,
	linux-ext4@vger.kernel.org, Jeff Layton <jlayton@kernel.org>,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] fscrypt: restrict IV_INO_LBLK_32 to ino_bits <= 32
Date: Mon, 7 Sep 2020 15:51:51 -0700	[thread overview]
Message-ID: <20200907225151.GC68127@sol.localdomain> (raw)
In-Reply-To: <20200824203841.1707847-1-ebiggers@kernel.org>

On Mon, Aug 24, 2020 at 01:38:41PM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> When an encryption policy has the IV_INO_LBLK_32 flag set, the IV
> generation method involves hashing the inode number.  This is different
> from fscrypt's other IV generation methods, where the inode number is
> either not used at all or is included directly in the IVs.
> 
> Therefore, in principle IV_INO_LBLK_32 can work with any length inode
> number.  However, currently fscrypt gets the inode number from
> inode::i_ino, which is 'unsigned long'.  So currently the implementation
> limit is actually 32 bits (like IV_INO_LBLK_64), since longer inode
> numbers will have been truncated by the VFS on 32-bit platforms.
> 
> Fix fscrypt_supported_v2_policy() to enforce the correct limit.
> 
> This doesn't actually matter currently, since only ext4 and f2fs support
> IV_INO_LBLK_32, and they both only support 32-bit inode numbers.  But we
> might as well fix it in case it matters in the future.
> 
> Ideally inode::i_ino would instead be made 64-bit, but for now it's not
> needed.  (Note, this limit does *not* prevent filesystems with 64-bit
> inode numbers from adding fscrypt support, since IV_INO_LBLK_* support
> is optional and is useful only on certain hardware.)
> 
> Fixes: e3b1078bedd3 ("fscrypt: add support for IV_INO_LBLK_32 policies")
> Reported-by: Jeff Layton <jlayton@kernel.org>
> Signed-off-by: Eric Biggers <ebiggers@google.com>

Applied to fscrypt.git#master for 5.10.

- Eric


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

  reply	other threads:[~2020-09-07 22:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24 20:38 [PATCH] fscrypt: restrict IV_INO_LBLK_32 to ino_bits <= 32 Eric Biggers
2020-08-24 20:38 ` [f2fs-dev] " Eric Biggers
2020-09-07 22:51 ` Eric Biggers [this message]
2020-09-07 22:51   ` 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=20200907225151.GC68127@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=paulcrowley@google.com \
    /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.