A system libslirp (either static or dynamic) cannot be used with QEMU if QEMU is compiled with control-flow instrumentation, because of the way timers are implemented in libslirp. libslirp passes a function pointer to the timer_new callback but the type information for the callback is missing; invoking the timer callback produces a CFI false positive.
The fix requires the introduction of new interfaces in libslirp. This series is an example of how QEMU would use the new interfaces introduced by libslirp merge request at https://gitlab.freedesktop.org/slirp/libslirp/-/merge_requests/117. It is RFC-only because the new interfaces have not been accepted yet. Paolo Bonzini (4): net: slirp: introduce a wrapper struct for QemuTimer net: slirp: switch to slirp_new net: slirp: add support for CFI-friendly timer API net: slirp: allow CFI with libslirp >= 4.7 meson.build | 24 +++++++-------- net/slirp.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 86 insertions(+), 23 deletions(-) -- 2.35.1