Skip to content

smitebot: avoid afl-cmin filename overflow on direct corpus minimize - #190

Open
Ashish-Kumar-Dash wants to merge 2 commits into
lnfuzz:masterfrom
Ashish-Kumar-Dash:corpus-minimize-longnames
Open

smitebot: avoid afl-cmin filename overflow on direct corpus minimize#190
Ashish-Kumar-Dash wants to merge 2 commits into
lnfuzz:masterfrom
Ashish-Kumar-Dash:corpus-minimize-longnames

Conversation

@Ashish-Kumar-Dash

Copy link
Copy Markdown
Contributor

Follow-up to the corpus command #184 .

The default path now stages the campaign's queues through the same content-dedup as merge into a short-named temp corpus, runs afl-cmin on that, and removes it afterward. A supplied --input stays passthrough.

@Ashish-Kumar-Dash
Ashish-Kumar-Dash force-pushed the corpus-minimize-longnames branch from b2591f4 to e05db7a Compare August 6, 2026 19:43
afl-cmin -X copies each input to `<8hex>_<basename>`; smite-ir queue
filenames embed the full mutation stack and already approach NAME_MAX
(255), so the prefix overflows (ENAMETOOLONG) on a direct minimize of raw
runner queues. Stage the queues through the existing merge dedup into a
short-named temp corpus first, then run afl-cmin on that and clean it up.
A user-supplied --input is passed through unchanged.
@Ashish-Kumar-Dash
Ashish-Kumar-Dash force-pushed the corpus-minimize-longnames branch from 54490b2 to fb3af5f Compare August 7, 2026 04:43

@morehouse morehouse left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we probably want to always do the merge step first, not just in the default-no-input case. A manually-specified a queue dir as input is going to have the same long-pathname issue. This probably also means we need the ability to specify multiple --input flags.

Comment thread smitebot/src/commands/corpus.rs Outdated
/// Stages a campaign's runner queues into `stage_dir` with short, sequential
/// filenames, returning the directory to hand to `afl-cmin -i`.
///
/// afl-cmin -X hardlinks each input to `<8hex>_<basename>` (batch mode); smite-ir

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this true? I don't recall seeing such name formats; I thought it just preserved the existing filenames.

@Ashish-Kumar-Dash Ashish-Kumar-Dash Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That is afl-cmin's own temp staging, in its batched processing it hardlinks each input into .filelist..d/ as rand_bit function, which is exactly the path from the error you posted. That's where the length overflows.

Comment thread smitebot/src/commands/corpus.rs Outdated
Comment thread smitebot/src/commands/corpus.rs Outdated
Comment thread smitebot/src/commands/corpus.rs Outdated
Comment thread smitebot/README.md Outdated
Comment thread smitebot/src/commands/corpus.rs Outdated
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.

2 participants