Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Using VMFunc #8

Open
ashishbijlani opened this issue May 29, 2020 · 9 comments
Open

Using VMFunc #8

ashishbijlani opened this issue May 29, 2020 · 9 comments

Comments

@ashishbijlani
Copy link

Hi,

I'm trying to use VMFunc (switch view functionality) in iKGT. To test, I simply switch to the same EPT. (mov rax, 0; mov rcx, 0; vmfunc). However, this results in kernel panic. I'd deeply appreciate your insights on enabling VMFunc functionality. Thanks!

-Ashish

@bingzhux
Copy link

we don't use and test VMFUNC now in this open source project. so not sure what's your exact problem here.... do you want to do something related to security protection on Linux guest?

@ashishbijlani
Copy link
Author

Yes, I'm using iKGT as a reference monitor to protect data confidentiality and integrity. Specifically, using EPT/VMFunc to switch memory views. My machine does have a serial port, is there anyway I could use an emulator (e.g., QEMU) to test and enable VMFunc functionality. Thanks!

@bingzhux
Copy link

bingzhux commented Jun 1, 2020

ok, pretty make sense. our ikgt team ever invented VMFUNC exactly for this purpose around 8 years ago..... but you may need some changes to make it work and probably you may consider using #VE as well.

does Qemu support emulate VMFUNC? i'm not sure.

you can also use vmware player to run ikgt, i ever tried that before (some yrs ago, but not recently). vmware support nested VT, but again i'm not sure if VMWare emulates VMFUNC.

@rsahita
Copy link

rsahita commented Jun 1, 2020 via email

@ashishbijlani
Copy link
Author

"mov rax, 0; mov rcx, 0; vmfunc" results is illegal instruction.

@rsahita
Copy link

rsahita commented Jun 1, 2020 via email

@ashishbijlani
Copy link
Author

I assumed it was. Will check that and update here. Thanks!

@bingzhux
Copy link

bingzhux commented Jun 1, 2020

Thanks @rsahita for pointing out that..

@ashishbijlani, i believe ikgt by default doesn't enable that. if your hardware or virtual hardware platform supports VMFUNC, #UD should be triggered when hypervisor doesn't enable it in vmcs. (more info for IA exceptions should be checked in IA SDM manual doc)

@ashishbijlani
Copy link
Author

Does iKGT auto-detect hardware support for VMFUNC in fvs_is_eptp_switching_supported() and call fvs_guest_vmfunc_enable() to enable VMFunc or it has to be enabled explicitly? If the latter, I'd appreciate any pointers in the code to do so. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants