qemu-e2k/accel/tcg
Daniele Buono c905a3680d cfi: Initial support for cfi-icall in QEMU
LLVM/Clang, supports runtime checks for forward-edge Control-Flow
Integrity (CFI).

CFI on indirect function calls (cfi-icall) ensures that, in indirect
function calls, the function called is of the right signature for the
pointer type defined at compile time.

For this check to work, the code must always respect the function
signature when using function pointer, the function must be defined
at compile time, and be compiled with link-time optimization.

This rules out, for example, shared libraries that are dynamically loaded
(given that functions are not known at compile time), and code that is
dynamically generated at run-time.

This patch:

1) Introduces the CONFIG_CFI flag to support cfi in QEMU

2) Introduces a decorator to allow the definition of "sensitive"
functions, where a non-instrumented function may be called at runtime
through a pointer. The decorator will take care of disabling cfi-icall
checks on such functions, when cfi is enabled.

3) Marks functions currently in QEMU that exhibit such behavior,
in particular:
- The function in TCG that calls pre-compiled TBs
- The function in TCI that interprets instructions
- Functions in the plugin infrastructures that jump to callbacks
- Functions in util that directly call a signal handler

Signed-off-by: Daniele Buono <dbuono@linux.vnet.ibm.com>
Acked-by: Alex Bennée <alex.bennee@linaro.org
Message-Id: <20201204230615.2392-3-dbuono@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-01-02 21:03:35 +01:00
..
atomic_common.c.inc meson: rename included C source files to .c.inc 2020-08-21 06:18:30 -04:00
atomic_template.h qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
cpu-exec-common.c qemu-common: Move tcg_enabled() etc. to sysemu/tcg.h 2019-06-11 20:22:09 +02:00
cpu-exec.c cfi: Initial support for cfi-icall in QEMU 2021-01-02 21:03:35 +01:00
cputlb.c accel/tcg: Add tlb_flush_page_bits_by_mmuidx* 2020-10-20 16:12:00 +01:00
meson.build accel/tcg: split CpusAccel into three TCG variants 2020-12-10 17:44:10 -06:00
plugin-gen.c plugin-gen: add module for TCG-related code 2019-10-28 15:12:38 +00:00
plugin-helpers.h plugin-gen: add module for TCG-related code 2019-10-28 15:12:38 +00:00
tcg-all.c accel/tcg: split tcg_start_vcpu_thread 2020-12-10 17:44:10 -06:00
tcg-cpus-icount.c accel/tcg: rename tcg-cpus functions to match module name 2020-12-10 17:44:10 -06:00
tcg-cpus-icount.h accel/tcg: rename tcg-cpus functions to match module name 2020-12-10 17:44:10 -06:00
tcg-cpus-mttcg.c accel/tcg: rename tcg-cpus functions to match module name 2020-12-10 17:44:10 -06:00
tcg-cpus-rr.c accel/tcg: rename tcg-cpus functions to match module name 2020-12-10 17:44:10 -06:00
tcg-cpus-rr.h accel/tcg: rename tcg-cpus functions to match module name 2020-12-10 17:44:10 -06:00
tcg-cpus.c accel/tcg: rename tcg-cpus functions to match module name 2020-12-10 17:44:10 -06:00
tcg-cpus.h accel/tcg: rename tcg-cpus functions to match module name 2020-12-10 17:44:10 -06:00
tcg-runtime-gvec.c tcg: Implement gvec support for rotate by vector 2020-06-02 08:42:37 -07:00
tcg-runtime.c tcg: Search includes from the project root source directory 2020-01-15 15:13:10 -10:00
tcg-runtime.h tcg: Implement gvec support for rotate by vector 2020-06-02 08:42:37 -07:00
trace-events accel/tcg: don't disable exec_tb trace events 2020-05-15 15:25:16 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
translate-all.c accel/tcg: Remove deprecated '-tb-size' option 2020-12-15 12:52:01 -05:00
translate-all.h cputlb: Pass retaddr to tb_check_watchpoint 2019-09-25 10:56:28 -07:00
translator.c gdbstub: add reverse step support in replay mode 2020-10-06 08:34:49 +02:00
user-exec-stub.c spapr: Unrealize vCPUs with qdev_unrealize() 2020-10-28 01:08:53 +11:00
user-exec.c accel/tcg/user-exec: silence the compiler warnings 2020-12-18 09:14:23 +01:00