Closed Zon8Research closed 3 years ago
Thanks, yes, that sounds good to me! Maybe open a PR with that code for any further discussions?
This helps reduce a larger issue, and that is that the test cases generated by fuzzilli have an over proportionate amount of empty functions, loops and if statements
Maybe it would make sense to open a separate issue for this, unless it's covered in https://github.com/googleprojectzero/fuzzilli/issues/236
Closing since this is implemented in https://github.com/googleprojectzero/fuzzilli/pull/255 and https://github.com/googleprojectzero/fuzzilli/issues/264 now covers the empty blocks issue
Proposal for improvements to
generateInternal
.So currently code generation works like this (from what I can see):
I propose we take the following approach:
The reasons for doing this are as follows:
Example code for this change would be to replace https://github.com/googleprojectzero/fuzzilli/blob/10d5db4700b2d02481b916302269025cee9a1f69/Sources/Fuzzilli/Core/ProgramBuilder.swift#L832 with as follows:
One argument against this might be potential performance impact of finding all codegens that are suitable.
I've timed the generateInternal function with the new changes and this is the speed in debug mode:
Compared to the original speed which was:
However, you could also argue that this performance impact is inconsequential compared to how long is spent executing the payload. Also, this isn't even factoring in the time wasted currently by attempting to generate a codegen, but then returning with nothing. So you may actually end up saving time by having less wasted cycles.
Looking forward to hearing your thoughts.