From: Eric Biggers <ebiggers3@gmail.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux FS Dev Mailing List <linux-fsdevel@vger.kernel.org>,
Linux F2FS Dev Mailing List
<linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [GIT PULL] f2fs updates for v4.6
Date: Sat, 26 Mar 2016 08:47:48 -0500 [thread overview]
Message-ID: <20160326134748.GA971@zzz> (raw)
In-Reply-To: <20160326085606.GA41603@jaegeuk.hsd1.ca.comcast.net>
It seems strange to me --- a "renaming" commit made IVs start getting reused,
weakening the encryption. Do you have an explanation for how this change got
introduced?
Another question about the choice of IV. If the page index in CPU order is
(supposed to be) used as the IV, doesn't make the on-disk format of the
filesystem endianness-dependent? I thought that's a big no-no.
On Sat, Mar 26, 2016 at 01:56:06AM -0700, Jaegeuk Kim wrote:
> On Sat, Mar 26, 2016 at 01:10:07AM -0500, Eric Biggers wrote:
> > Why was the XTS tweak initialization changed in commit 0b81d0779072 ("fs crypto:
> > move per-file encryption from f2fs tree to fs/crypto")?
> >
> > Old code:
> >
> > memcpy(xts_tweak, &index, sizeof(index));
> > memset(&xts_tweak[sizeof(index)], 0,
> > F2FS_XTS_TWEAK_SIZE - sizeof(index));
> >
> > New code:
> > memcpy(xts_tweak, &inode->i_ino, sizeof(index));
> > memset(&xts_tweak[sizeof(index)], 0,
> > FS_XTS_TWEAK_SIZE - sizeof(index));
> >
> > Now the XTS tweak is the same for all pages of each inode.
>
> Thank you for catching this.
> I've checked several times, but turns out I missed something tho. :(
> Let me write a patch to fix this.
>
> Thanks,
>
>
next prev parent reply other threads:[~2016-03-26 13:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-20 22:58 [GIT PULL] f2fs updates for v4.6 Jaegeuk Kim
2016-03-21 18:09 ` Linus Torvalds
2016-03-21 18:45 ` Jaegeuk Kim
2016-03-26 6:10 ` Eric Biggers
2016-03-26 8:56 ` Jaegeuk Kim
2016-03-26 13:47 ` Eric Biggers [this message]
2016-03-26 17:53 ` Linus Torvalds
2016-03-26 20:00 ` Jaegeuk Kim
2016-03-26 20:04 ` Linus Torvalds
2016-03-26 20:26 ` Jaegeuk Kim
2016-03-26 20:41 ` Theodore Ts'o
2016-03-26 20:48 ` Linus Torvalds
2016-03-26 20:55 ` Theodore Ts'o
-- strict thread matches above, loose matches on Subject: below --
2016-03-18 0:58 Jaegeuk Kim
2016-03-18 2:32 ` Linus Torvalds
2016-03-18 2:35 ` Linus Torvalds
2016-03-18 5:00 ` Jaegeuk Kim
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=20160326134748.GA971@zzz \
--to=ebiggers3@gmail.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).