smitebot: avoid afl-cmin filename overflow on direct corpus minimize - #190
Conversation
54490b2 to
fb3af5f
Compare
morehouse
left a comment
There was a problem hiding this comment.
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.
| /// 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 |
There was a problem hiding this comment.
Is this true? I don't recall seeing such name formats; I thought it just preserved the existing filenames.
There was a problem hiding this comment.
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.
NishantBansal2003
left a comment
There was a problem hiding this comment.
Verified with a campaign: it was giving OSError: [Errno 36] File name too long: before this change, and the issue is fixed after this change.
b204b33 to
bce3141
Compare
bce3141 to
b466554
Compare
Follow-up to the corpus command #184 .
The default path now stages the campaign's queues through the same content-dedup as
mergeinto a short-named temp corpus, runs afl-cmin on that, and removes it afterward. A supplied--inputstays passthrough.