[RFC,1/7] fs: create `DISABLE_FS_CSUM_VERIFICATION` config option
Commit Message
From: Hrutvik Kanabar <hrutvik@google.com>
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 <hrutvik@google.com>
---
fs/Kconfig.debug | 20 ++++++++++++++++++++
lib/Kconfig.debug | 6 ++++++
2 files changed, 26 insertions(+)
create mode 100644 fs/Kconfig.debug
new file mode 100644
@@ -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!
+
@@ -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