You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the code below, uhyve gets stuck somewhere inside the call_target() function's println! call, but with qemu the code runs as expected.
This issue was observed during the testing for hermit-os/kernel#339 .
#![feature(asm)]#[cfg(target_os = "hermit")]externcrate hermit_sys;// This works in qemu but gets stuck with uhyve somewhere inside the target function's print callfnmain(){println!("Main at {:p}", main as *const());println!("Call unmodified some_func()");some_func();println!("Returned from unmodified some_func()");println!("Call modified some_func()");unsafe{// overwrite original function consitsing of a single ret instruction with: call rbx; ret; int3;*(some_func as*muti64) = 0xccc3d3ff;// move address of target function to rbxasm!("mov rbx, {0}", in(reg) call_target as *const());// call modified functionsome_func()}println!("Returned from modified some_func()");}#[inline(never)]fnsome_func(){return}#[inline(never)]fncall_target(){println!("Called target!");}
The text was updated successfully, but these errors were encountered:
When running the code below, uhyve gets stuck somewhere inside the
call_target()
function'sprintln!
call, but with qemu the code runs as expected.This issue was observed during the testing for hermit-os/kernel#339 .
The text was updated successfully, but these errors were encountered: