Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To support AFL instrumentation, add default settings of map_size in forkserver. #2173

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

ahuo1
Copy link
Contributor

@ahuo1 ahuo1 commented Jul 28, 2024

Hello, when aflpp uses a binary instrumented by AFL, the binary's returned status variable is 0.

Therefore, the bitmap size for aflpp is the default 8 /* 1024 /* 1024, which severely affects the running speed.

For compatibility, I have added a default bitmap size setting in forkserver.( ◠‿◠ )

ps: I noticed that it can be resolved by setting AFL_SKIP_BIN_CHECK. However, after setting AFL_SKIP_BIN_CHECK, aflpp will no longer check persistent mode. Therefore, I think this setting is more reasonable.

@ahuo1 ahuo1 changed the base branch from stable to dev July 28, 2024 09:16
@vanhauser-thc
Copy link
Member

wouldn't it be easier to just check if map_size is 0 and then set the MAP_SIZE value if so?

@vanhauser-thc
Copy link
Member

ping @ahuo1

@ahuo1
Copy link
Contributor Author

ahuo1 commented Aug 5, 2024

Oh, I'm very sorry.
Would it be possible to add a check after the afl_fsrv_get_mapsize function, and if it equals DEFAULT_SHMEM_SIZE, then change the value of afl->fsrv.map_size to MAP_SIZE?

u32 new_map_size = afl_fsrv_get_mapsize(

@ahuo1
Copy link
Contributor Author

ahuo1 commented Aug 5, 2024

Oh, I overlooked cmplog. I think it would be more convenient to add a check within the afl_fsrv_get_mapsize function.

return fsrv->map_size;

@vanhauser-thc
Copy link
Member

Oh, I overlooked cmplog. I think it would be more convenient to add a check within the afl_fsrv_get_mapsize function.

return fsrv->map_size;

Just push the change and then I can review it :)

@ahuo1
Copy link
Contributor Author

ahuo1 commented Aug 6, 2024

Oh, I overlooked cmplog. I think it would be more convenient to add a check within the afl_fsrv_get_mapsize function.

return fsrv->map_size;

Just push the change and then I can review it :)

Alright!

@vanhauser-thc
Copy link
Member

one thing so. what happens if the map size would be exactly DEFAULT_SHMEM_SIZE by chance?

@ahuo1
Copy link
Contributor Author

ahuo1 commented Aug 6, 2024

Uh, yeah. To deal with it, I think the first commit is more reasonable...

@vanhauser-thc
Copy link
Member

thank you

@vanhauser-thc vanhauser-thc merged commit e3b08d4 into AFLplusplus:dev Aug 8, 2024
17 checks passed
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