linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Proposal: A new fs-verity interface
@ 2019-01-10  5:15 Theodore Y. Ts'o
  2019-01-10  5:15 ` Theodore Y. Ts'o
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Theodore Y. Ts'o @ 2019-01-10  5:15 UTC (permalink / raw)
  To: Linus Torvalds, Christoph Hellwig, Dave Chinner, Darrick J. Wong,
	Eric Biggers, linux-fscrypt, linux-fsdevel, linux-ext4,
	linux-f2fs-devel

The following approach is based in Darrick's suggestion:

int ioctl(fd, FS_IOC_ENABLE_VERITY, struct fsverity_arg *arg);

struct fsverity_arg {
       int fsv_donor_fd;
       u64 fsv_offset;
       u64 fsv_size;
};

fsv_offset and fsz_size must be a multiple of the file system block
size.  If the ioctl comples successfully, as a side effect the
donor_fd will have a hole punch operation on the specified range.  In
other words, the equivalent of operation of fallocate(fsv_donor_fd,
FALLOC_FL_PUNCH_HOLE, fsv_offset, fsv_size), and the file specified by
fd will be protected using fsverity.

It will be legal for fsv_donor_fd == fd, so this interface is a
superset of the original FS_IOC_ENABLE_VERITY ioctl.

This will hopefully make Christoph and Dave happy because the
interface does not presuppose how ext4 and f2fs will implement
fsverity behind the scenes.  However, it does not forbid it, and the
net cost is that ext4 and f2fs will have to implement code which
transplants the blocks from the donor_fd to fd in the case where
donor_fd != fd --- and in the case where blocks are encrypted using
fscrypt, we will have to decrypt the blocks from donor_fd and possibly
re-encrypt then in fd's per-file key, which means we'll have to add
extra complexity to implement the decrypt and re-encrypt passing
through the page cache.

But if this helps resolve Christoph and Dave's objections, it
shouldn't be _too_ much extra complexity.  Before we go ahead an
implement it, though, I'd appreciate a confirmation that this will
indeed actually resolve their complaints.

Thanks,

					- Ted

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-01-29 15:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-10  5:15 Proposal: A new fs-verity interface Theodore Y. Ts'o
2019-01-10  5:15 ` Theodore Y. Ts'o
2019-01-10 18:18 ` Darrick J. Wong
2019-01-10 18:18   ` Darrick J. Wong
2019-01-14 23:41 ` Dave Chinner
2019-01-14 23:41   ` Dave Chinner
2019-01-23  5:10   ` Theodore Y. Ts'o
2019-01-24 21:25     ` Dave Chinner
2019-01-24 21:40       ` Linus Torvalds
2019-01-24 23:22         ` Theodore Y. Ts'o
2019-01-25  0:32           ` Matthew Wilcox
2019-01-25  0:35           ` Linus Torvalds
2019-01-29 15:48             ` Theodore Y. Ts'o

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).