public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Alexander Potapenko <glider@google.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Ethan Graham <ethan.w.s.graham@gmail.com>,
	ethangraham@google.com, andreyknvl@gmail.com, andy@kernel.org,
	brauner@kernel.org, brendan.higgins@linux.dev,
	davem@davemloft.net, davidgow@google.com, dhowells@redhat.com,
	dvyukov@google.com, elver@google.com,
	herbert@gondor.apana.org.au, ignat@cloudflare.com, jack@suse.cz,
	jannh@google.com, johannes@sipsolutions.net,
	kasan-dev@googlegroups.com, kees@kernel.org,
	kunit-dev@googlegroups.com, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	rmoar@google.com, shuah@kernel.org, sj@kernel.org,
	tarasmadan@google.com
Subject: Re: [PATCH v2 08/10] drivers/auxdisplay: add a KFuzzTest for parse_xy()
Date: Sat, 20 Sep 2025 14:47:40 +0200	[thread overview]
Message-ID: <aM6ibO75IidHOO3m@wunner.de> (raw)
In-Reply-To: <CAG_fn=XTcPrsgxg+MpFqnj9t2OoYa=SF1ts8odHFaMqD+YpZ_w@mail.gmail.com>

On Sat, Sep 20, 2025 at 02:08:01PM +0200, Alexander Potapenko wrote:
> On Sat, Sep 20, 2025 at 12:54 PM Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > On Fri, Sep 19, 2025 at 5:58 PM Ethan Graham <ethan.w.s.graham@gmail.com> wrote:
> > > +++ b/drivers/auxdisplay/charlcd.c
> > > @@ -682,3 +682,11 @@ EXPORT_SYMBOL_GPL(charlcd_unregister);
> > >
> > >  MODULE_DESCRIPTION("Character LCD core support");
> > >  MODULE_LICENSE("GPL");
> > > +
> > > +/*
> > > + * When CONFIG_KFUZZTEST is enabled, we include this _kfuzz.c file to ensure
> > > + * that KFuzzTest targets are built.
> > > + */
> > > +#ifdef CONFIG_KFUZZTEST
> > > +#include "tests/charlcd_kfuzz.c"
> > > +#endif /* CONFIG_KFUZZTEST */
> >
> > No, NAK. We don't want to see these in each and every module. Please,
> > make sure that nothing, except maybe Kconfig, is modified in this
> > folder (yet, you may add a _separate_ test module, as you already have
> > done in this patch).
> 
> This is one of the cases in which we can't go without changing the
> original code, because parse_xy() is a static function.
> Including the test into the source is not the only option, we could as
> well make the function visible unconditionally, or introduce a macro
> similar to VISIBLE_IF_KUNIT.
> Do you prefer any of those?

Just add something like this to drivers/auxdisplay/Makefile:

ifeq ($(CONFIG_KFUZZTEST),y)
CFLAGS_charlcd.o := -include $(src)/tests/charlcd_kfuzz.c
endif

Alternatively, if the file in tests/ always has the same name
as the source file but with "_kfuzz.c" suffix, consider amending
scripts/Makefile.build to always include the "_kfuzz.c" file
if it exists and CONFIG_KFUZZTEST=y, thus avoiding the need
to amend all the individual Makefiles in the tree.

Thanks,

Lukas


  reply	other threads:[~2025-09-20 12:47 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 14:57 [PATCH v2 0/10] KFuzzTest: a new kernel fuzzing framework Ethan Graham
2025-09-19 14:57 ` [PATCH v2 01/10] mm/kasan: implement kasan_poison_range Ethan Graham
2025-09-23 16:46   ` Andrey Konovalov
2025-09-19 14:57 ` [PATCH v2 02/10] kfuzztest: add user-facing API and data structures Ethan Graham
2025-09-19 15:05   ` Alexander Potapenko
2025-09-24  8:44   ` Johannes Berg
2025-09-19 14:57 ` [PATCH v2 03/10] kfuzztest: implement core module and input processing Ethan Graham
2025-09-19 15:05   ` Alexander Potapenko
2025-09-19 14:57 ` [PATCH v2 04/10] tools: add kfuzztest-bridge utility Ethan Graham
2025-09-19 15:05   ` Alexander Potapenko
2025-09-19 14:57 ` [PATCH v2 05/10] kfuzztest: add ReST documentation Ethan Graham
2025-09-19 14:57 ` [PATCH v2 06/10] kfuzztest: add KFuzzTest sample fuzz targets Ethan Graham
2025-09-19 14:57 ` [PATCH v2 07/10] crypto: implement KFuzzTest targets for PKCS7 and RSA parsing Ethan Graham
2025-09-19 14:57 ` [PATCH v2 08/10] drivers/auxdisplay: add a KFuzzTest for parse_xy() Ethan Graham
2025-09-19 15:07   ` Alexander Potapenko
2025-09-20 10:53   ` Andy Shevchenko
2025-09-20 12:08     ` Alexander Potapenko
2025-09-20 12:47       ` Lukas Wunner [this message]
2025-09-21 18:25         ` Andy Shevchenko
2025-09-24  9:28   ` kernel test robot
2025-09-19 14:57 ` [PATCH v2 09/10] fs/binfmt_script: add KFuzzTest target for load_script Ethan Graham
2025-09-19 15:07   ` Alexander Potapenko
2025-09-19 19:19   ` Kees Cook
2025-09-19 14:57 ` [PATCH v2 10/10] MAINTAINERS: add maintainer information for KFuzzTest Ethan Graham
2025-09-24  8:32   ` SeongJae Park
2025-09-19 15:04 ` [PATCH v2 0/10] KFuzzTest: a new kernel fuzzing framework Alexander Potapenko
2025-09-24 12:52 ` Johannes Berg
2025-09-25  8:35   ` Ethan Graham
2025-10-24  8:37     ` Johannes Berg
2025-10-28 17:38       ` Alexander Potapenko

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=aM6ibO75IidHOO3m@wunner.de \
    --to=lukas@wunner.de \
    --cc=andreyknvl@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --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=elver@google.com \
    --cc=ethan.w.s.graham@gmail.com \
    --cc=ethangraham@google.com \
    --cc=glider@google.com \
    --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=rmoar@google.com \
    --cc=shuah@kernel.org \
    --cc=sj@kernel.org \
    --cc=tarasmadan@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox