mbox series

[0/7] xfstests: add fs-verity tests

Message ID 20181210222142.222342-1-ebiggers@kernel.org (mailing list archive)
Headers show
Series xfstests: add fs-verity tests | expand

Message

Eric Biggers Dec. 10, 2018, 10:21 p.m. UTC
Add tests for fs-verity, a new feature for read-only file-based
authenticity protection.  fs-verity will be supported by ext4 and f2fs,
and perhaps other filesystems later.  Running these tests requires:

- A kernel with the fs-verity patches from
  https://git.kernel.org/pub/scm/linux/kernel/git/tytso/fscrypt.git/log/
  (should be merged in 4.21) and configured with CONFIG_FS_VERITY.
- The fsverity utility program, which can be installed from
  https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/fsverity-utils.git/
- e2fsprogs v1.44.4-2 or later for ext4 tests, or f2fs-tools v1.11.0 or
  later for f2fs tests.

Example with kvm-xfstests:

	$ kvm-xfstests -c ext4,f2fs -g verity

See the file Documentation/filesystem/fsverity.rst in the kernel tree
for more information about fs-verity.

Eric Biggers (7):
  common/verity: add common functions for testing fs-verity
  generic: test general behavior of verity files
  generic: test access controls on the fs-verity ioctls
  generic: test fs-verity descriptor validation
  generic: test corrupting verity files
  generic: test that fs-verity is using the correct measurement values
  generic: test using fs-verity and fscrypt simultaneously

 common/config         |   1 +
 common/verity         | 198 ++++++++++++++++++++++++++
 tests/generic/900     | 165 +++++++++++++++++++++
 tests/generic/900.out |  54 +++++++
 tests/generic/901     |  71 ++++++++++
 tests/generic/901.out |  14 ++
 tests/generic/902     | 323 ++++++++++++++++++++++++++++++++++++++++++
 tests/generic/902.out | 125 ++++++++++++++++
 tests/generic/903     | 126 ++++++++++++++++
 tests/generic/903.out |  91 ++++++++++++
 tests/generic/904     | 124 ++++++++++++++++
 tests/generic/904.out |   7 +
 tests/generic/905     |  81 +++++++++++
 tests/generic/905.out |  12 ++
 tests/generic/group   |   6 +
 15 files changed, 1398 insertions(+)
 create mode 100644 common/verity
 create mode 100755 tests/generic/900
 create mode 100644 tests/generic/900.out
 create mode 100755 tests/generic/901
 create mode 100644 tests/generic/901.out
 create mode 100755 tests/generic/902
 create mode 100644 tests/generic/902.out
 create mode 100755 tests/generic/903
 create mode 100644 tests/generic/903.out
 create mode 100755 tests/generic/904
 create mode 100644 tests/generic/904.out
 create mode 100755 tests/generic/905
 create mode 100644 tests/generic/905.out

Comments

Christoph Hellwig Dec. 11, 2018, 1:52 p.m. UTC | #1
On Mon, Dec 10, 2018 at 02:21:35PM -0800, Eric Biggers wrote:
> Add tests for fs-verity, a new feature for read-only file-based
> authenticity protection.  fs-verity will be supported by ext4 and f2fs,
> and perhaps other filesystems later.  Running these tests requires:

Seriously, given how broken the current fs-verify support is we should
neither merge it into the kernel nor fstests.

Nothing against the highlevel feature per-se, but the implementation
posted to linux-fsdevel a while ago is simply too broken.
Eric Biggers Dec. 11, 2018, 5:29 p.m. UTC | #2
Hi Christoph,

On Tue, Dec 11, 2018 at 05:52:31AM -0800, Christoph Hellwig wrote:
> On Mon, Dec 10, 2018 at 02:21:35PM -0800, Eric Biggers wrote:
> > Add tests for fs-verity, a new feature for read-only file-based
> > authenticity protection.  fs-verity will be supported by ext4 and f2fs,
> > and perhaps other filesystems later.  Running these tests requires:
> 
> Seriously, given how broken the current fs-verify support is we should
> neither merge it into the kernel nor fstests.
> 
> Nothing against the highlevel feature per-se, but the implementation
> posted to linux-fsdevel a while ago is simply too broken.

Please explain.  Broken, how so?  What changes do you suggest, specifically?

Also, if you have feedback it would be helpful if you posted it in response to
the actual kernel patchset, not just the tests.  AFAICS, this is your first time
responding to any fs-verity related thread, despite it being out for review for
months; is that correct or did I miss something you previously posted?

- Eric
Theodore Ts'o Dec. 12, 2018, 3 a.m. UTC | #3
On Tue, Dec 11, 2018 at 05:52:31AM -0800, Christoph Hellwig wrote:
> On Mon, Dec 10, 2018 at 02:21:35PM -0800, Eric Biggers wrote:
> > Add tests for fs-verity, a new feature for read-only file-based
> > authenticity protection.  fs-verity will be supported by ext4 and f2fs,
> > and perhaps other filesystems later.  Running these tests requires:
> 
> Seriously, given how broken the current fs-verify support is we should
> neither merge it into the kernel nor fstests.
> 
> Nothing against the highlevel feature per-se, but the implementation
> posted to linux-fsdevel a while ago is simply too broken.

What do you think is broken?

					- Ted
Christoph Hellwig Dec. 12, 2018, 9:15 a.m. UTC | #4
On Tue, Dec 11, 2018 at 09:29:32AM -0800, Eric Biggers wrote:
> Hi Christoph,
> 
> On Tue, Dec 11, 2018 at 05:52:31AM -0800, Christoph Hellwig wrote:
> > On Mon, Dec 10, 2018 at 02:21:35PM -0800, Eric Biggers wrote:
> > > Add tests for fs-verity, a new feature for read-only file-based
> > > authenticity protection.  fs-verity will be supported by ext4 and f2fs,
> > > and perhaps other filesystems later.  Running these tests requires:
> > 
> > Seriously, given how broken the current fs-verify support is we should
> > neither merge it into the kernel nor fstests.
> > 
> > Nothing against the highlevel feature per-se, but the implementation
> > posted to linux-fsdevel a while ago is simply too broken.
> 
> Please explain.  Broken, how so?  What changes do you suggest, specifically?

Don't magically pass the hash in the file data, that is just broken
beyond repairable.

> Also, if you have feedback it would be helpful if you posted it in response to
> the actual kernel patchset, not just the tests.  AFAICS, this is your first time
> responding to any fs-verity related thread, despite it being out for review for
> months; is that correct or did I miss something you previously posted?

No.  But given how broken it I'd rather ignore it rather than wasting
my time.  It isn't like it did get any other serious review either.
Eryu Guan Dec. 15, 2018, 2:28 p.m. UTC | #5
On Mon, Dec 10, 2018 at 02:21:35PM -0800, Eric Biggers wrote:
> Add tests for fs-verity, a new feature for read-only file-based
> authenticity protection.  fs-verity will be supported by ext4 and f2fs,
> and perhaps other filesystems later.  Running these tests requires:
> 
> - A kernel with the fs-verity patches from
>   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/fscrypt.git/log/
>   (should be merged in 4.21) and configured with CONFIG_FS_VERITY.
> - The fsverity utility program, which can be installed from
>   https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/fsverity-utils.git/
> - e2fsprogs v1.44.4-2 or later for ext4 tests, or f2fs-tools v1.11.0 or
>   later for f2fs tests.
> 
> Example with kvm-xfstests:
> 
> 	$ kvm-xfstests -c ext4,f2fs -g verity
> 
> See the file Documentation/filesystem/fsverity.rst in the kernel tree
> for more information about fs-verity.
> 
> Eric Biggers (7):
>   common/verity: add common functions for testing fs-verity
>   generic: test general behavior of verity files
>   generic: test access controls on the fs-verity ioctls
>   generic: test fs-verity descriptor validation
>   generic: test corrupting verity files
>   generic: test that fs-verity is using the correct measurement values
>   generic: test using fs-verity and fscrypt simultaneously

The tests look good to me overall, and tests ran fine on my test vm (I
only tested with ext4 though), thanks a lot! There're just a few minor
issues, the comments go to individual patch.

But it seems that there're still disagreements on the implemention of
fsverity, I'd like to wait and see what's the final decision before
taking the tests.

Thanks,
Eryu