From: Alexander Potapenko <glider@google.com>
To: Ethan Graham <ethan.w.s.graham@gmail.com>
Cc: ethangraham@google.com, andreyknvl@gmail.com,
brendan.higgins@linux.dev, davidgow@google.com,
dvyukov@google.com, jannh@google.com, elver@google.com,
rmoar@google.com, shuah@kernel.org, tarasmadan@google.com,
kasan-dev@googlegroups.com, kunit-dev@googlegroups.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
dhowells@redhat.com, lukas@wunner.de, ignat@cloudflare.com,
herbert@gondor.apana.org.au, davem@davemloft.net,
linux-crypto@vger.kernel.org
Subject: Re: [PATCH v2 RFC 5/7] kfuzztest: add ReST documentation
Date: Thu, 4 Sep 2025 10:53:32 +0200 [thread overview]
Message-ID: <CAG_fn=VBbSqb07-pbbEw7F=SP5_t74Re7ki0+ZS=mBm2S9BehA@mail.gmail.com> (raw)
In-Reply-To: <20250901164212.460229-6-ethan.w.s.graham@gmail.com>
On Mon, Sep 1, 2025 at 6:43 PM Ethan Graham <ethan.w.s.graham@gmail.com> wrote:
>
> From: Ethan Graham <ethangraham@google.com>
>
> Add Documentation/dev-tools/kfuzztest.rst and reference it in the
> dev-tools index.
>
> Signed-off-by: Ethan Graham <ethangraham@google.com>
Acked-by: Alexander Potapenko <glider@google.com>
Some nits below.
> +Macros ``FUZZ_TEST``, `KFUZZTEST_EXPECT_*`` and ``KFUZZTEST_ANNOTATE_*`` embed
Nit: missing second backtick before KFUZZTEST_EXPECT_
> +Input Format
> +============
> +
> +KFuzzTest targets receive their inputs from userspace via a write to a dedicated
> +debugfs ``/sys/kernel/debug/kfuzztest/<test-name>/input``.
Nit: "debugfs file"?
> +- Padding and Poisoning: The space between the end of one region's data and the
> + beginning of the next must be sufficient for padding. In KASAN builds,
> + KFuzzTest poisons this unused padding, allowing for precise detection of
> + out-of-bounds memory accesses between adjacent buffers. This padding should
> + be at least ``KFUZZTEST_POISON_SIZE`` bytes as defined in
> + `include/linux/kfuzztest.h``.
Nit: missing leading backtick.
> +
> +KFuzzTest Bridge Tool
> +=====================
> +
> +The kfuzztest-bridge program is a userspace utility that encodes a random byte
Nit: do we need backticks around kfuzztest-bridge?
> +This tool is intended to be simple, both in usage and implementation. Its
> +structure and DSL are sufficient for simpler use-cases. For more advanced
> +coverage-guided fuzzing it is recommended to use syzkaller which implements
> +deeper support for KFuzzTest targets.
Nit: please add a link to syzkaller.
> +
> +The textual format is a human-readable representation of the region-based binary
> +format used by KFuzzTest. It is described by the following grammar:
> +
> +.. code-block:: text
> +
> + schema ::= region ( ";" region )* [";"]
> + region ::= identifier "{" type+ "}"
Don't types need to be separated with spaces?
> + type ::= primitive | pointer | array | length | string
> + primitive ::= "u8" | "u16" | "u32" | "u64"
> + pointer ::= "ptr" "[" identifier "]"
> + array ::= "arr" "[" primitive "," integer "]"
> + length ::= "len" "[" identifier "," primitive "]"
> + string ::= "str" "[" integer "]"
> + identifier ::= [a-zA-Z_][a-zA-Z1-9_]*
> + integer ::= [0-9]+
> +
> +Pointers must reference a named region. To fuzz a raw buffer, the buffer must be
Maybe insert a paragraph break between these two sentences?
> +.. code-block:: text
> +
> + my_struct { ptr[buf] len[buf, u64] }; buf { arr[u8, n] };
> +
> +Where ``n`` is some integer value defining the size of the byte array inside of
s/Where/, where/ ?
next prev parent reply other threads:[~2025-09-04 8:54 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-01 16:42 [PATCH v2 RFC 0/7] KFuzzTest: a new kernel fuzzing framework Ethan Graham
2025-09-01 16:42 ` [PATCH v2 RFC 1/7] mm/kasan: implement kasan_poison_range Ethan Graham
2025-09-05 8:32 ` Alexander Potapenko
2025-09-05 8:46 ` Ethan Graham
2025-09-05 9:32 ` Alexander Potapenko
2025-09-01 16:42 ` [PATCH v2 RFC 2/7] kfuzztest: add user-facing API and data structures Ethan Graham
2025-09-02 10:37 ` Marco Elver
2025-09-03 8:40 ` Alexander Potapenko
2025-09-03 10:15 ` Alexander Potapenko
2025-09-03 11:35 ` Alexander Potapenko
2025-09-01 16:42 ` [PATCH v2 RFC 3/7] kfuzztest: implement core module and input processing Ethan Graham
2025-09-03 9:53 ` Alexander Potapenko
2025-09-01 16:42 ` [PATCH v2 RFC 4/7] tools: add kfuzztest-bridge utility Ethan Graham
2025-09-03 14:07 ` Alexander Potapenko
2025-09-05 10:43 ` Alexander Potapenko
2025-09-01 16:42 ` [PATCH v2 RFC 5/7] kfuzztest: add ReST documentation Ethan Graham
2025-09-04 8:53 ` Alexander Potapenko [this message]
2025-09-01 16:42 ` [PATCH v2 RFC 6/7] kfuzztest: add KFuzzTest sample fuzz targets Ethan Graham
2025-09-04 9:59 ` Alexander Potapenko
2025-09-01 16:42 ` [PATCH v2 RFC 7/7] crypto: implement KFuzzTest targets for PKCS7 and RSA parsing Ethan Graham
2025-09-03 8:58 ` Ignat Korchagin
2025-09-04 20:20 ` Ethan Graham
2025-09-04 9:11 ` [PATCH v2 RFC 0/7] KFuzzTest: a new kernel fuzzing framework David Gow
2025-09-04 20:08 ` Ethan Graham
2025-09-08 13:11 ` Johannes Berg
2025-09-10 10:40 ` Alexander Potapenko
2025-09-10 15:59 ` Johannes Berg
2025-09-11 13:59 ` Johannes Berg
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='CAG_fn=VBbSqb07-pbbEw7F=SP5_t74Re7ki0+ZS=mBm2S9BehA@mail.gmail.com' \
--to=glider@google.com \
--cc=andreyknvl@gmail.com \
--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=herbert@gondor.apana.org.au \
--cc=ignat@cloudflare.com \
--cc=jannh@google.com \
--cc=kasan-dev@googlegroups.com \
--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=rmoar@google.com \
--cc=shuah@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;
as well as URLs for NNTP newsgroup(s).