summaryrefslogtreecommitdiffstats
path: root/util/oslib-posix.c
diff options
context:
space:
mode:
authorPeter Maydell2021-01-06 16:55:29 +0100
committerPeter Maydell2021-01-06 16:55:29 +0100
commitaadac5b3d9fdce28030495f80fc76a4336e97328 (patch)
tree4ddddf4811bb9e9bb8aecdba57f6bf3730e3a790 /util/oslib-posix.c
parentMerge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-20210106' into... (diff)
parentwin32: drop fd registration to the main-loop on setting non-block (diff)
downloadqemu-aadac5b3d9fdce28030495f80fc76a4336e97328.tar.gz
qemu-aadac5b3d9fdce28030495f80fc76a4336e97328.tar.xz
qemu-aadac5b3d9fdce28030495f80fc76a4336e97328.zip
Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging
From Alex's pull request: * improve cross-build KVM coverage * new --without-default-features configure flag * add __repr__ for ConsoleSocket for debugging * build tcg tests with -Werror * test 32 bit builds with fedora * remove last traces of debian9 * hotfix for centos8 powertools repo * Move lots of feature detection code to meson (Alex, myself) * CFI and LTO support (Daniele) * test-char dangling pointer (Eduardo) * Build system and win32 fixes (Marc-André) * Initialization fixes (myself) * TCG include cleanup (Richard, myself) * x86 'int N' fix (Peter) # gpg: Signature made Wed 06 Jan 2021 09:21:25 GMT # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini-gitlab/tags/for-upstream: (52 commits) win32: drop fd registration to the main-loop on setting non-block configure: move tests/qemu-iotests/common.env generation to meson meson.build: convert --with-default-devices to meson libattr: convert to meson cap_ng: convert to meson virtfs: convert to meson seccomp: convert to meson zstd: convert to meson lzfse: convert to meson snappy: convert to meson lzo: convert to meson rbd: convert to meson libnfs: convert to meson libiscsi: convert to meson bzip2: convert to meson glusterfs: convert to meson curl: convert to meson curl: remove compatibility code, require 7.29.0 brlapi: convert to meson configure: remove CONFIG_FILEVERSION and CONFIG_PRODUCTVERSION ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org> # Conflicts: # trace/meson.build
Diffstat (limited to 'util/oslib-posix.c')
-rw-r--r--util/oslib-posix.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index f15234b5c0..f1e2801b11 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -39,6 +39,7 @@
#include "qemu/thread.h"
#include <libgen.h>
#include "qemu/cutils.h"
+#include "qemu/compiler.h"
#ifdef CONFIG_LINUX
#include <sys/syscall.h>
@@ -773,6 +774,16 @@ void qemu_free_stack(void *stack, size_t sz)
munmap(stack, sz);
}
+/*
+ * Disable CFI checks.
+ * We are going to call a signal hander directly. Such handler may or may not
+ * have been defined in our binary, so there's no guarantee that the pointer
+ * used to set the handler is a cfi-valid pointer. Since the handlers are
+ * stored in kernel memory, changing the handler to an attacker-defined
+ * function requires being able to call a sigaction() syscall,
+ * which is not as easy as overwriting a pointer in memory.
+ */
+QEMU_DISABLE_CFI
void sigaction_invoke(struct sigaction *action,
struct qemu_signalfd_siginfo *info)
{