libafl_bolts fix potentially unaligned ucontexts in signal handler (#1520)
When entering a signal handler, the ucontext_t is not necessarily 0x10-aligned, so we need to use read_unaligned instead of dereferencing.
This commit is contained in:
parent
6d0d4e287a
commit
27333f9ce8
@ -390,7 +390,11 @@ unsafe fn handle_signal(sig: c_int, info: siginfo_t, void: *mut c_void) {
|
|||||||
None => return,
|
None => return,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
handler.handle(*signal, info, &mut *(void as *mut ucontext_t));
|
handler.handle(
|
||||||
|
*signal,
|
||||||
|
info,
|
||||||
|
&mut ptr::read_unaligned(void as *mut ucontext_t),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Setup signal handlers in a somewhat rusty way.
|
/// Setup signal handlers in a somewhat rusty way.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user