Skip to content

make check-tcg triggers CFI checks in plugins/core.c

If you build QEMU with the CFI (control flow integrity) checks enabled, e.g.

 '../../configure' '--target-list=x86_64-softmmu,i386-softmmu,x86_64-linux-user,i386-linux-user' '--enable-debug' '--enable-cfi' '--enable-cfi-debug' '--cc=clang'

and then build it and run 'make check-tcg', you get errors like this:

timeout -s KILL --foreground 120  /home/petmay01/linaro/qemu-from-laptop/qemu/build/x86-tgts/qemu-system-x86_64 -monitor none -display none -chardev file,path=run-plugin-interrupt-with-libinline.so.out,id=output -plugin ../plugins/libinline.so -d plugin -D interrupt-with-libinline.so.pout -device isa-debugcon,chardev=output -device isa-debug-exit,iobase=0xf4,iosize=0x4 -kernel interrupt
../../plugins/core.c:639:17: runtime error: control flow integrity check for type 'void (unsigned int, unsigned int, unsigned long, void *)' failed during indirect function call
/data_nvme1n1/linaro/qemu-from-laptop/qemu/build/x86-tgts/../../tests/tcg/plugins/inline.c:218: note: vcpu_mem_access defined here
../../plugins/core.c:639:17: note: check failed in /data_nvme1n1/linaro/qemu-from-laptop/qemu/build/x86-tgts/qemu-system-x86_64, destination function located in ../plugins/libinline.so
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../plugins/core.c:639:17 

I'm not sure why this happens (the types don't look obviously mismatched), but we should investigate and fix it. It could be something silly like "when we build with CFI we don't also build the plugins with CFI and we don't do anything to avoid the CFI checks on these outbound calls".

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information