Skip to content

scripts/fuzz: add a --plugins option to focus device fuzzing - #4354

Open
brgoing wants to merge 1 commit into
linux-nvme:masterfrom
Micron-TPG-OSS:bgoing/fuzz-device-plugins
Open

brgoing wants to merge 1 commit into
linux-nvme:masterfrom
Micron-TPG-OSS:bgoing/fuzz-device-plugins

Conversation

@brgoing

@brgoing brgoing commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

A device target run spreads its time across every command in the table, so it takes a long time to reach deep coverage of any one plugin.

Add a --plugins option to nvme-fuzz run that limits the device target to the commands of the named plugins or built-in commands, e.g. --plugins ocp,micron. With --plugins and no --targets, run only the device target; reject --plugins when --targets ommits device.

Make the device target read the selection from FUZZ_PLUGINS and reject inputs of other commands, so libFuzzer keeps them out of the corpus. Exit with an error on a name that matches no command, or on a list that names none.

Run the selected commands on a copy of their inputs from the corpus, since a merge with FUZZ_PLUGINS set would drop every other command's inputs. Seed the copy with one input per selected command that has no device data, for each PCI ID its plugin checks, and add what the run finds back to the corpus when it ends. Drop an exported FUZZ_PLUGINS from the environment of the fuzz jobs, merges and replays, so that only --plugins sets it.

Add a matching --fuzz-plugins option to scripts/build.sh, and document the option in TESTING.md.

Changes were suggested in #4305

@brgoing
brgoing force-pushed the bgoing/fuzz-device-plugins branch from 766add2 to 1b695d7 Compare October 30, 2026 19:52
@brgoing brgoing changed the title scripts/fuzz: add a --plugins option to restrict device fuzzing scripts/fuzz: add a --plugins option to focus device fuzzing Oct 30, 2026
@brgoing
brgoing force-pushed the bgoing/fuzz-device-plugins branch from 1b695d7 to 69d0d89 Compare October 30, 2026 19:54
A device target run spreads its time across every command in the
table, so it takes a long time to reach deep coverage of any one
plugin.

Add a --plugins option to nvme-fuzz run that limits the device target
to the commands of the named plugins or built-in commands, e.g.
--plugins ocp,micron. With --plugins and no --targets, run only the
device target; reject --plugins when --targets ommits device.

Make the device target read the selection from FUZZ_PLUGINS and reject
inputs of other commands, so libFuzzer keeps them out of the corpus.
Exit with an error on a name that matches no command, or on a list
that names none.

Run the selected commands on a copy of their inputs from the corpus,
since a merge with FUZZ_PLUGINS set would drop every other command's
inputs. Seed the copy with one input per selected command that has no
device data, for each PCI ID its plugin checks, and add what the run
finds back to the corpus when it ends. Drop an exported FUZZ_PLUGINS
from the environment of the fuzz jobs, merges and replays, so that
only --plugins sets it.

Add a matching --fuzz-plugins option to scripts/build.sh, and document
the option in TESTING.md.

Signed-off-by: Broc Going <bgoing@micron.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant