qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] meson: Stop if cfi is enabled with system slirp
@ 2021-03-04  2:59 Daniele Buono
  2021-03-04 10:37 ` Daniel P. Berrangé
  0 siblings, 1 reply; 10+ messages in thread
From: Daniele Buono @ 2021-03-04  2:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Daniele Buono

For CFI, we need to compile slirp as a static library together with qemu.
This is because we register slirp functions as callbacks for QEMU Timers.
When using a system-wide shared libslirp, the type information for the
callback is missing and the timer call produces a false positive with CFI.

With this patch, meson will stop if CFI is enabled with system-wide slirp

Signed-off-by: Daniele Buono <dbuono@linux.vnet.ibm.com>
---
 meson.build | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/meson.build b/meson.build
index f3db83e974..e1ec5020ac 100644
--- a/meson.build
+++ b/meson.build
@@ -1569,6 +1569,18 @@ if have_system
   endif
 endif
 
+# For CFI, we need to compile slirp as a static library together with qemu.
+# This is because we register slirp functions as callbacks for QEMU Timers.
+# When using a system-wide shared libslirp, the type information for the
+# callback is missing and the timer call produces a false positive with CFI.
+#
+# Now that slirp_opt has been defined, check if the selected slirp is compatible
+# with control-flow integrity.
+if get_option('cfi') and slirp_opt == 'system'
+  error('Control-Flow Integrity is not compatible with system-wide slirp.' \
+         + ' Please configure with --enable-slirp=git')
+endif
+
 fdt = not_found
 fdt_opt = get_option('fdt')
 if have_system
-- 
2.30.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-03-08 15:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-04  2:59 [PATCH] meson: Stop if cfi is enabled with system slirp Daniele Buono
2021-03-04 10:37 ` Daniel P. Berrangé
2021-03-04 10:56   ` Paolo Bonzini
2021-03-05 16:52     ` Daniele Buono
2021-03-05 17:18       ` Paolo Bonzini
2021-03-08 15:05         ` Daniele Buono
2021-03-05 16:53   ` Daniele Buono
2021-03-08 11:19     ` Daniel P. Berrangé
2021-03-08 11:27       ` Paolo Bonzini
2021-03-08 14:58       ` Daniele Buono

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).