qemu-e2k/include/qemu
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
..
atomic128.h qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
atomic.h qemu/atomic: Drop special case for unsupported compiler 2020-12-15 12:52:07 -05:00
base64.h nomaintainer: Fix Lesser GPL version number 2020-11-15 17:04:40 +01:00
bcd.h
bitmap.h
bitops.h qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
bswap.h qemu/bswap: Remove unused qemu_bswap_len() 2020-11-17 09:45:24 +01:00
buffer.h nomaintainer: Fix Lesser GPL version number 2020-11-15 17:04:40 +01:00
co-shared-resource.h
compiler.h cfi: Initial support for cfi-icall in QEMU 2021-01-02 21:03:35 +01:00
config-file.h config-file: move -set implementation to vl.c 2020-12-10 12:15:19 -05:00
coroutine_int.h
coroutine.h qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
cpuid.h
crc32c.h
ctype.h
cutils.h cutils: replace strdup with g_strdup 2020-11-03 09:42:52 -05:00
datadir.h vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
dbus.h
drm.h
envlist.h
error-report.h
event_notifier.h
fifo8.h
fifo32.h
filemonitor.h nomaintainer: Fix Lesser GPL version number 2020-11-15 17:04:40 +01:00
futex.h
guest-random.h
hbitmap.h
help_option.h keyval: Parse help options 2020-10-15 16:06:27 +02:00
host-utils.h
id.h
int128.h qemu/int128: Add int128_lshift 2020-08-28 10:02:47 +01:00
iov.h util/iov: add iov_discard_undo() 2020-09-23 13:41:58 +01:00
iova-tree.h
jhash.h
job.h
lockable.h
log-for-trace.h
log.h qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
main-loop.h main-loop: Fix comment 2020-09-01 12:07:52 +02:00
memfd.h
mmap-alloc.h
module.h module: silence errors for module_load_qom_all(). 2020-10-15 10:43:48 +02:00
notify.h
nvdimm-utils.h Clean up includes 2020-12-10 17:16:44 +01:00
option_int.h
option.h qemu-option: restrict qemu_opts_set to merge-lists QemuOpts 2020-12-10 12:15:12 -05:00
osdep.h oslib: do not call g_strdup from qemu_get_exec_dir 2020-09-30 19:11:36 +02:00
path.h
plugin-memory.h
plugin.h plugin: propagate errors 2020-12-15 12:51:56 -05:00
pmem.h
processor.h
progress_meter.h
qdist.h
qemu-plugin.h qemu-plugin.h: remove GCC < 4 2020-12-15 12:52:09 -05:00
qemu-print.h
qht.h
qsp.h
queue.h qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
range.h
ratelimit.h
rcu_queue.h qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
rcu.h qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
readline.h
selfmap.h
seqlock.h qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
sockets.h
stats64.h qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
sys_membarrier.h
systemd.h
thread-posix.h
thread-win32.h
thread.h qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
throttle-options.h
throttle.h
timed-average.h
timer.h cpu-timers, icount: new modules 2020-10-05 16:41:22 +02:00
tsan.h
typedefs.h migration: Replace migration's JSON writer by the general one 2020-12-19 10:39:16 +01:00
unicode.h
units.h
uri.h
uuid.h
vfio-helpers.h util/vfio-helpers: Pass page protections to qemu_vfio_pci_map_bar() 2020-10-05 09:35:52 +01:00
vhost-user-server.h libvhost-user: make it a meson subproject 2020-12-08 13:48:58 -05:00
win_dump_defs.h
xattr.h
xxhash.h