All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ethan Graham <ethan.w.s.graham@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH v1 RFC 6/6] crypto: implement KFuzzTest targets for PKCS7 and RSA parsing
Date: Thu, 14 Aug 2025 13:32:48 +0800	[thread overview]
Message-ID: <202508141303.fVgUvadx-lkp@intel.com> (raw)
In-Reply-To: <20250813133812.926145-7-ethan.w.s.graham@gmail.com>

Hi Ethan,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on herbert-cryptodev-2.6/master]
[also build test ERROR on herbert-crypto-2.6/master linus/master v6.17-rc1 next-20250813]
[cannot apply to akpm-mm/mm-nonmm-unstable]
[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/mm-kasan-implement-kasan_poison_range/20250813-214228
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
patch link:    https://lore.kernel.org/r/20250813133812.926145-7-ethan.w.s.graham%40gmail.com
patch subject: [PATCH v1 RFC 6/6] crypto: implement KFuzzTest targets for PKCS7 and RSA parsing
config: x86_64-buildonly-randconfig-003-20250814 (https://download.01.org/0day-ci/archive/20250814/202508141303.fVgUvadx-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250814/202508141303.fVgUvadx-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/oe-kbuild-all/202508141303.fVgUvadx-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from crypto/asymmetric_keys/pkcs7_parser.c:16:
>> include/linux/kfuzztest.h:418:37: error: expected identifier or '(' before ':' token
     418 | enum kfuzztest_annotation_attribute : uint8_t {
         |                                     ^
>> include/linux/kfuzztest.h:452:45: error: field 'attrib' has incomplete type
     452 |         enum kfuzztest_annotation_attribute attrib;
         |                                             ^~~~~~
   crypto/asymmetric_keys/pkcs7_parser.c: In function 'kfuzztest_logic_test_pkcs7_parse_message':
>> include/linux/kfuzztest.h:497:61: error: 'ATTRIBUTE_LEN' undeclared (first use in this function)
     497 |         __KFUZZTEST_ANNOTATE(arg_type, field, linked_field, ATTRIBUTE_LEN)
         |                                                             ^~~~~~~~~~~~~
   include/linux/kfuzztest.h:461:35: note: in definition of macro '__KFUZZTEST_ANNOTATE'
     461 |                         .attrib = attribute,                                                                    \
         |                                   ^~~~~~~~~
   crypto/asymmetric_keys/pkcs7_parser.c:181:9: note: in expansion of macro 'KFUZZTEST_ANNOTATE_LEN'
     181 |         KFUZZTEST_ANNOTATE_LEN(pkcs7_parse_message_arg, datalen, data);
         |         ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/kfuzztest.h:497:61: note: each undeclared identifier is reported only once for each function it appears in
     497 |         __KFUZZTEST_ANNOTATE(arg_type, field, linked_field, ATTRIBUTE_LEN)
         |                                                             ^~~~~~~~~~~~~
   include/linux/kfuzztest.h:461:35: note: in definition of macro '__KFUZZTEST_ANNOTATE'
     461 |                         .attrib = attribute,                                                                    \
         |                                   ^~~~~~~~~
   crypto/asymmetric_keys/pkcs7_parser.c:181:9: note: in expansion of macro 'KFUZZTEST_ANNOTATE_LEN'
     181 |         KFUZZTEST_ANNOTATE_LEN(pkcs7_parse_message_arg, datalen, data);
         |         ^~~~~~~~~~~~~~~~~~~~~~


vim +418 include/linux/kfuzztest.h

cc1dba9238a428 Ethan Graham 2025-08-13  390  
cc1dba9238a428 Ethan Graham 2025-08-13  391  /**
cc1dba9238a428 Ethan Graham 2025-08-13  392   * KFUZZTEST_EXPECT_IN_RANGE - constrain a field to be within a range
cc1dba9238a428 Ethan Graham 2025-08-13  393   *
cc1dba9238a428 Ethan Graham 2025-08-13  394   * @arg_type: name of the input structure, without the leading "struct ".
cc1dba9238a428 Ethan Graham 2025-08-13  395   * @field: some field that is comparable.
cc1dba9238a428 Ethan Graham 2025-08-13  396   * @lower_bound: a lower bound of the same type as @arg_type.@field.
cc1dba9238a428 Ethan Graham 2025-08-13  397   * @upper_bound: an upper bound of the same type as @arg_type.@field.
cc1dba9238a428 Ethan Graham 2025-08-13  398   */
cc1dba9238a428 Ethan Graham 2025-08-13  399  #define KFUZZTEST_EXPECT_IN_RANGE(arg_type, field, lower_bound, upper_bound)                              \
cc1dba9238a428 Ethan Graham 2025-08-13  400  	do {                                                                                              \
cc1dba9238a428 Ethan Graham 2025-08-13  401  		if (arg->field < lower_bound || arg->field > upper_bound)                                 \
cc1dba9238a428 Ethan Graham 2025-08-13  402  			return;                                                                           \
cc1dba9238a428 Ethan Graham 2025-08-13  403  		__KFUZZTEST_DEFINE_CONSTRAINT(arg_type, field, lower_bound, upper_bound, EXPECT_IN_RANGE) \
cc1dba9238a428 Ethan Graham 2025-08-13  404  	} while (0)
cc1dba9238a428 Ethan Graham 2025-08-13  405  
cc1dba9238a428 Ethan Graham 2025-08-13  406  /**
cc1dba9238a428 Ethan Graham 2025-08-13  407   * Annotations express attributes about structure fields that can't be easily
cc1dba9238a428 Ethan Graham 2025-08-13  408   * or safely verified at runtime. They are intended as hints to the fuzzing
cc1dba9238a428 Ethan Graham 2025-08-13  409   * engine to help it generate more semantically correct and effective inputs.
cc1dba9238a428 Ethan Graham 2025-08-13  410   * Unlike constraints, annotations do not add any runtime checks and do not
cc1dba9238a428 Ethan Graham 2025-08-13  411   * cause a test to exit early.
cc1dba9238a428 Ethan Graham 2025-08-13  412   *
cc1dba9238a428 Ethan Graham 2025-08-13  413   * For example, a `char *` field could be a raw byte buffer or a C-style
cc1dba9238a428 Ethan Graham 2025-08-13  414   * null-terminated string. A fuzzer that is aware of this distinction can avoid
cc1dba9238a428 Ethan Graham 2025-08-13  415   * creating inputs that would cause trivial, uninteresting crashes from reading
cc1dba9238a428 Ethan Graham 2025-08-13  416   * past the end of a non-null-terminated buffer.
cc1dba9238a428 Ethan Graham 2025-08-13  417   */
cc1dba9238a428 Ethan Graham 2025-08-13 @418  enum kfuzztest_annotation_attribute : uint8_t {
cc1dba9238a428 Ethan Graham 2025-08-13  419  	ATTRIBUTE_LEN,
cc1dba9238a428 Ethan Graham 2025-08-13  420  	ATTRIBUTE_STRING,
cc1dba9238a428 Ethan Graham 2025-08-13  421  	ATTRIBUTE_ARRAY,
cc1dba9238a428 Ethan Graham 2025-08-13  422  };
cc1dba9238a428 Ethan Graham 2025-08-13  423  
cc1dba9238a428 Ethan Graham 2025-08-13  424  /**
cc1dba9238a428 Ethan Graham 2025-08-13  425   * struct kfuzztest_annotation - a metadata record for a fuzzer hint
cc1dba9238a428 Ethan Graham 2025-08-13  426   *
cc1dba9238a428 Ethan Graham 2025-08-13  427   * This struct captures a single hint about a field in the input structure.
cc1dba9238a428 Ethan Graham 2025-08-13  428   * Instances are generated by the KFUZZTEST_ANNOTATE_* macros and are placed
cc1dba9238a428 Ethan Graham 2025-08-13  429   * into the read-only ".kfuzztest_annotation" ELF section of the vmlinux binary.
cc1dba9238a428 Ethan Graham 2025-08-13  430   *
cc1dba9238a428 Ethan Graham 2025-08-13  431   * A userspace fuzzer can parse this section to understand the semantic
cc1dba9238a428 Ethan Graham 2025-08-13  432   * relationships between fields (e.g., which field is a length for which
cc1dba9238a428 Ethan Graham 2025-08-13  433   * buffer) and the expected format of the data (e.g., a null-terminated
cc1dba9238a428 Ethan Graham 2025-08-13  434   * string). This allows the fuzzer to be much more intelligent during input
cc1dba9238a428 Ethan Graham 2025-08-13  435   * generation and mutation.
cc1dba9238a428 Ethan Graham 2025-08-13  436   *
cc1dba9238a428 Ethan Graham 2025-08-13  437   * For an example of how annotations are used within a fuzz test, see the
cc1dba9238a428 Ethan Graham 2025-08-13  438   * documentation for the FUZZ_TEST() macro.
cc1dba9238a428 Ethan Graham 2025-08-13  439   *
cc1dba9238a428 Ethan Graham 2025-08-13  440   * @input_type: The name of the input struct type.
cc1dba9238a428 Ethan Graham 2025-08-13  441   * @field_name: The name of the field being annotated (e.g., the data
cc1dba9238a428 Ethan Graham 2025-08-13  442   *	buffer field).
cc1dba9238a428 Ethan Graham 2025-08-13  443   * @linked_field_name: For annotations that link two fields (like
cc1dba9238a428 Ethan Graham 2025-08-13  444   *	ATTRIBUTE_LEN), this is the name of the related field (e.g., the
cc1dba9238a428 Ethan Graham 2025-08-13  445   *	length field). For others, this may be unused.
cc1dba9238a428 Ethan Graham 2025-08-13  446   * @attrib: The type of the annotation hint.
cc1dba9238a428 Ethan Graham 2025-08-13  447   */
cc1dba9238a428 Ethan Graham 2025-08-13  448  struct kfuzztest_annotation {
cc1dba9238a428 Ethan Graham 2025-08-13  449  	const char *input_type;
cc1dba9238a428 Ethan Graham 2025-08-13  450  	const char *field_name;
cc1dba9238a428 Ethan Graham 2025-08-13  451  	const char *linked_field_name;
cc1dba9238a428 Ethan Graham 2025-08-13 @452  	enum kfuzztest_annotation_attribute attrib;
cc1dba9238a428 Ethan Graham 2025-08-13  453  } __aligned(32);
cc1dba9238a428 Ethan Graham 2025-08-13  454  
cc1dba9238a428 Ethan Graham 2025-08-13  455  #define __KFUZZTEST_ANNOTATE(arg_type, field, linked_field, attribute)                                          \
cc1dba9238a428 Ethan Graham 2025-08-13  456  	static struct kfuzztest_annotation __annotation_##arg_type##_##field __section(".kfuzztest_annotation") \
cc1dba9238a428 Ethan Graham 2025-08-13  457  		__used = {                                                                                      \
cc1dba9238a428 Ethan Graham 2025-08-13  458  			.input_type = "struct " #arg_type,                                                      \
cc1dba9238a428 Ethan Graham 2025-08-13  459  			.field_name = #field,                                                                   \
cc1dba9238a428 Ethan Graham 2025-08-13  460  			.linked_field_name = #linked_field,                                                     \
cc1dba9238a428 Ethan Graham 2025-08-13  461  			.attrib = attribute,                                                                    \
cc1dba9238a428 Ethan Graham 2025-08-13  462  		}
cc1dba9238a428 Ethan Graham 2025-08-13  463  
cc1dba9238a428 Ethan Graham 2025-08-13  464  /**
cc1dba9238a428 Ethan Graham 2025-08-13  465   * KFUZZTEST_ANNOTATE_STRING - annotate a char* field as a C string
cc1dba9238a428 Ethan Graham 2025-08-13  466   *
cc1dba9238a428 Ethan Graham 2025-08-13  467   * We define a C string as a sequence of non-zero characters followed by exactly
cc1dba9238a428 Ethan Graham 2025-08-13  468   * one null terminator.
cc1dba9238a428 Ethan Graham 2025-08-13  469   *
cc1dba9238a428 Ethan Graham 2025-08-13  470   * @arg_type: name of the input structure, without the leading "struct ".
cc1dba9238a428 Ethan Graham 2025-08-13  471   * @field: the name of the field to annotate.
cc1dba9238a428 Ethan Graham 2025-08-13  472   */
cc1dba9238a428 Ethan Graham 2025-08-13  473  #define KFUZZTEST_ANNOTATE_STRING(arg_type, field) __KFUZZTEST_ANNOTATE(arg_type, field, NULL, ATTRIBUTE_STRING)
cc1dba9238a428 Ethan Graham 2025-08-13  474  
cc1dba9238a428 Ethan Graham 2025-08-13  475  /**
cc1dba9238a428 Ethan Graham 2025-08-13  476   * KFUZZTEST_ANNOTATE_ARRAY - annotate a pointer as an array
cc1dba9238a428 Ethan Graham 2025-08-13  477   *
cc1dba9238a428 Ethan Graham 2025-08-13  478   * We define an array as a contiguous memory region containing zero or more
cc1dba9238a428 Ethan Graham 2025-08-13  479   * elements of the same type.
cc1dba9238a428 Ethan Graham 2025-08-13  480   *
cc1dba9238a428 Ethan Graham 2025-08-13  481   * @arg_type: name of the input structure, without the leading "struct ".
cc1dba9238a428 Ethan Graham 2025-08-13  482   * @field: the name of the field to annotate.
cc1dba9238a428 Ethan Graham 2025-08-13  483   */
cc1dba9238a428 Ethan Graham 2025-08-13  484  #define KFUZZTEST_ANNOTATE_ARRAY(arg_type, field) __KFUZZTEST_ANNOTATE(arg_type, field, NULL, ATTRIBUTE_ARRAY)
cc1dba9238a428 Ethan Graham 2025-08-13  485  
cc1dba9238a428 Ethan Graham 2025-08-13  486  /**
cc1dba9238a428 Ethan Graham 2025-08-13  487   * KFUZZTEST_ANNOTATE_LEN - annotate a field as the length of another
cc1dba9238a428 Ethan Graham 2025-08-13  488   *
cc1dba9238a428 Ethan Graham 2025-08-13  489   * This expresses the relationship `arg_type.field == len(linked_field)`, where
cc1dba9238a428 Ethan Graham 2025-08-13  490   * `linked_field` is an array.
cc1dba9238a428 Ethan Graham 2025-08-13  491   *
cc1dba9238a428 Ethan Graham 2025-08-13  492   * @arg_type: name of the input structure, without the leading "struct ".
cc1dba9238a428 Ethan Graham 2025-08-13  493   * @field: the name of the field to annotate.
cc1dba9238a428 Ethan Graham 2025-08-13  494   * @linked_field: the name of an array field with length @field.
cc1dba9238a428 Ethan Graham 2025-08-13  495   */
cc1dba9238a428 Ethan Graham 2025-08-13  496  #define KFUZZTEST_ANNOTATE_LEN(arg_type, field, linked_field) \
cc1dba9238a428 Ethan Graham 2025-08-13 @497  	__KFUZZTEST_ANNOTATE(arg_type, field, linked_field, ATTRIBUTE_LEN)
cc1dba9238a428 Ethan Graham 2025-08-13  498  

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

  parent reply	other threads:[~2025-08-14  5:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-13 13:38 [PATCH v1 RFC 0/6] kfuzztest: a new kernel fuzzing framework Ethan Graham
2025-08-13 13:38 ` [PATCH v1 RFC 1/6] mm/kasan: implement kasan_poison_range Ethan Graham
2025-08-13 13:38 ` [PATCH v1 RFC 2/6] kfuzztest: add user-facing API and data structures Ethan Graham
2025-08-13 13:38 ` [PATCH v1 RFC 3/6] kfuzztest: implement core module and input processing Ethan Graham
2025-08-14 15:07   ` kernel test robot
2025-08-22  8:57   ` David Gow
2025-08-22  8:57     ` David Gow
2025-08-13 13:38 ` [PATCH v1 RFC 4/6] kfuzztest: add ReST documentation Ethan Graham
2025-08-13 13:38 ` [PATCH v1 RFC 5/6] kfuzztest: add KFuzzTest sample fuzz targets Ethan Graham
2025-08-13 13:38 ` [PATCH v1 RFC 6/6] crypto: implement KFuzzTest targets for PKCS7 and RSA parsing Ethan Graham
2025-08-13 18:13   ` Marco Elver
2025-08-14 15:28     ` Ignat Korchagin
2025-08-15  1:17       ` Eric Biggers
2025-08-15 13:00         ` Ignat Korchagin
2025-08-19 10:08           ` Marco Elver
2025-08-19 11:41             ` Ignat Korchagin
2025-08-22  8:15             ` Ethan Graham
2025-08-22  8:57             ` David Gow
2025-08-14  5:32   ` kernel test robot [this message]
2025-08-14  6:36   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202508141303.fVgUvadx-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ethan.w.s.graham@gmail.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.