LibAFL icon indicating copy to clipboard operation
LibAFL copied to clipboard

`staterestore` saves to `temp_dir`, instead of local dir, and never cleans up

Open s1341 opened this issue 4 years ago • 4 comments

The staterestore feature currently writes the serialized state out to a <hash>.libafl_state file in the temp_dir.

There are two issues with this:

  1. The files are never cleaned up, resulting in fuzzers dying at a later stage when the temp_dir is full.
  2. We store all other files in the local-directory, or in user-specified locations. Shouldn't we maintain this practice?

Ideally, the files should be written to the local dir, and cleaned up after they are read.

s1341 avatar Sep 13 '21 11:09 s1341

Wait... we do clean it up? https://github.com/AFLplusplus/LibAFL/blob/bb21ab7a63d8d5a2a7f99c6a6c39e4d2e87fb42b/libafl/src/bolts/staterestore.rs#L175

domenukk avatar Sep 13 '21 12:09 domenukk

I have tons of files in my tempdir.... something is fishy...

s1341 avatar Sep 13 '21 13:09 s1341

Maybe leftovers from earlier runs? They won't get cleared on exit with a simple ctrl+c (hence, they are in a tmp dir)

domenukk avatar Sep 13 '21 14:09 domenukk

Huh... why are they not cleared after read?

s1341 avatar Sep 13 '21 14:09 s1341

Closing this for now.

domenukk avatar Jan 26 '23 01:01 domenukk