lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170309134720.GJ15874@quack2.suse.cz>
Date:   Thu, 9 Mar 2017 14:47:20 +0100
From:   Jan Kara <jack@...e.cz>
To:     Theodore Ts'o <tytso@....edu>
Cc:     Andreas Dilger <adilger@...ger.ca>,
        Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH] ext4: don't BUG when truncating encrypted inodes on the
 orphan list

On Sat 11-02-17 21:27:38, Ted Tso wrote:
> On Sat, Feb 11, 2017 at 12:26:52AM -0700, Andreas Dilger wrote:
> > The reason truncated orphans are on the orphan list is because the
> > transaction that sets i_size may be restarted if the inode is larger
> > than can be truncated in a single transaction.  If the system crashes
> > before the truncate finishes then the truncate should be completed
> > so that old data is not returned if the file is truncated larger again.
> 
> Another way of fixing this is at the time when the file is truncated
> to a larger size.  Of course the other case we need handle is what
> happens if there is data after i_size and the file is mmaped.
> 
> One advantage of doing when the file is truncated larger again is at
> that point we will have the encryption key.  In the case of an
> encrypted file, both the kernel and e2fsck *can't* zero fill past
> i_size if the key is not available.  And during the orphan replay the
> encryption key won't be available.
> 
> The other way to solve the problem would be zero the portion of the
> last remaining datablock *first* and journal the data block along with
> the initial transaction which sets the i_size in the inode.  But that
> gets tricky, since all data writes for that last block must not go to
> the disk, and then once the journal has been committed we can't write
> the block to via the normal page_io routines (since otherwise it might
> get overwritten), until we write it back and then revoke the block in
> the journal, and the revoke is committed.  Messy....

Going through some old email... I don't think this would be really
reasonably doable. What would fixup the missing zeroing on orphan cleanup
though is to zero the tail of the last page on readpage, extending
truncate and write beyond EOF. That may be acceptable cost for encrypted
inodes. 

								Honza
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ