Skip to content
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

KVM_SET_XCRS failed: Invalid argument #18

Closed
xupeng1231 opened this issue Aug 15, 2021 · 5 comments
Closed

KVM_SET_XCRS failed: Invalid argument #18

xupeng1231 opened this issue Aug 15, 2021 · 5 comments

Comments

@xupeng1231
Copy link

xupeng1231 commented Aug 15, 2021

Hello, I try to use the hevd example according to the instruction, however when I runing the fuzzing node with the kvm backend, the KVM_SET_XCRS failed with Invalid argument error.
I use the kvm version 12, and I carry out the expriment in Ubuntu 20.04. Do you know the reason about this failure.

@0vercl0k
Copy link
Owner

Can you share your regs.json?

I've seen this before it means that the VM where I took the dump had bits in xcr0 that are not supported in the environment you're loading it in; based on my experience it's usually the bits that enable AVX512 or some of those.

Cheers

@xupeng1231
Copy link
Author

xupeng1231 commented Aug 15, 2021

the regs.json is as follow, I used the regs.json that come from you hevd example, the value of xcr0 is 0xe7. Do you know how to solve the problem, and is there any material that explain about this area? {"rax":"0xdfd98ff3d0","rbx":"0x88","rcx":"0x88","rdx":"0xdeadbeef","rsi":"0x0","rdi":"0x0","rip":"0x7ff6f5bb111e","rsp":"0xdfd98ff380","rbp":"0x0","r8":"0xdfd98ff3d0","r9":"0x400","r10":"0x2263e823055","r11":"0x7ff6f5bcb54d","r12":"0x0","r13":"0x0","r14":"0x0","r15":"0x0","rflags":"0x206","dr0":"0x0","dr1":"0x0","dr2":"0x0","dr3":"0x0","dr6":"0xffff4ff0","dr7":"0x400","es":{"present":true,"selector":"0x2b","base":"0x0","limit":"0xffffffff","attr":"0xcf3"},"cs":{"present":true,"selector":"0x33","base":"0x0","limit":"0x0","attr":"0x22fb"},"ss":{"present":true,"selector":"0x2b","base":"0x0","limit":"0xffffffff","attr":"0xcf3"},"ds":{"present":true,"selector":"0x2b","base":"0x0","limit":"0xffffffff","attr":"0xcf3"},"fs":{"present":true,"selector":"0x53","base":"0x0","limit":"0x3c00","attr":"0x4f3"},"gs":{"present":true,"selector":"0x2b","base":"0xdfd9621000","limit":"0xffffffff","attr":"0xcf3"},"tr":{"present":true,"selector":"0x40","base":"0xfffff8047375c000","limit":"0x67","attr":"0x8b"},"ldtr":{"present":false,"selector":"0x0","base":"0x0","limit":"0x0","attr":"0x0"},"tsc":"0x2531558129a","apic_base":"0xfee00900","sysenter_cs":"0x0","sysenter_esp":"0x0","sysenter_eip":"0x0","pat":"0x7010600070106","efer":"0xd01","star":"0x23001000000000","lstar":"0xfffff8046f1cdc40","cstar":"0xfffff8046f1cd780","sfmask":"0x4700","kernel_gs_base":"0xfffff8046b6f3000","tsc_aux":"0x0","fpcw":"0x27f","fpsw":"0x0","fptw":"0x0","fpst":["0x-Infinity","0x-Infinity","0x-Infinity","0x-Infinity","0x-Infinity","0x-Infinity","0x-Infinity","0x-Infinity"],"mxcsr":"0x1f80","cr0":"0x80050033","cr2":"0x7ff6f5bbed4c","cr3":"0x101ba2000","cr4":"0x3506f8","cr8":"0x0","xcr0":"0xe7","gdtr":{"base":"0xfffff8047375dfb0","limit":"0x57"},"idtr":{"base":"0xfffff8047375b000","limit":"0xfff"},"mxcsr_mask":"0x0","fpop":"0x0"}

@0vercl0k
Copy link
Owner

Oh sorry I missed the fact you were using the file from the hevd example 🤦🏽‍♂️

Can you try to change the value of xcr0 from 0xe7 to 0x7 and try it again please?

Cheers

@xupeng1231
Copy link
Author

Thank you very much. After changing the value of xcr0 from 0xe7 to 0x7, it works well.
Furthermore, your this work(wtf) is really cool and efficient. I will study it systematically. I didn't know much about kvm and virtualization, can you recommend some learning materials related to your system.

@0vercl0k
Copy link
Owner

Awesome!

Thanks for the kind words 🙏🏽 The best references for me were:

Cheers

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

No branches or pull requests

2 participants