LibAFL icon indicating copy to clipboard operation
LibAFL copied to clipboard

Make executor state available to the harness V2

Open rmalmain opened this issue 1 year ago • 6 comments

Alternative to #1847, without changing Executor.

rmalmain avatar Mar 01 '24 00:03 rmalmain

With this implementation, GenericInProcessExecutor stores (in addition to its internal state) the state of the parent structure (like QemuExecutor inner state). It's quite unnatural, but it works out well. Is it a reasonable thing to do?

rmalmain avatar Mar 01 '24 00:03 rmalmain

GenericInProcessExecutor stores (in addition to its internal state) the state of the parent structure (like QemuExecutor inner state).

which part does this? i only see QemuExecutorWithState calling executor_state

tokatoka avatar Mar 01 '24 10:03 tokatoka

GenericInProcessExecutor stores (in addition to its internal state) the state of the parent structure (like QemuExecutor inner state).

which part does this? i only see QemuExecutorWithState calling executor_state

GenericInProcessExecutorWithState does, sorry I didn't make it clear. It's basically GenericInProcessExecutor, with the state of the parent structure (here QemuExecutorWithState) embedded inside.

rmalmain avatar Mar 01 '24 17:03 rmalmain

It's basically GenericInProcessExecutor, with the state of the parent structure (here QemuExecutorWithState) embedded inside.

Ok. Will it feel less odd if you rename QemuExecutorState to QemuInternalState?

tokatoka avatar Mar 01 '24 17:03 tokatoka

It's basically GenericInProcessExecutor, with the state of the parent structure (here QemuExecutorWithState) embedded inside.

Ok. Will it feel less odd if you rename QemuExecutorState to QemuInternalState?

Not sure, since it suggests it represents the state of QEMU itself, which is not the case

rmalmain avatar Mar 01 '24 18:03 rmalmain

But your QemuExecutorState has just first_exec as its only owned member. but whether the execution is first or not is not qemu-specific state right?

How about naming it to BasicExecutorState

tokatoka avatar Mar 01 '24 18:03 tokatoka

I applied the renaming propositions. Is there any other remark for this PR?

rmalmain avatar Mar 05 '24 00:03 rmalmain