Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp287060rwi; Fri, 14 Oct 2022 01:51:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5IOcrbYbAFP++1i/dBlmE+K6H33qAREIoMxa9l9OkRWs/ayUABK5zg1nvgqwYX6WXP5VzI X-Received: by 2002:aa7:d651:0:b0:459:d1c:394e with SMTP id v17-20020aa7d651000000b004590d1c394emr3478483edr.10.1665737495783; Fri, 14 Oct 2022 01:51:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665737495; cv=none; d=google.com; s=arc-20160816; b=GlIqvyvdx1gJ7CUgDB3EMXE0YTAHtsYtDgF4ZOr+6Ohy7xoW4deI0llqeGWIG0GvhR IiJnHICZNJWUcOmkyeNDyhjyGiNWg5kHI8tOsM9zCuC2LyUQVnbgZ+gPXaxuBHkheny0 K5KQjTpQiYXaltAu2ZqM/g3g5f9n544N6FO/g1ng0J7lupinduf8YMT1NwZtV4IaCqsT ejyhnzlFHj/nuFnQ5EtQi+AEz4Bu1ydKh9gjwc8YSBPf++0Y7inim+0ecdVhDxbuV/br z1q0scBhXbUPkCRsNywPwmBzr1kj90i4AY+kQ/slHqDu3FO0+zuWPWKIGs57MiXfDFhS Wtiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=e7OO4yxaPUsVNNTpu1wi+buwSaoss8IhgddIo1BpRyE=; b=Xwi2H9FoufGXTV/YQXyPfIoLKL0qf3LWz7KgPd0WC9wQbyHFFDdyrPV5ztsnPsFocb iXNW37dt9m/BR9xcK52mSggfGJMRXeC3jbXkp4ZiaiTg+RsP5zVbiADMEPkTjJJFMZ8t uiUSXdTas076dLqSNkAtMBD3dROPZFeXlNS8QPHkRGYKTTGSOEbs/V4rbb9lGbPqn7oP 2K4i7QTtEIvCS3EFIbJiaPJdpU1TVZ10ydJW6DjE1NNDeQBdTCZSUNll/ULufNY+0CbS o9Mb+GMlrWAw+4wASHUuU0zlEwUKUQcmD2PHnBORyuZ49PUZORA6hNWtPt29m2+XRaO0 Ep/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oC6tSxas; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o16-20020aa7d3d0000000b00458be855265si1612005edr.211.2022.10.14.01.51.12; Fri, 14 Oct 2022 01:51:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oC6tSxas; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 S229683AbiJNItv (ORCPT + 99 others); Fri, 14 Oct 2022 04:49:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229843AbiJNItt (ORCPT ); Fri, 14 Oct 2022 04:49:49 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3ED7A14D0D; Fri, 14 Oct 2022 01:49:47 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id r8-20020a1c4408000000b003c47d5fd475so4907154wma.3; Fri, 14 Oct 2022 01:49:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=e7OO4yxaPUsVNNTpu1wi+buwSaoss8IhgddIo1BpRyE=; b=oC6tSxasgYZK7HLegRBPiSvjZcFyUQ6VxaiXUsn9DOOqsgYUd3GwVU3xpX+MEuUcs6 5Zyo5II4xi0HIqzm0H97V7F94fYQdDLt8AuD+JZzU47QQ/LuGMQdYOOGSKw2dxumvRKB h7m582fFWyx3oprKN1q8FSc+To8Y6JDmPTRnd4hkSq/AbbkLHlkBJXB8Q+TOCpRRhl2y d/+ZTjaaMTxKRAiVLHhe3QjKwq7Ra5hv6vxdw+Sr9ECBJR0PxYgvhE2OVPZwv9ed7dwQ BaLglkid8PnXT/nXhWq1sEkYBW8NVoxmsiJn/yjvdRctbBZZqCVrgn4QIC2aa5IUvmbp Ws2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e7OO4yxaPUsVNNTpu1wi+buwSaoss8IhgddIo1BpRyE=; b=XL74i7SrnEafyygwqndPmYzgZsyz5xv8aRX3nShDUB8UZzMW102kvWTgMzksiJ0QBj a9QTCq2slBog93m1ZY8taiHPlODB7uUphx0qWTqPlXqP528EcFi20QRVXxW/80uidg1D KcM0JTqHJulo/eO1XuF4+aUQmVczEBq892sKD30mWC3aYDGWmsQUMr+hQB+cFy20vqMW cCUhyZpECT2D3EwyzoQ3OV+IT414hcKurS/1sI0x3bzYAZSn9Al5cMNSIDSYBZDF2S+w Bc6eLy8VsZykfn4JOEIyb7iExzqUl6vagSCzFi3zIjU9h0a4iVsV6Hr9gO8e2wRYkvuW E6VQ== X-Gm-Message-State: ACrzQf1OSgvpomURKArEPa1ZinvZdmslNjbAINvcHXGu/IFFF0EjbNLj 4EraoY7iB02sUePlInCrM40= X-Received: by 2002:a05:600c:5388:b0:3c5:4c1:a1f6 with SMTP id hg8-20020a05600c538800b003c504c1a1f6mr2698975wmb.11.1665737385463; Fri, 14 Oct 2022 01:49:45 -0700 (PDT) Received: from hrutvik.c.googlers.com.com (120.142.205.35.bc.googleusercontent.com. [35.205.142.120]) by smtp.gmail.com with ESMTPSA id 123-20020a1c1981000000b003c6c4639ac6sm1547372wmz.34.2022.10.14.01.49.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 01:49:45 -0700 (PDT) From: Hrutvik Kanabar To: Hrutvik Kanabar Cc: Marco Elver , Aleksandr Nogikh , kasan-dev@googlegroups.com, Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Theodore Ts'o , Andreas Dilger , linux-ext4@vger.kernel.org, Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net, "Darrick J . Wong" , linux-xfs@vger.kernel.org, Namjae Jeon , Sungjong Seo , Anton Altaparmakov , linux-ntfs-dev@lists.sourceforge.net Subject: [PATCH RFC 1/7] fs: create `DISABLE_FS_CSUM_VERIFICATION` config option Date: Fri, 14 Oct 2022 08:48:31 +0000 Message-Id: <20221014084837.1787196-2-hrkanabar@gmail.com> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog In-Reply-To: <20221014084837.1787196-1-hrkanabar@gmail.com> References: <20221014084837.1787196-1-hrkanabar@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Hrutvik Kanabar When implemented and enabled, this should circumvent all redundant checksum verification in filesystem code. However, setting of checksums is not affected. The aim is to aid fuzzing efforts which randomly mutate disk images and so invalidate checksums. Checksum verification often rejects these mutated disk images, hindering fuzzer coverage of deep code paths. By disabling checksum verification, all mutated images are considered valid and so exploration of interesting code paths can continue. This option requires the `DEBUG_KERNEL` option, and is not intended to be used on production systems. Signed-off-by: Hrutvik Kanabar --- fs/Kconfig.debug | 20 ++++++++++++++++++++ lib/Kconfig.debug | 6 ++++++ 2 files changed, 26 insertions(+) create mode 100644 fs/Kconfig.debug diff --git a/fs/Kconfig.debug b/fs/Kconfig.debug new file mode 100644 index 000000000000..bc1018e3d580 --- /dev/null +++ b/fs/Kconfig.debug @@ -0,0 +1,20 @@ +# SPDX-License-Identifier: GPL-2.0-only + +config DISABLE_FS_CSUM_VERIFICATION + bool "Disable redundant checksum verification for filesystems" + depends on DEBUG_KERNEL + help + Disable filesystem checksum verification for checksums which can be + trivially recomputed from the on-disk data (i.e. no encryption). + Note that this does not affect setting of checksums. + + This option is useful for filesystem testing. For example, fuzzing + with randomly mutated disk images can uncover bugs exploitable by + specially-crafted disks. Redundant checksums are orthogonal to these + exploits, as they can be recomputed for crafted disks. However, for + testing it is more reliable to disable checksums within the kernel + than to maintain image generators which faithfully reimplement + per-filesystem checksum recomputation. + + Say N if you are unsure. Disable this for production systems! + diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 73178b0e43a4..4689ae527993 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -979,6 +979,12 @@ source "lib/Kconfig.kmsan" endmenu # "Memory Debugging" +menu "Filesystem Debugging" + +source "fs/Kconfig.debug" + +endmenu # "Filesystem Debugging" + config DEBUG_SHIRQ bool "Debug shared IRQ handlers" depends on DEBUG_KERNEL -- 2.38.0.413.g74048e4d9e-goog