Re: [libvirt] [PATCH] rpc: ensure thread safe initialization of SASL library

2019-07-08 Thread Sahid Orentino Ferdjaoui
On Mon, Jul 08, 2019 at 01:04:59PM +0100, Daniel P. Berrangé wrote: > On Mon, Jul 08, 2019 at 01:12:06PM +0200, Michal Privoznik wrote: > > On 7/8/19 12:39 PM, Daniel P. Berrangé wrote: > > > Neither the sasl_client_init or sasl_server_init methods are even > > > remotely threadsafe. They do a

Re: [libvirt] [PATCH] rpc: ensure thread safe initialization of SASL library

2019-07-08 Thread Daniel P . Berrangé
On Mon, Jul 08, 2019 at 01:12:06PM +0200, Michal Privoznik wrote: > On 7/8/19 12:39 PM, Daniel P. Berrangé wrote: > > Neither the sasl_client_init or sasl_server_init methods are even > > remotely threadsafe. They do a bunch of one-time initialization and > > merely use a simple integer counter to

Re: [libvirt] [PATCH] rpc: ensure thread safe initialization of SASL library

2019-07-08 Thread Michal Privoznik
On 7/8/19 12:39 PM, Daniel P. Berrangé wrote: Neither the sasl_client_init or sasl_server_init methods are even remotely threadsafe. They do a bunch of one-time initialization and merely use a simple integer counter to avoid repeated work, not even using atomic increment/reads on the counter.

[libvirt] [PATCH] rpc: ensure thread safe initialization of SASL library

2019-07-08 Thread Daniel P . Berrangé
Neither the sasl_client_init or sasl_server_init methods are even remotely threadsafe. They do a bunch of one-time initialization and merely use a simple integer counter to avoid repeated work, not even using atomic increment/reads on the counter. This can easily race in a threaded program.