nitro
nitro copied to clipboard
vmwrite error when trying to set CPU registers in a callback
As the new syscall_parameters branch allows a read/write access to the syscall's arguments, i tried to read every arguments and write them back while in a callback.
It works fine for memory arguments.
However, for register arguments, at some point, the VM goes BSOD and dmesg looks like this
[17952.582712] vmwrite error: reg 6820 value 46 (err 70)
[17952.582717] CPU: 1 PID: 25724 Comm: nose2-3.4 Tainted: G E 4.9.0-0.bpo.2-amd64 #1 Debian 4.9.18-1~bpo8+1.2
[17952.582717] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/02/2015
[17952.582719] 0000000000000000 ffffffff8c329dd5 ffff8b2c8c9d88c0 ffff8b2c8c9d88c0
[17952.582721] ffffffffc0749540 ffffffffb33b8540 ffffffffc0731cd0 ffff8b2cf0e58700
[17952.582724] ffff8b2cea86f140 00000000d958817f ffff8b2cd669a000 ffffa726c29c7f20
[17952.582726] Call Trace:
[17952.582730] [<ffffffff8c329dd5>] ? dump_stack+0x5c/0x77
[17952.582749] [<ffffffffc0749540>] ? kvm_arch_vcpu_ioctl_set_regs+0x1f0/0x210 [kvm]
[17952.582763] [<ffffffffc0731cd0>] ? kvm_vcpu_ioctl+0x140/0x7c0 [kvm]
[17952.582765] [<ffffffff8c2175cb>] ? do_vfs_ioctl+0x9b/0x600
[17952.582767] [<ffffffff8c2035b3>] ? vfs_write+0x163/0x1a0
[17952.582769] [<ffffffff8c217ba6>] ? SyS_ioctl+0x76/0x90
[17952.582772] [<ffffffff8c5fc5bb>] ? system_call_fast_compare_end+0xc/0x9b