* [PATCH ima-evm-utils] Fix fsverity.test mount failure for ppc64
@ 2023-03-11 9:16 Vitaly Chikunov
2023-03-14 13:27 ` R Nageswara Sastry
2023-03-14 22:38 ` Mimi Zohar
0 siblings, 2 replies; 3+ messages in thread
From: Vitaly Chikunov @ 2023-03-11 9:16 UTC (permalink / raw)
To: Mimi Zohar, Dmitry Kasatkin, linux-integrity
fsverity requires fs blocksize to be equal to pagesoze, which is
different on ppc64 (64K). Default mkfs blocksize if 4K. This difference
causes mount failure and following error message:
INFO: Mounting loopback filesystem
mount: /tmp/fsverity-test: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
dmesg(1) may have more information after failed mount system call.
FAILURE: mounting loopback filesystem
It's said this limitation is removed in Linux v6.3, but for backward
compatibility better to leave workaround for it.
Fixes: b259a2b ("tests: add fsverity measurement test")
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
---
tests/fsverity.test | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/fsverity.test b/tests/fsverity.test
index 01d5c35..5ad7634 100755
--- a/tests/fsverity.test
+++ b/tests/fsverity.test
@@ -120,6 +120,9 @@ create_loopback_file() {
case $fs_type in
ext4|f2fs)
options="-O verity"
+ # verity requires blocksize to be equal to pagesize.
+ pagesize=$(getconf PAGE_SIZE)
+ [ "$pagesize" -eq 4096 ] || options+=" -b $pagesize"
;;
btrfs)
;;
@@ -136,7 +139,7 @@ create_loopback_file() {
fi
echo "INFO: Building an $fs_type filesystem"
- if ! mkfs -t "$fs_type" -q "${TST_IMG}" "$options"; then
+ if ! mkfs -t "$fs_type" -q "${TST_IMG}" $options; then
echo "${RED}FAILURE: Creating $fs_type filesystem${NORM}"
exit "$FAIL"
fi
--
2.33.7
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH ima-evm-utils] Fix fsverity.test mount failure for ppc64
2023-03-11 9:16 [PATCH ima-evm-utils] Fix fsverity.test mount failure for ppc64 Vitaly Chikunov
@ 2023-03-14 13:27 ` R Nageswara Sastry
2023-03-14 22:38 ` Mimi Zohar
1 sibling, 0 replies; 3+ messages in thread
From: R Nageswara Sastry @ 2023-03-14 13:27 UTC (permalink / raw)
To: Vitaly Chikunov, Mimi Zohar, Dmitry Kasatkin, linux-integrity
On 11/03/23 2:46 pm, Vitaly Chikunov wrote:
> fsverity requires fs blocksize to be equal to pagesoze, which is
> different on ppc64 (64K). Default mkfs blocksize if 4K. This difference
> causes mount failure and following error message:
>
> INFO: Mounting loopback filesystem
> mount: /tmp/fsverity-test: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
> dmesg(1) may have more information after failed mount system call.
> FAILURE: mounting loopback filesystem
>
> It's said this limitation is removed in Linux v6.3, but for backward
> compatibility better to leave workaround for it.
>
> Fixes: b259a2b ("tests: add fsverity measurement test")
> Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
Tested-by: Nageswara R Sastry <rnsastry@linux.ibm.com>
Tested on Power10, PowerVM:
1. Kernel version: 6.3-rc6
with or with out this patch the fsverity.test result is same ie:
PASS: 6 SKIP: 0 FAIL: 0
2. Kernel version: 6.2.6
with out patch:
seen the reported error ie
mount: /tmp/fsverity-test: wrong fs type, bad option, bad superblock on
/dev/loop0, missing codepage or helper program, or other error.
FAILURE: mounting loopback filesystem
with patch:
PASS: 4 SKIP: 2 FAIL: 0
> ---
> tests/fsverity.test | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tests/fsverity.test b/tests/fsverity.test
> index 01d5c35..5ad7634 100755
> --- a/tests/fsverity.test
> +++ b/tests/fsverity.test
> @@ -120,6 +120,9 @@ create_loopback_file() {
> case $fs_type in
> ext4|f2fs)
> options="-O verity"
> + # verity requires blocksize to be equal to pagesize.
> + pagesize=$(getconf PAGE_SIZE)
> + [ "$pagesize" -eq 4096 ] || options+=" -b $pagesize"
> ;;
> btrfs)
> ;;
> @@ -136,7 +139,7 @@ create_loopback_file() {
> fi
>
> echo "INFO: Building an $fs_type filesystem"
> - if ! mkfs -t "$fs_type" -q "${TST_IMG}" "$options"; then
> + if ! mkfs -t "$fs_type" -q "${TST_IMG}" $options; then
> echo "${RED}FAILURE: Creating $fs_type filesystem${NORM}"
> exit "$FAIL"
> fi
--
Thanks and Regards
R.Nageswara Sastry
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH ima-evm-utils] Fix fsverity.test mount failure for ppc64
2023-03-11 9:16 [PATCH ima-evm-utils] Fix fsverity.test mount failure for ppc64 Vitaly Chikunov
2023-03-14 13:27 ` R Nageswara Sastry
@ 2023-03-14 22:38 ` Mimi Zohar
1 sibling, 0 replies; 3+ messages in thread
From: Mimi Zohar @ 2023-03-14 22:38 UTC (permalink / raw)
To: Vitaly Chikunov, Dmitry Kasatkin, linux-integrity
On Sat, 2023-03-11 at 12:16 +0300, Vitaly Chikunov wrote:
> fsverity requires fs blocksize to be equal to pagesoze, which is
> different on ppc64 (64K). Default mkfs blocksize if 4K. This difference
> causes mount failure and following error message:
>
> INFO: Mounting loopback filesystem
> mount: /tmp/fsverity-test: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
> dmesg(1) may have more information after failed mount system call.
> FAILURE: mounting loopback filesystem
>
> It's said this limitation is removed in Linux v6.3, but for backward
> compatibility better to leave workaround for it.
>
> Fixes: b259a2b ("tests: add fsverity measurement test")
> Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
Thanks, Vitaly. The patch is now queued in next-testing.
--
Mimi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-14 22:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-11 9:16 [PATCH ima-evm-utils] Fix fsverity.test mount failure for ppc64 Vitaly Chikunov
2023-03-14 13:27 ` R Nageswara Sastry
2023-03-14 22:38 ` Mimi Zohar
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).