All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v4 2/6] kfuzztest: implement core module and input processing
@ 2026-01-13 19:58 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2026-01-13 19:58 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "low confidence static check warning: lib/kfuzztest/main.c:16:1: sparse: sparse: bad integer constant expression"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20260112192827.25989-3-ethan.w.s.graham@gmail.com>
References: <20260112192827.25989-3-ethan.w.s.graham@gmail.com>
TO: Ethan Graham <ethan.w.s.graham@gmail.com>
TO: ethan.w.s.graham@gmail.com
TO: glider@google.com
CC: akpm@linux-foundation.org
CC: andreyknvl@gmail.com
CC: andy@kernel.org
CC: andy.shevchenko@gmail.com
CC: brauner@kernel.org
CC: brendan.higgins@linux.dev
CC: davem@davemloft.net
CC: davidgow@google.com
CC: dhowells@redhat.com
CC: dvyukov@google.com
CC: ebiggers@kernel.org
CC: elver@google.com
CC: gregkh@linuxfoundation.org
CC: herbert@gondor.apana.org.au
CC: ignat@cloudflare.com
CC: jack@suse.cz
CC: jannh@google.com
CC: johannes@sipsolutions.net
CC: kasan-dev@googlegroups.com
CC: kees@kernel.org
CC: kunit-dev@googlegroups.com
CC: linux-crypto@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: linux-mm@kvack.org
CC: lukas@wunner.de
CC: mcgrof@kernel.org
CC: rmoar@google.com
CC: shuah@kernel.org

Hi Ethan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-nonmm-unstable]
[also build test WARNING on herbert-cryptodev-2.6/master herbert-crypto-2.6/master linus/master v6.19-rc5 next-20260113]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Ethan-Graham/kfuzztest-add-user-facing-API-and-data-structures/20260113-033045
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable
patch link:    https://lore.kernel.org/r/20260112192827.25989-3-ethan.w.s.graham%40gmail.com
patch subject: [PATCH v4 2/6] kfuzztest: implement core module and input processing
:::::: branch date: 24 hours ago
:::::: commit date: 24 hours ago
config: parisc-randconfig-r122-20260113 (https://download.01.org/0day-ci/archive/20260114/202601140318.GSsavXic-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 10.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260114/202601140318.GSsavXic-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202601140318.GSsavXic-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> lib/kfuzztest/main.c:16:1: sparse: sparse: bad integer constant expression
   lib/kfuzztest/main.c:16:1: sparse: sparse: static assertion failed: "MODULE_INFO(file, ...) contains embedded NUL byte"
>> lib/kfuzztest/main.c:16:1: sparse: sparse: bad integer constant expression
   lib/kfuzztest/main.c:16:1: sparse: sparse: static assertion failed: "MODULE_INFO(license, ...) contains embedded NUL byte"
   lib/kfuzztest/main.c:17:1: sparse: sparse: bad integer constant expression
   lib/kfuzztest/main.c:17:1: sparse: sparse: static assertion failed: "MODULE_INFO(author, ...) contains embedded NUL byte"
   lib/kfuzztest/main.c:18:1: sparse: sparse: bad integer constant expression
   lib/kfuzztest/main.c:18:1: sparse: sparse: static assertion failed: "MODULE_INFO(description, ...) contains embedded NUL byte"

vim +16 lib/kfuzztest/main.c

c4c203aad010667 Ethan Graham 2026-01-12  15  
c4c203aad010667 Ethan Graham 2026-01-12 @16  MODULE_LICENSE("GPL");
c4c203aad010667 Ethan Graham 2026-01-12  17  MODULE_AUTHOR("Ethan Graham <ethan.w.s.graham@gmail.com>");
c4c203aad010667 Ethan Graham 2026-01-12  18  MODULE_DESCRIPTION("Kernel Fuzz Testing Framework (KFuzzTest)");
c4c203aad010667 Ethan Graham 2026-01-12  19  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [PATCH v4 0/6] KFuzzTest: a new kernel fuzzing framework
@ 2026-01-12 19:28 Ethan Graham
  2026-01-12 19:28 ` [PATCH v4 2/6] kfuzztest: implement core module and input processing Ethan Graham
  0 siblings, 1 reply; 3+ messages in thread
From: Ethan Graham @ 2026-01-12 19:28 UTC (permalink / raw)
  To: ethan.w.s.graham, glider
  Cc: akpm, andreyknvl, andy, andy.shevchenko, brauner, brendan.higgins,
	davem, davidgow, dhowells, dvyukov, ebiggers, elver, gregkh,
	herbert, ignat, jack, jannh, johannes, kasan-dev, kees, kunit-dev,
	linux-crypto, linux-kernel, linux-mm, lukas, mcgrof, rmoar, shuah,
	sj, skhan, tarasmadan, wentaoz5

This patch series introduces KFuzzTest, a lightweight framework for
creating in-kernel fuzz targets for internal kernel functions.

The primary motivation for KFuzzTest is to simplify the fuzzing of
low-level, relatively stateless functions (e.g., data parsers, format
converters) that are difficult to exercise effectively from the syscall
boundary. It is intended for in-situ fuzzing of kernel code without
requiring that it be built as a separate userspace library or that its
dependencies be stubbed out.

Following feedback from the Linux Plumbers Conference and mailing list
discussions, this version of the framework has been significantly
simplified. It now focuses exclusively on handling raw binary inputs,
removing the complexity of the custom serialization format and DWARF
parsing found in previous iterations.

The core design consists of two main parts:
1. The `FUZZ_TEST_SIMPLE(name)` macro, which allows developers to define
   a fuzz test that accepts a buffer and its length.
2. A simplified debugfs interface that allows userspace fuzzers (or
   simple command-line tools) to pass raw binary blobs directly to the
   target function.

To validate the framework's end-to-end effectiveness, we performed an
experiment by manually introducing an off-by-one buffer over-read into
pkcs7_parse_message, like so:

- ret = asn1_ber_decoder(&pkcs7_decoder, ctx, data, datalen);
+ ret = asn1_ber_decoder(&pkcs7_decoder, ctx, data, datalen + 1);

A syzkaller instance fuzzing the new test_pkcs7_parse_message target
introduced in patch 7 successfully triggered the bug inside of
asn1_ber_decoder in under 30 seconds from a cold start. Similar
experiments on the other new fuzz targets (patches 8-9) also
successfully identified injected bugs, proving that KFuzzTest is
effective when paired with a coverage-guided fuzzing engine.

This patch series is structured as follows:
- Patch 1 introduces the core KFuzzTest API, including the main
  FUZZ_TEST_SIMPLE macro.
- Patch 2 adds the runtime implementation for the framework
- Patch 3 adds documentation.
- Patch 4 provides sample fuzz targets.
- Patch 5 defines fuzz targets for several functions in crypto/.
- Patch 6 adds maintainer information for KFuzzTest.

Changes since PR v3:
- Major simplification of the architecture, removing the complex
  `FUZZ_TEST` macro, the custom serialization format, domain
  constraints, annotations, and associated DWARF metadata regions.
- The framework now only supports `FUZZ_TEST_SIMPLE` targets, which
  accept raw binary data.
- Removed the userspace bridge tool as it is no longer required for
  serializing inputs.
- Updated documentation and samples to reflect the "simple-only"
  approach.

Ethan Graham (6):
  kfuzztest: add user-facing API and data structures
  kfuzztest: implement core module and input processing
  kfuzztest: add ReST documentation
  kfuzztest: add KFuzzTest sample fuzz targets
  crypto: implement KFuzzTest targets for PKCS7 and RSA parsing
  MAINTAINERS: add maintainer information for KFuzzTest

 Documentation/dev-tools/index.rst             |   1 +
 Documentation/dev-tools/kfuzztest.rst         | 152 ++++++++++++++++++
 MAINTAINERS                                   |   7 +
 crypto/asymmetric_keys/Makefile               |   2 +
 crypto/asymmetric_keys/tests/Makefile         |   4 +
 crypto/asymmetric_keys/tests/pkcs7_kfuzz.c    |  18 +++
 .../asymmetric_keys/tests/rsa_helper_kfuzz.c  |  24 +++
 include/asm-generic/vmlinux.lds.h             |  14 +-
 include/linux/kfuzztest.h                     |  90 +++++++++++
 lib/Kconfig.debug                             |   1 +
 lib/Makefile                                  |   2 +
 lib/kfuzztest/Kconfig                         |  16 ++
 lib/kfuzztest/Makefile                        |   4 +
 lib/kfuzztest/input.c                         |  47 ++++++
 lib/kfuzztest/main.c                          | 142 ++++++++++++++++
 samples/Kconfig                               |   7 +
 samples/Makefile                              |   1 +
 samples/kfuzztest/Makefile                    |   3 +
 samples/kfuzztest/underflow_on_buffer.c       |  52 ++++++
 19 files changed, 586 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/dev-tools/kfuzztest.rst
 create mode 100644 crypto/asymmetric_keys/tests/Makefile
 create mode 100644 crypto/asymmetric_keys/tests/pkcs7_kfuzz.c
 create mode 100644 crypto/asymmetric_keys/tests/rsa_helper_kfuzz.c
 create mode 100644 include/linux/kfuzztest.h
 create mode 100644 lib/kfuzztest/Kconfig
 create mode 100644 lib/kfuzztest/Makefile
 create mode 100644 lib/kfuzztest/input.c
 create mode 100644 lib/kfuzztest/main.c
 create mode 100644 samples/kfuzztest/Makefile
 create mode 100644 samples/kfuzztest/underflow_on_buffer.c

-- 
2.51.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-20 13:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-13 19:58 [PATCH v4 2/6] kfuzztest: implement core module and input processing kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-01-12 19:28 [PATCH v4 0/6] KFuzzTest: a new kernel fuzzing framework Ethan Graham
2026-01-12 19:28 ` [PATCH v4 2/6] kfuzztest: implement core module and input processing Ethan Graham
2026-01-20 13:39   ` Alexander Potapenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.