From patchwork Fri Jul 15 20:31:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Burkov X-Patchwork-Id: 12919646 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A56ECCA47F for ; Fri, 15 Jul 2022 20:32:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230210AbiGOUcD (ORCPT ); Fri, 15 Jul 2022 16:32:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbiGOUcC (ORCPT ); Fri, 15 Jul 2022 16:32:02 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A5A15B044; Fri, 15 Jul 2022 13:31:57 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 479175C00F3; Fri, 15 Jul 2022 16:31:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 15 Jul 2022 16:31:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bur.io; h=cc:cc :content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1657917116; x=1658003516; bh=Td ZnSCJGNrBEC/2Qzr7d09NUMvR1tmi1sQGMRBURoQM=; b=coF83jTAYKIKroUI9j fACJSpnpySdKlXU8v7Z/f/ait0aVmNr2Gut7uSaSvYmenspjOrAeu5YwfbvSuEB0 HViMEOEcVbszUjx/WF/EDMs4WyFVQT+1I8JwQjGfpDBFi0EfL/yjHp+fUSGZ98yx CRKx90DgVX0Xj0Rk6iH+Ql4JDtvoCRnVcRTUKZ1XQz8Gc4zTRtBamw7s9MvoNiHP hcnxMPCtX85hcNgdiDW924GqIoR2uOHQRMDUh9HcgamBfaJhjYAPsoUcc1hlehCg C2DIZMCTyRnBlS6oSbnyE9zcHm3wM1GcLCbuznye4rYbm+CLANtjOf4qym+V8R2r uO/A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1657917116; x=1658003516; bh=TdZnSCJGNrBEC /2Qzr7d09NUMvR1tmi1sQGMRBURoQM=; b=PhxR2vtVxbqkWzGEY4yS93Um1Gfe8 904Izf/YmUUGLqlFwfszQBMGUg3yRwWTAEYwWYIBCrPN7zLiKuHK8yha0AcPARp2 HdtjLSKkbIZnuEGFAVy/yxt5kRNzxbZdDbJWn6k3Wvrrh1pdqRP02LypsgBv+C3Q ztA8FOTAXE0cmKnHvq6tvH7kuKLjJ02sqSUXRpSVjQy+kUd8L9NLdbhGHZV4h0qf wR5vmGPge/yAILqDm9+CQh7J6LG/CqYqOg/IkKuOm1iOY6eYXM/PthE+T1y8D4cX rTp9ev8spQZyj868VI4aZhfYTF1Xre3jC1k45OK0oea1srOUZLY5uFDbA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudekuddgudehfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeeuohhr ihhsuceuuhhrkhhovhcuoegsohhrihhssegsuhhrrdhioheqnecuggftrfgrthhtvghrnh epgeduteffveeileetueejheevveeugfdttddvgfeijefhjeetjeduffehkeelkeehnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepsghorhhish essghurhdrihho X-ME-Proxy: Feedback-ID: i083147f8:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 15 Jul 2022 16:31:55 -0400 (EDT) From: Boris Burkov To: fstests@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-btrfs@vger.kernel.org, kernel-team@fb.com Cc: Eric Biggers , Josef Bacik Subject: [PATCH v10 1/5] common/verity: require corruption functionality Date: Fri, 15 Jul 2022 13:31:48 -0700 Message-Id: <8a0a68f0729b66fceb43e2638305fc85ace58702.1657916662.git.boris@bur.io> X-Mailer: git-send-email 2.37.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org Corrupting ext4 and f2fs relies on xfs_io fiemap. Btrfs corruption testing will rely on a btrfs specific corruption utility. Add the ability to require corruption functionality to make this properly modular. To start, just check for fiemap, as that is needed universally for _fsv_scratch_corrupt_bytes. Signed-off-by: Boris Burkov Reviewed-by: Josef Bacik Reviewed-by: Eric Biggers --- common/verity | 6 ++++++ tests/generic/574 | 1 + tests/generic/576 | 1 + 3 files changed, 8 insertions(+) diff --git a/common/verity b/common/verity index 38eea157..d58cad90 100644 --- a/common/verity +++ b/common/verity @@ -141,6 +141,12 @@ _require_fsverity_dump_metadata() _fail "Unexpected output from 'fsverity dump_metadata': $(<"$tmpfile")" } +# Check for userspace tools needed to corrupt verity data or metadata. +_require_fsverity_corruption() +{ + _require_xfs_io_command "fiemap" +} + _scratch_mkfs_verity() { case $FSTYP in diff --git a/tests/generic/574 b/tests/generic/574 index 882baa21..17fdea52 100755 --- a/tests/generic/574 +++ b/tests/generic/574 @@ -28,6 +28,7 @@ _cleanup() _supported_fs generic _require_scratch_verity _disable_fsverity_signatures +_require_fsverity_corruption _scratch_mkfs_verity &>> $seqres.full _scratch_mount diff --git a/tests/generic/576 b/tests/generic/576 index 3ef04953..c8862de2 100755 --- a/tests/generic/576 +++ b/tests/generic/576 @@ -28,6 +28,7 @@ _supported_fs generic _require_scratch_verity _require_scratch_encryption _require_command "$KEYCTL_PROG" keyctl +_require_fsverity_corruption _disable_fsverity_signatures _scratch_mkfs_encrypted_verity &>> $seqres.full