Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4477539pxv; Tue, 20 Jul 2021 04:47:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYDcM1Bwtqs01jaC4dfKBL6/BVnBJzyYC4QzL6Bjq4d0k2StRuI1fbKCZqMCx9+MRgZbIH X-Received: by 2002:a02:a797:: with SMTP id e23mr26254910jaj.121.1626781676581; Tue, 20 Jul 2021 04:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626781676; cv=none; d=google.com; s=arc-20160816; b=0z47RSzdkib8JDddxRGQWsNR8qs5erZ0+JBV0ewNvTs7op0V+MwnpRKQFSC6L226LF YndjOd+qw3TfIcLGuhQ5CkRmlurxtznaFV+JRGlL+zDL71o1lUV0fW/zUN64eaSSM3uw 4Ywjm9Z8334TzeJ0AiO2DVrnkxRfscTZCiGkng9wvpRpUvVKcK1YcY6jMzy3Qd6jXO1m OPEi9W87Wi0g6zrRC00IshKlUu/umGfDBxAXin6PvwWUEG3MbulaibfNBERifxEYP7QD yrPHs7g1nNQZRZLOvOLUlB4wCtULBO4HGQ+aN37/JtRBETNRuuIeCjMKVahZvf1HA+Qy 7PvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=n6CRkkVDcUbWGOvKNrPboXEb+Fnw8bwD+7x+VNz7iJ0=; b=NK0IJcGnjsmrcAeU/2Ne5QhX40jD0WbmLVlDAXEwwjaoNoLePHH2D1QSTt+3/g9+Ns 8Nd9RGchH9KOhP0YaPaUfDCodVjUFUTGboJADrQOxhOFAwRVA0k6I2V+kYcZr+SxXV2W HD5ch6vQ3c4yCzlJNRv27dkY8Vm6Xf2G2Av1k2jNKbDvomrLZhSUun8ngq+OTsqUb6lh zPcbZ5jYX/Ogk70Wtx1dO2I2WkJXQ+DTq/lJXeeBGzQKHier+HFrCcoCH+o9uZqivzR1 Sb0HHfNYi8HLr61NnlcENmeFBsM/7b8EcGANUIP1hBB9r6P1rxMnx975UNv4FoEOWnZH 7xLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QveFkRZR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m19si7399994jat.15.2021.07.20.04.47.46; Tue, 20 Jul 2021 04:47:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QveFkRZR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238029AbhGTLFF (ORCPT + 99 others); Tue, 20 Jul 2021 07:05:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26942 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237340AbhGTLCA (ORCPT ); Tue, 20 Jul 2021 07:02:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626781341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=n6CRkkVDcUbWGOvKNrPboXEb+Fnw8bwD+7x+VNz7iJ0=; b=QveFkRZRwAKOWpS55TvpyZlCqm2dIbilH67paOTbTQfjt/2q4XYYcqkTrSt1qgiXnbrF3r o7agqLfjWdBEazZ4n4HqB5PoFIh4t7siJoi8iaM4qFUYuhvhY7w4f/59ddFNM5VYaQZw5z BhHAg3c79gmnFiKWZIYMkvBt714V5vM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-175-kwVincl4MVqK2PjzAgAODg-1; Tue, 20 Jul 2021 07:42:18 -0400 X-MC-Unique: kwVincl4MVqK2PjzAgAODg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D6A801940925; Tue, 20 Jul 2021 11:42:00 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D3C81784C9; Tue, 20 Jul 2021 11:41:58 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id 16KBfwba021967; Tue, 20 Jul 2021 07:41:58 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id 16KBfvNm021963; Tue, 20 Jul 2021 07:41:57 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Tue, 20 Jul 2021 07:41:57 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Pintu Agarwal cc: open list , Phillip Lougher , linux-fsdevel , linux-mtd , dm-devel@redhat.com, Kernelnewbies , agk@redhat.com, snitzer@redhat.com, shli@kernel.org, samitolvanen@google.com Subject: Re: Kernel 4.14: Using dm-verity with squashfs rootfs - mounting issue In-Reply-To: Message-ID: References: User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="185206533-1311100962-1626781318=:19984" X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --185206533-1311100962-1626781318=:19984 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT Hi Try to set up dm-verity with block size 512 bytes. I don't know what block size does squashfs use, but if the filesystem block size is smaller than dm-verity block size, it doesn't work. Mikulas On Tue, 20 Jul 2021, Pintu Agarwal wrote: > Hi, > > Our ARM32 Linux embedded system consists of these: > * Linux Kernel: 4.14 > * Processor: Qualcomm Arm32 Cortex-A7 > * Storage: NAND 512MB > * Platform: Simple busybox > * Filesystem: UBIFS, Squashfs > * Consists of nand raw partitions, squashfs ubi volumes. > > My requirement: > We wanted to use dm-verity at boot time to check the integrity of > squashfs-rootfs before mounting. > > Problem: > dm-0 is not able to locate and mount the squash fs rootfs block. > The same approach is working when emulating with ext4 but fails with squashfs. > > Logs: > [....] > [ 0.000000] Kernel command line: [...] verity="96160 12020 > d7b8a7d0c01b9aec888930841313a81603a50a2a7be44631c4c813197a50d681 0 " > rootfstype=squashfs root=/dev/mtdblock34 ubi.mtd=30,0,30 [...] > root=/dev/dm-0 dm="system none ro,0 96160 verity 1 /dev/mtdblock34 > /dev/mtdblock39 4096 4096 12020 8 sha256 > d7b8a7d0c01b9aec888930841313a81603a50a2a7be44631c4c813197a50d681 > aee087a5be3b982978c923f566a94613496b417f2af592639bc80d141e34dfe7" > [....] > [ 4.693620] vreg_conn_pa: disa▒[ 4.700662] md: Skipping > autodetection of RAID arrays. (raid=autodetect will force) > [ 4.700713] device-mapper: init: attempting early device configuration. > [ 4.708224] device-mapper: init: adding target '0 96160 verity 1 > /dev/mtdblock34 /dev/mtdblock39 4096 4096 12020 8 sha256 > d7b8a7d0c01b9aec888930841313a81603a50a2a7be44631c4c813197a50d681 > aee087a5be3b982978c923f566a94613496b417f2af592639bc80d141e34dfe7' > [ 4.714979] device-mapper: verity: sha256 using implementation > "sha256-generic" > [ 4.737808] device-mapper: init: dm-0 is ready > [....] > [ 5.278103] No filesystem could mount root, tried: > [ 5.278107] squashfs > [ 5.280477] > [ 5.287627] Kernel panic - not syncing: VFS: Unable to mount root > fs on unknown-block(253,0) > [...] > > Not sure, why is it still locating block "253" here which seems like a > MAJOR number ? > > Working logs on ext4: > [....] > [ 4.529822] v▒[ 4.534035] md: Skipping autodetection of RAID > arrays. (raid=autodetect will force) > [ 4.534087] device-mapper: init: attempting early device configuration. > [ 4.550316] device-mapper: init: adding target '0 384440 verity 1 > /dev/ubiblock0_0 /dev/ubiblock0_0 4096 4096 48055 48063 sha256 > a02e0c13afb31e99b999c64aae6f4644c24addbc58db5689902cc5ba0be2d15b > aee087a5be3b982978c923f566a94613496b417f2af592639bc80d141e34dfe7 10 > restart_on_corruption ignore_zero_blocks use_fec_from_device > /dev/ubiblock0_0 fec_roots 2 fec_blocks 48443 fec_start 48443' > [ 4.572215] device-mapper: verity: sha256 using implementation > "sha256-generic" > [ 4.610692] device-mapper: init: dm-0 is ready > [ 4.720174] EXT4-fs (dm-0): mounted filesystem with ordered data > mode. Opts: (null) > [ 4.720438] VFS: Mounted root (ext4 filesystem) readonly on device 253:0. > [ 4.737256] devtmpfs: mounted > [....] > > Questions: > a) Is dm-verity supposed to work on squashfs block devices ? > b) Are there any known issues with dm-verity on Kernel 4.14 ? > c) Are there any patches that we are missing ? > > > Thanks, > Pintu > --185206533-1311100962-1626781318=:19984--