c905a3680d
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> |
||
---|---|---|
.. | ||
atomic128.h | ||
atomic.h | ||
base64.h | ||
bcd.h | ||
bitmap.h | ||
bitops.h | ||
bswap.h | ||
buffer.h | ||
co-shared-resource.h | ||
compiler.h | ||
config-file.h | ||
coroutine_int.h | ||
coroutine.h | ||
cpuid.h | ||
crc32c.h | ||
ctype.h | ||
cutils.h | ||
datadir.h | ||
dbus.h | ||
drm.h | ||
envlist.h | ||
error-report.h | ||
event_notifier.h | ||
fifo8.h | ||
fifo32.h | ||
filemonitor.h | ||
futex.h | ||
guest-random.h | ||
hbitmap.h | ||
help_option.h | ||
host-utils.h | ||
id.h | ||
int128.h | ||
iov.h | ||
iova-tree.h | ||
jhash.h | ||
job.h | ||
lockable.h | ||
log-for-trace.h | ||
log.h | ||
main-loop.h | ||
memfd.h | ||
mmap-alloc.h | ||
module.h | ||
notify.h | ||
nvdimm-utils.h | ||
option_int.h | ||
option.h | ||
osdep.h | ||
path.h | ||
plugin-memory.h | ||
plugin.h | ||
pmem.h | ||
processor.h | ||
progress_meter.h | ||
qdist.h | ||
qemu-plugin.h | ||
qemu-print.h | ||
qht.h | ||
qsp.h | ||
queue.h | ||
range.h | ||
ratelimit.h | ||
rcu_queue.h | ||
rcu.h | ||
readline.h | ||
selfmap.h | ||
seqlock.h | ||
sockets.h | ||
stats64.h | ||
sys_membarrier.h | ||
systemd.h | ||
thread-posix.h | ||
thread-win32.h | ||
thread.h | ||
throttle-options.h | ||
throttle.h | ||
timed-average.h | ||
timer.h | ||
tsan.h | ||
typedefs.h | ||
unicode.h | ||
units.h | ||
uri.h | ||
uuid.h | ||
vfio-helpers.h | ||
vhost-user-server.h | ||
win_dump_defs.h | ||
xattr.h | ||
xxhash.h |