Re: [PATCH v2 03/10] kfuzztest: implement core module and input processing
From: Alexander Potapenko
Date: Fri Sep 19 2025 - 11:06:11 EST
On Fri, Sep 19, 2025 at 4:58 PM Ethan Graham <ethan.w.s.graham@xxxxxxxxx> wrote:
>
> From: Ethan Graham <ethangraham@xxxxxxxxxx>
>
> Add the core runtime implementation for KFuzzTest. This includes the
> module initialization, and the logic for receiving and processing
> user-provided inputs through debugfs.
>
> On module load, the framework discovers all test targets by iterating
> over the .kfuzztest_target section, creating a corresponding debugfs
> directory with a write-only 'input' file for each of them.
>
> Writing to an 'input' file triggers the main fuzzing sequence:
> 1. The serialized input is copied from userspace into a kernel buffer.
> 2. The buffer is parsed to validate the region array and relocation
> table.
> 3. Pointers are patched based on the relocation entries, and in KASAN
> builds the inter-region padding is poisoned.
> 4. The resulting struct is passed to the user-defined test logic.
>
> Signed-off-by: Ethan Graham <ethangraham@xxxxxxxxxx>
Reviewed-by: Alexander Potapenko <glider@xxxxxxxxxx>