Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4389650pxv; Tue, 20 Jul 2021 02:39:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhsM/FswjvRaMQEy+Zls/WWoV1T/k0cCrJirESgyhGQWyUMcpuZwyxO6lAcZvBhbYa9hpt X-Received: by 2002:a6b:2b44:: with SMTP id r65mr21379428ior.99.1626773995269; Tue, 20 Jul 2021 02:39:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626773995; cv=none; d=google.com; s=arc-20160816; b=wXJGSC1JVpiaQq6xzgbA+yk5xya0ZrqtFQ9c/b5fYTXn77KVhIR2Hhi1VqGQHCETU4 sOU+xnC7sN9IOo5UHK0tvAItwnISukeItnWPcDJ+TDxXH1RMr6cWtIwW059DgbuTPGIj gTbLMBBe7txS2/ljuMeKJExA8/UnyDa9pQK8R2APiYbC4ZogM3qP03IWo1KyBVk5Dwz0 yF5z7cFFMYGfzqBVr5IpTDnf8DeigAAKZP73V5oIYN6QBO+IyuPCIqdDb0V6ULvMtEVZ PkJRtJR3eo6jJOOI/rKVq0XYgNvL15kGyK14wZMUEW5BBAsf0//t7WNFUGNNpUU8KGGn bKdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:to:subject:message-id :date:from:mime-version:dkim-signature; bh=ob2cL9xsCuqI2PtZCWk4ZnfruGA/KtiWAaZc2Xrr4AE=; b=RlHIPRpfY2XohFzUZBZTgYURiQJ1JW5iqPyqJzdgCBcx6yOtu64Y9a5ys5mv5nNItS 6OjA4f68hKJ7Rj44ywsaGres27aSYgCHRXKBVOPnsKpFr1Pj+tCSyHZEJhvgvcn1hdCm LBZssdfPEJW3GmHTUBZbrFA3XqOpawP9VR73fmh1Gdqr3XRfpKiasDjFNSvCrfnhoBIo 21xPduEy3gznLz0DsshlytLIfBLE+Ly3Xx6sSmvlTFwpF6w1wWhwMX88rfixibtG59p1 ebkD2cgM2LHQtQT/XdE7MY/+JrfoqwBLEa8bLsRwKplvM1iWzgzcwPqDRqMzdfrQRUgz w2sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=goq6yCQP; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q17si23924749ilm.115.2021.07.20.02.39.43; Tue, 20 Jul 2021 02:39:55 -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=@gmail.com header.s=20161025 header.b=goq6yCQP; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231922AbhGTI6M (ORCPT + 99 others); Tue, 20 Jul 2021 04:58:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbhGTI6J (ORCPT ); Tue, 20 Jul 2021 04:58:09 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4494BC061574; Tue, 20 Jul 2021 02:38:47 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id t3so27631839edc.7; Tue, 20 Jul 2021 02:38:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=ob2cL9xsCuqI2PtZCWk4ZnfruGA/KtiWAaZc2Xrr4AE=; b=goq6yCQPn/6AnEsFbyX2k+3qh8cv1+Kn3s6p2QPPbSaOJTqpkvxalHq2CtwvJ/x9NH MaPHlgNqCVgT0yrQoPQxlanIWryDj5GNQkebvgmavNwAyt/sLhZiRD2uU5/FshixSweE tRXovwpnIBJCdOuFamWmlVnIT1wMpzyAMwBvzlS+a9nGB1U9InErKigu4UuRtbMWEgej +1URvihDMERpFLKHK+LbEJWBuGdVDbsLAVEZiMgl502Je1yTiPvO/TPBJmegUQ5BMwH8 0j0F8SxJQwBCpjDjI3gJ60pAY8W7DKaVDx/cwN+afAu/BiQoS3u8r++tINTjkE9mR8aP o7LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=ob2cL9xsCuqI2PtZCWk4ZnfruGA/KtiWAaZc2Xrr4AE=; b=db74qaueC+i+2fxS1k4Vc+ARBjFxr7aOJodBw8tUS8tt6vji8HrUTMd8DywYUAa0KH IbMVmGM5BMvzXV5c9af4Bqov2djL5xJrCnoUbQKLVvC1BctR8MFDQV/ne4KqecOv081/ FVJP6edrSbNFJpoEbOYYsy9sL8KU4aLBe+2csbTXIeYiCPMs7SmJMGVRfNA6nwqogmdM 0CR8ANqdTfDHWDJZZi10vgm44uHpsT3m3UJsPXmDZj8mx348plMkao7U+mt//Cd+i8+o yCdqX/bZjGn05on7fLGPz8ZTwvRBCc+w55DcuBL0R/BsmeMtMl9MRY/2stL1OtS2A6jX uJqQ== X-Gm-Message-State: AOAM532MEBdDz6ZVGXEAhbqQX9GoMqw6/JLAtvGb7nqYKl1qeWgc/6++ Lb8CSKwGp/SR7Qag/3+5KvDTskmeWeEKV3LaaEDzoFMSS7HTyQ== X-Received: by 2002:a05:6402:5209:: with SMTP id s9mr30408240edd.92.1626773925557; Tue, 20 Jul 2021 02:38:45 -0700 (PDT) MIME-Version: 1.0 From: Pintu Agarwal Date: Tue, 20 Jul 2021 15:08:34 +0530 Message-ID: Subject: Kernel 4.14: Using dm-verity with squashfs rootfs - mounting issue To: open list , Phillip Lougher , linux-fsdevel , linux-mtd , dm-devel@redhat.com, Kernelnewbies , agk@redhat.com, snitzer@redhat.com, shli@kernel.org, mpatocka@redhat.com, samitolvanen@google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 squash= fs. Logs: [....] [ 0.000000] Kernel command line: [...] verity=3D"96160 12020 d7b8a7d0c01b9aec888930841313a81603a50a2a7be44631c4c813197a50d681 0 " rootfstype=3Dsquashfs root=3D/dev/mtdblock34 ubi.mtd=3D30,0,30 [...] root=3D/dev/dm-0 dm=3D"system none ro,0 96160 verity 1 /dev/mtdblock34 /dev/mtdblock39 4096 4096 12020 8 sha256 d7b8a7d0c01b9aec888930841313a81603a50a2a7be44631c4c813197a50d681 aee087a5be3b982978c923f566a94613496b417f2af592639bc80d141e34dfe7" [....] [ 4.693620] vreg_conn_pa: disa=E2=96=92[ 4.700662] md: Skipping autodetection of RAID arrays. (raid=3Dautodetect 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=E2=96=92[ 4.534035] md: Skipping autodetection of RAID arrays. (raid=3Dautodetect 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