Re: [PATCH] meson: Stop if cfi is enabled with system slirp

2021-03-08 Thread Daniele Buono
On 3/5/2021 12:18 PM, Paolo Bonzini wrote: Ok, so let's go with your patch for now.  Independently we could change libslirp to: - add a separate callback (timer_new_v2?) in SlirpCb.  If it is set, we use it and pass an enum instead of the SlirpTimerCb cb. - add a function slirp_timer_exp

Re: [PATCH] meson: Stop if cfi is enabled with system slirp

2021-03-08 Thread Daniele Buono
On 3/8/2021 6:19 AM, Daniel P. Berrangé wrote: My concern is that libslirp is just showing us one known example of the problem. QEMU links to many more external libraries, which might exhibit similar issues. If we need to rebuild all the dependancies with CFI too, to be confident that the combine

Re: [PATCH] meson: Stop if cfi is enabled with system slirp

2021-03-08 Thread Paolo Bonzini
On 08/03/21 12:19, Daniel P. Berrangé wrote: My concern is that libslirp is just showing us one known example of the problem. QEMU links to many more external libraries, which might exhibit similar issues. We know exactly the issue: QEMU uses a pointer to a library function as a function point

Re: [PATCH] meson: Stop if cfi is enabled with system slirp

2021-03-08 Thread Daniel P . Berrangé
On Fri, Mar 05, 2021 at 11:53:07AM -0500, Daniele Buono wrote: > On 3/4/2021 5:37 AM, Daniel P. Berrangé wrote: > > Is there work being done, or at least an active plan, for fixing this ? > > > > Distros generally won't want to static link slirp to QEMU when there is > > a shared slirp available.

Re: [PATCH] meson: Stop if cfi is enabled with system slirp

2021-03-05 Thread Paolo Bonzini
On 05/03/21 17:52, Daniele Buono wrote: diff --git a/net/slirp.c b/net/slirp.c index be914c0be0..82e05d2c01 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -174,23 +174,42 @@ static int64_t net_slirp_clock_get_ns(void *opaque)   return qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);   } +typedef struct

Re: [PATCH] meson: Stop if cfi is enabled with system slirp

2021-03-05 Thread Daniele Buono
On 3/4/2021 5:37 AM, Daniel P. Berrangé wrote: Is there work being done, or at least an active plan, for fixing this ? Distros generally won't want to static link slirp to QEMU when there is a shared slirp available. It increases the security burden to maintain slirp twice, especially as slirp h

Re: [PATCH] meson: Stop if cfi is enabled with system slirp

2021-03-05 Thread Daniele Buono
On 3/4/2021 5:56 AM, Paolo Bonzini wrote: On 04/03/21 11:37, Daniel P. Berrangé wrote: On Wed, Mar 03, 2021 at 09:59:38PM -0500, Daniele Buono wrote: 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 Time

Re: [PATCH] meson: Stop if cfi is enabled with system slirp

2021-03-04 Thread Paolo Bonzini
On 04/03/21 11:37, Daniel P. Berrangé wrote: On Wed, Mar 03, 2021 at 09:59:38PM -0500, Daniele Buono wrote: 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

Re: [PATCH] meson: Stop if cfi is enabled with system slirp

2021-03-04 Thread Daniel P . Berrangé
On Wed, Mar 03, 2021 at 09:59:38PM -0500, Daniele Buono wrote: > 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

[PATCH] meson: Stop if cfi is enabled with system slirp

2021-03-03 Thread 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