-
Notifications
You must be signed in to change notification settings - Fork 57
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
Read error when apply QEMU patch #51
Comments
I notice that qemu-system-x86_64 is built with PIE enabled. I disabled PIE, patch is successful. |
It works when PIE enabled. when c++ is installed. qemu uses c++ as linker. this lead to libcare-cc wrapper can't add -Wl,-q flags to linker. Relocations of the patch is dropped after linking. Removing c++ and then it works. |
Hi @yaozhenguo, Are there any modifications should be made to qemu makefile? |
@loyfan Thanks a lot I found that the commit 9edc19c(make: switch from -I to -iquote) of the qemu changed the compile options |
I made QEMU patch by libcare-patch-make successfully. But After apply patch for QEMU, following error logs are reported
Copying 0x5 bytes from 0x4ceda0 to 0x555555db2240 in target... FAIL
kpatch_patch.c(495): Patching qemu-system-x86_64 failed, unapplying partially applied patch
Verifying safety for pid 32695...
I have checked kpatch_process_mem_read return is 5(I/O error) and patch info->daddr is 0x4ceda0. But qemu-system-x86_64 text section is as below
Object 'qemu-system-x86_64' (806:643262840), patch: yes
VM areas:
inmem: 555555554000-555555d5461c r-e, ondisk: 00000000-0080061c r-e
inmem: 555555f54d80-55555610c000 r--, ondisk: 00800d80-009b8000 r--
inmem: 55555610c000-5555565b4300 rw-, ondisk: 009b8000-00a16b28 rw-
0x4ceda0 (info->daddr) is invalid in qemu‘s process,Does it need add some offset to info->daddr when reading it? Or, is there something wrong when making patch but logs are not reported?
The text was updated successfully, but these errors were encountered: