lkml.org 
[lkml]   [2016]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [GIT PULL] f2fs updates for v4.6
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,
>
>

\
 
 \ /
  Last update: 2016-03-26 15:01    [W:0.068 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site