]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
common/verity: fix _fsv_have_hash_algorithm() with required signatures
authorEric Biggers <ebiggers@google.com>
Fri, 4 Nov 2022 20:58:28 +0000 (13:58 -0700)
committerZorro Lang <zlang@kernel.org>
Sat, 5 Nov 2022 15:30:39 +0000 (23:30 +0800)
commit7f7f3261a3ccfa237d50d0fab897c08eb0fb30ba
treef43cc8ce67c9100927bbd9a74cac8b26de08b798
parent1d4080ce7a6bfa0abaa818da38dc51e625a0307c
common/verity: fix _fsv_have_hash_algorithm() with required signatures

_fsv_have_hash_algorithm() uses _fsv_enable() without a signature, so it
always fails when called while fs.verity.require_signatures=1.  This
happens in generic/577, which tests file signing.  This wasn't noticed
because it just made part of generic/577 always be skipped.

Fix this by making _fsv_have_hash_algorithm() temporarily set
fs.verity.require_signatures to 0.

Since the previous value needs to be restored afterwards, whether it is
0 or 1, also make some changes to the fs.verity.require_signatures
helper functions to allow the restoration of the previous value, rather
than the value that existed at the beginning of the test.

Finally, make a couple related cleanups: make _fsv_have_hash_algorithm()
always delete the file it works with, and also update the similar code
in _require_scratch_verity().

Reported-by: Andrey Albershteyn <aalbersh@redhat.com>
Reviewed-by: Andrey Albershteyn <aalbersh@redhat.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/verity