Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2019-01-04 Thread Daniel Colascione via Linux-f2fs-devel
On Sat, Dec 22, 2018 at 8:46 PM Theodore Y. Ts'o wrote: > > On Sat, Dec 22, 2018 at 08:10:07PM -0800, Matthew Wilcox wrote: > > Pretty much every file format has the ability to put arbitrary blocks > > of information into a file somewhere the tools which don't know about > > it will skip it. For

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-22 Thread Theodore Y. Ts'o
On Sat, Dec 22, 2018 at 08:10:07PM -0800, Matthew Wilcox wrote: > Pretty much every file format has the ability to put arbitrary blocks > of information into a file somewhere the tools which don't know about > it will skip it. For example, ZIP "includes an extra field facility > within file header

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-22 Thread Theodore Y. Ts'o
On Sat, Dec 22, 2018 at 02:47:22PM -0800, Linus Torvalds wrote: > So I want to understand why this was made a filesystem operation in > the first place. What's fs-specific about this implementation? These are the things which are fs-specific. *) We have to splice into the file system's readpage p

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-22 Thread Matthew Wilcox
On Fri, Dec 21, 2018 at 11:17:12PM -0500, Theodore Y. Ts'o wrote: > Userspace applications which are reading the file aren't going to be > expecting Merkle tree. For example, one of the use cases is Android > APK files, which are essentially ZIP files. ZIP files can be parsed > both from the fron

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-22 Thread Linus Torvalds
On Fri, Dec 21, 2018 at 8:20 PM Theodore Y. Ts'o wrote: > > On Fri, Dec 21, 2018 at 11:13:07AM -0800, Linus Torvalds wrote: > > > > In other words: either the model is that the file *itself* contains > > its own merkle tree that validates the file, or it isn't. You can't > > have it two ways. No s

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-21 Thread Theodore Y. Ts'o
On Fri, Dec 21, 2018 at 11:13:07AM -0800, Linus Torvalds wrote: > > I do agree that your particular model is pretty damn broken in lots of ways. > > Why is it filesystem specific? If the whole point is that the file > itself has its own verification data (which I like), then I don't see > why thi

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-21 Thread Linus Torvalds
On Fri, Dec 21, 2018 at 7:47 AM Theodore Y. Ts'o wrote: > > Linus --- we're going round and round, and I don't think this is > really a technical dispute at this point, but rather an aesthetics > one. Grr. So honestly, I personally *like* the model of "the file contains its own validation data"

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-21 Thread Matthew Wilcox
On Fri, Dec 21, 2018 at 11:28:13AM -0500, Theodore Y. Ts'o wrote: > On Fri, Dec 21, 2018 at 07:53:54AM -0800, Matthew Wilcox wrote: > > In contrast to "we'll just fix it up later" (which usually applies > > to in-kernel interfaces), we have a policy of not breaking userspace, > > so accepting this

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-21 Thread Theodore Y. Ts'o
On Fri, Dec 21, 2018 at 07:53:54AM -0800, Matthew Wilcox wrote: > In contrast to "we'll just fix it up later" (which usually applies > to in-kernel interfaces), we have a policy of not breaking userspace, > so accepting this interface means setting it in stone. We should get > it right. I'm not c

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-21 Thread Matthew Wilcox
On Thu, Nov 01, 2018 at 03:52:19PM -0700, Eric Biggers wrote: > +In the recommended configuration of SHA-256 and 4K blocks, 128 hash > +values fit in each block. Thus, each level of the hash tree is 128 > +times smaller than the previous, and for large files the Merkle tree's > +size converges to

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-21 Thread Matthew Wilcox
On Fri, Dec 21, 2018 at 10:47:14AM -0500, Theodore Y. Ts'o wrote: > Linus --- we're going round and round, and I don't think this is > really a technical dispute at this point, but rather an aesthetics > one. Will you be willing to accept my pull request for a feature > which is being shippped on

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-21 Thread Theodore Y. Ts'o
On Thu, Dec 20, 2018 at 11:04:47PM -0800, Christoph Hellwig wrote: > Ted, I think you know yourself this isn't true. Whenever we added > useful interface to one of the major file systems we had other pick > it up, and that is a good thing because the last thing we need is > fragmentation of interf

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-21 Thread Richard Weinberger
On Fri, Dec 21, 2018 at 9:58 AM Christoph Hellwig wrote: > > On Thu, Dec 20, 2018 at 05:01:58PM -0500, Theodore Y. Ts'o wrote: > > That's simply not true. Number one, fsverity is not mandatory for all > > file systems to implement. If XFS doesn't want to implement fscrypt > > or fsverity, it doe

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-20 Thread Christoph Hellwig
On Thu, Dec 20, 2018 at 05:01:58PM -0500, Theodore Y. Ts'o wrote: > That's simply not true. Number one, fsverity is not mandatory for all > file systems to implement. If XFS doesn't want to implement fscrypt > or fsverity, it doesn't have to. Number two, we're not *making* any > changes to the k

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-20 Thread Theodore Y. Ts'o
On Thu, Dec 20, 2018 at 08:35:52AM +1100, Dave Chinner wrote: > > The file has to be written before it has been protected, which means > it may very well have user space allocated beyond EOF before the > merkle tree needs to be written. Sure, and every file system knows how to truncate a file. T

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-19 Thread Dave Chinner
On Wed, Dec 19, 2018 at 02:30:05PM -0500, Theodore Y. Ts'o wrote: > On Wed, Dec 19, 2018 at 01:19:53PM +1100, Dave Chinner wrote: > > Putting metadata in user files beyond EOF doesn't work with XFS's > > post-EOF speculative allocation algorithms. > > > > i.e. Filesystem design/algorithms often as

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-19 Thread Theodore Y. Ts'o
On Wed, Dec 19, 2018 at 01:19:53PM +1100, Dave Chinner wrote: > Putting metadata in user files beyond EOF doesn't work with XFS's > post-EOF speculative allocation algorithms. > > i.e. Filesystem design/algorithms often assume that the region > beyond EOF in user files is a write-only region. e.g

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-18 Thread Christoph Hellwig
On Tue, Dec 18, 2018 at 11:16:08PM -0800, Linus Torvalds wrote: > On Tue, Dec 18, 2018, 23:11 Christoph Hellwig > > > > I think the fd would have to be on the same fs for this interface to > > make sense. But it could be an O_TMPFILE one. And given that ext4 > > already supports a variant of swa

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-18 Thread Christoph Hellwig
On Tue, Dec 18, 2018 at 07:16:03PM -0500, Theodore Y. Ts'o wrote: > Sure, but what would be the benefit of doing different things on the > back end? I think this is a really more of a philophical objection > than anything else. With both fsverity and fscrypt, well over 95% of > the implementation

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-18 Thread Christoph Hellwig
On Mon, Dec 17, 2018 at 12:00:39PM -0800, Darrick J. Wong wrote: > FWIW, if I were (hypothetically) working on an xfs implementation, I > likely would have settled on passing a reference to a merkle tree > through a (fd, length) pair, because that allows us plenty of options > on the back end: > >

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-18 Thread Christoph Hellwig
On Mon, Dec 17, 2018 at 10:32:06AM -0800, Eric Biggers wrote: > I don't see how that helps. The Merkle tree can still be too large to fit in > memory. In the worst case, it might not even fit in the address space. And I > don't see how get_user_pages() helps either over just copy_from_user(); wh

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-18 Thread Dave Chinner
On Tue, Dec 18, 2018 at 07:16:03PM -0500, Theodore Y. Ts'o wrote: > On Mon, Dec 17, 2018 at 12:00:39PM -0800, Darrick J. Wong wrote: > > FWIW, if I were (hypothetically) working on an xfs implementation, I > > likely would have settled on passing a reference to a merkle tree > > through a (fd, leng

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-18 Thread Theodore Y. Ts'o
On Mon, Dec 17, 2018 at 12:00:39PM -0800, Darrick J. Wong wrote: > FWIW, if I were (hypothetically) working on an xfs implementation, I > likely would have settled on passing a reference to a merkle tree > through a (fd, length) pair, because that allows us plenty of options > on the back end: > >

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-17 Thread Darrick J. Wong
On Thu, Dec 13, 2018 at 08:48:03PM -0800, Eric Biggers wrote: > Hi Christoph, > > On Thu, Dec 13, 2018 at 12:22:49PM -0800, Christoph Hellwig wrote: > > On Wed, Dec 12, 2018 at 12:26:10PM -0800, Eric Biggers wrote: > > > > As this apparently got merged despite no proper reviews from VFS > > > > le

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-17 Thread Eric Biggers
Hi Christoph, On Mon, Dec 17, 2018 at 08:52:31AM -0800, Christoph Hellwig wrote: > [FYI, your mail never made it to my inbox, although I found the copy > in linux-fsdevel now] > > On Fri, Dec 14, 2018 at 12:17:22AM -0500, Theodore Y. Ts'o wrote: > > I don't consider fs-verity to be part of core V

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-17 Thread Eric Biggers
On Mon, Dec 17, 2018 at 08:49:49AM -0800, Christoph Hellwig wrote: > > > > Given that you alread use an ioctl as the interface what is the problem > > > of passing this data through the ioctl? > > > > Do you mean pass the verity metadata in a buffer? That cannot work in > > general, > > because

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-17 Thread Christoph Hellwig
[FYI, your mail never made it to my inbox, although I found the copy in linux-fsdevel now] On Fri, Dec 14, 2018 at 12:17:22AM -0500, Theodore Y. Ts'o wrote: > I don't consider fs-verity to be part of core VFS, but rather a > library that happens to be used by ext4 and f2fs. This is much like > fs

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-17 Thread Christoph Hellwig
On Thu, Dec 13, 2018 at 08:48:03PM -0800, Eric Biggers wrote: > Sure, those specific people (modulo you just now) haven't responded to the > fs-verity patches yet. But again, the patches have been out for review for > months. Of course, we always prefer more reviews over fewer, and we strongly >

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-13 Thread Eric Biggers
On Fri, Dec 14, 2018 at 12:17:22AM -0500, Theodore Y. Ts'o wrote: > Furthermore, it would require extra complexity in the common fsverity code > --- which looks for the Merkle tree at the end of file data --- for no real > benefit. To clarify, while this is technically true currently, as I mention

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-13 Thread Theodore Y. Ts'o
On Thu, Dec 13, 2018 at 12:22:49PM -0800, Christoph Hellwig wrote: > On Wed, Dec 12, 2018 at 12:26:10PM -0800, Eric Biggers wrote: > > > As this apparently got merged despite no proper reviews from VFS > > > level persons: > > > > fs-verity has been out for review since August, and Cc'ed to all re

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-13 Thread Eric Biggers
Hi Christoph, On Thu, Dec 13, 2018 at 12:22:49PM -0800, Christoph Hellwig wrote: > On Wed, Dec 12, 2018 at 12:26:10PM -0800, Eric Biggers wrote: > > > As this apparently got merged despite no proper reviews from VFS > > > level persons: > > > > fs-verity has been out for review since August, and

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-13 Thread Christoph Hellwig
On Wed, Dec 12, 2018 at 12:26:10PM -0800, Eric Biggers wrote: > > As this apparently got merged despite no proper reviews from VFS > > level persons: > > fs-verity has been out for review since August, and Cc'ed to all relevant > mailing lists including linux-fsdevel, linux-ext4, linux-f2fs-devel,

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-12 Thread Eric Biggers
Hi Christoph, On Wed, Dec 12, 2018 at 01:14:06AM -0800, Christoph Hellwig wrote: > As this apparently got merged despite no proper reviews from VFS > level persons: fs-verity has been out for review since August, and Cc'ed to all relevant mailing lists including linux-fsdevel, linux-ext4, linux-f

Re: [f2fs-dev] [PATCH v2 01/12] fs-verity: add a documentation file

2018-12-12 Thread Christoph Hellwig
As this apparently got merged despite no proper reviews from VFS level persons: NAK - the ioctl format that expects the verifycation hash in the file data data with padding after the real data is simply not acceptable, we can't just transform the data in the file itself based on a magic calls like