Asan guest fix (#2986)
* Check for initialization of libgasan.so on first_exec --------- Co-authored-by: Your Name <you@example.com>
This commit is contained in:
parent
91c46d1a33
commit
f5a01ee20d
@ -84,6 +84,12 @@ static void __libqasan_map_shadow(void *addr, void *limit) {
|
||||
addr, limit + 1, errno);
|
||||
abort();
|
||||
}
|
||||
|
||||
if (madvise(addr, size, MADV_DONTDUMP) != 0) {
|
||||
QASAN_LOG("Failed to madvise (MADV_DONTDUMP) shadow: %p-%p, errno: %d",
|
||||
addr, limit + 1, errno);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -269,9 +269,21 @@ where
|
||||
self.asan_lib = Some(asan_lib);
|
||||
}
|
||||
|
||||
fn post_qemu_init<ET>(&mut self, qemu: Qemu, _emulator_modules: &mut EmulatorModules<ET, I, S>)
|
||||
fn post_qemu_init<ET>(&mut self, _qemu: Qemu, _emulator_modules: &mut EmulatorModules<ET, I, S>)
|
||||
where
|
||||
ET: EmulatorModuleTuple<I, S>,
|
||||
{
|
||||
}
|
||||
|
||||
fn first_exec<ET>(
|
||||
&mut self,
|
||||
qemu: Qemu,
|
||||
emulator_modules: &mut EmulatorModules<ET, I, S>,
|
||||
_state: &mut S,
|
||||
) where
|
||||
ET: EmulatorModuleTuple<I, S>,
|
||||
I: Unpin,
|
||||
S: Unpin,
|
||||
{
|
||||
for mapping in qemu.mappings() {
|
||||
println!("mapping: {mapping:#?}");
|
||||
@ -305,18 +317,7 @@ where
|
||||
for mapping in &mappings {
|
||||
println!("asan mapping: {mapping:#?}");
|
||||
}
|
||||
}
|
||||
|
||||
fn first_exec<ET>(
|
||||
&mut self,
|
||||
_qemu: Qemu,
|
||||
emulator_modules: &mut EmulatorModules<ET, I, S>,
|
||||
_state: &mut S,
|
||||
) where
|
||||
ET: EmulatorModuleTuple<I, S>,
|
||||
I: Unpin,
|
||||
S: Unpin,
|
||||
{
|
||||
emulator_modules.reads(
|
||||
Hook::Function(gen_readwrite_guest_asan::<ET, F, I, S>),
|
||||
Hook::Function(guest_trace_error_asan::<ET, I, S>),
|
||||
|
Loading…
x
Reference in New Issue
Block a user