-
-
Notifications
You must be signed in to change notification settings - Fork 394
Use shmem for forkserver several pointers #3249
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5759044
Add android CI
wtdcode 9bf7b06
update
wtdcode a3753aa
Move together
wtdcode f50a366
Use shmem for forkserver several pointers
Evian-Zhang 88c550f
Fix clippy
Evian-Zhang f04e845
Fix
Evian-Zhang f99113b
Merge remote-tracking branch 'github/android-ndk-ci' into shmem-forks…
Evian-Zhang e4be1fc
Merge branch 'main' into shmem-forkserver
tokatoka 1a3fe98
Make shmem's into_raw private
Evian-Zhang cf1ceb5
Log error message in forkserver
Evian-Zhang 259730f
Fix clippy
Evian-Zhang 6923664
Fix clippy
Evian-Zhang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,31 @@ | ||
use libafl_bolts::shmem::{ShMemProvider, StdShMemProvider}; | ||
use libafl_targets::{ | ||
map_input_shared_memory, map_shared_memory, start_forkserver, MaybePersistentForkserverParent, | ||
}; | ||
|
||
#[no_mangle] | ||
pub extern "C" fn libafl_start_forkserver() { | ||
let mut shm_provider = match StdShMemProvider::new() { | ||
Ok(shm_provider) => shm_provider, | ||
Err(err) => { | ||
eprintln!("Forkserver failed to create shared memory provider: {err}"); | ||
std::process::exit(1); | ||
} | ||
}; | ||
|
||
// Map shared memory region for the edge coverage map | ||
if map_shared_memory().is_err() { | ||
if let Err(err) = map_shared_memory(&mut shm_provider) { | ||
eprintln!("Forkserver failed to create edge map: {err}"); | ||
std::process::exit(1); | ||
} | ||
// Map shared memory region for input and its len | ||
if map_input_shared_memory().is_err() { | ||
if let Err(err) = map_input_shared_memory(&mut shm_provider) { | ||
eprintln!("Forkserver failed to create input map: {err}"); | ||
std::process::exit(1); | ||
}; | ||
} | ||
// Start the forkserver | ||
if start_forkserver(&mut MaybePersistentForkserverParent::new()).is_err() { | ||
if let Err(err) = start_forkserver(&mut MaybePersistentForkserverParent::new()) { | ||
eprintln!("Forkserver unexpected error: {err}"); | ||
std::process::exit(1); | ||
}; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,31 @@ | ||
use libafl_bolts::shmem::{ShMemProvider, StdShMemProvider}; | ||
use libafl_targets::{ | ||
map_input_shared_memory, map_shared_memory, start_forkserver, MaybePersistentForkserverParent, | ||
}; | ||
|
||
#[no_mangle] | ||
pub extern "C" fn libafl_start_forkserver() { | ||
let mut shm_provider = match StdShMemProvider::new() { | ||
Ok(shm_provider) => shm_provider, | ||
Err(err) => { | ||
eprintln!("Forkserver failed to create shared memory provider: {err}"); | ||
std::process::exit(1); | ||
} | ||
}; | ||
|
||
// Map shared memory region for the edge coverage map | ||
if map_shared_memory().is_err() { | ||
if let Err(err) = map_shared_memory(&mut shm_provider) { | ||
eprintln!("Forkserver failed to create edge map: {err}"); | ||
std::process::exit(1); | ||
} | ||
// Map shared memory region for input and its len | ||
if map_input_shared_memory().is_err() { | ||
if let Err(err) = map_input_shared_memory(&mut shm_provider) { | ||
eprintln!("Forkserver failed to create input map: {err}"); | ||
std::process::exit(1); | ||
}; | ||
} | ||
// Start the forkserver | ||
if start_forkserver(&mut MaybePersistentForkserverParent::new()).is_err() { | ||
if let Err(err) = start_forkserver(&mut MaybePersistentForkserverParent::new()) { | ||
eprintln!("Forkserver unexpected error: {err}"); | ||
std::process::exit(1); | ||
}; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add this to a justfile? We want to have every CI task in a justfile in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I don't really know about the detail. @wtdcode Can you do this in your branch? I could merge such changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@domenukk It is not a new fuzzer or test but just doing cross-building. I don't see a directory to place such justfiles.
./just
seems common library scripts.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a repo-wide justfile, we'll need it at some point anyway #3099
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But yes can be done later