-
-
Notifications
You must be signed in to change notification settings - Fork 334
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
More Nyx hypercalls supported in libafl qemu. add tests for filters. #2825
Conversation
fixed some hypercalls behavior. filters fixes.
added generic read / write to qemu memory
libafl_qemu/src/qemu/mod.rs
Outdated
// let mut val_buf: [u8; size_of::<T>()] = [0; size_of::<T>()]; | ||
|
||
let mut val_buf: Vec<u8> = Vec::with_capacity(size_of::<T>()); | ||
unsafe { |
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.
For unsafe blocks (at least if possible), it'd be good if we started adding safety comments like
// # Safety
// The vector's capacity is f the same size. The vector will be filled in `read_mem` below.
This will make it easier to spot bugs later and is good practice in general.
* port example to also have nyx api * make nyx api structs volatile to avoid optimization issues * better filtering for the x509 parser
removed unused unsafe keywork
@@ -1259,6 +1259,8 @@ where | |||
impl<ET, S> Drop for EmulatorModules<ET, S> { | |||
fn drop(&mut self) { | |||
// Make the global pointer null at drop time | |||
// # Safety | |||
// There can only be one EmulatorModules. |
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.
This is racey / not guarded by locks or mutexes though, right? So not really safe..
(new should probably be marked unsafe
in this case)
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.
EmulatorModules
is not public (only pub(super)
), so there should not be race conditions there.
it is only called by Emulator::new
, which can only be called once.
i can mark it as unsafe to make it clear
@@ -103,21 +103,15 @@ where | |||
|
|||
/// High-level `Emulator` modules, using `QemuHooks`. | |||
#[derive(Debug)] | |||
pub struct EmulatorModules<ET, S> | |||
where |
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.
nice! please continue removing this!
if you merged the latest main then nothing will needs UsesInput except for EventManager
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.
ok, i'll remove the remaining part in next patch
* also make linux kernel harness more clear.
…FLplusplus#2825) * more nyx hypercalls implemented, among them: - panic hypercall - range filtering hypercall * fixed some nyx hypercalls behavior. * added generic read / write to qemu memory * port linux kernel example to also have nyx API, add better filtering as well. * make nyx api structs volatile to avoid optimization issues * Introduce a method create a Vec in place, using a closure. * use new vec_init function in relevant places. * removed unused unsafe keywork * add more allocated memory r/w callbacks * add more safety notes * move emulator hooks to separate struct * update QEMU version
No description provided.