Race condition in tdb_runtime_check_for_robust_mutexes()

Ralph Boehme slow at samba.org
Tue Mar 29 20:45:22 UTC 2016


On Tue, Mar 29, 2016 at 09:29:15PM +0200, Ralph Boehme wrote:
> On Tue, Mar 29, 2016 at 10:07:11PM +0300, Uri Simchoni wrote:
> > On 03/29/2016 03:05 PM, Ralph Boehme wrote:
> > > On Tue, Mar 29, 2016 at 01:43:08PM +0300, Uri Simchoni wrote:
> > >> On 03/29/2016 01:41 PM, Ralph Boehme wrote:
> > >>> On Tue, Mar 29, 2016 at 01:22:35PM +0300, Uri Simchoni wrote:
> > >>>> On 03/29/2016 01:03 PM, Uri Simchoni wrote:
> > >>>>> On 03/29/2016 12:52 PM, Uri Simchoni wrote:
> > >>>>>> Pushed with my RB+
> > >>>>>
> > >>>>> ..once again with the removed unused status :)
> > >>>>>
> > >>>>>
> > >>>> OK this is becoming embarrassing.
> > >>>>
> > >>>> Please review the attached - jumping to cleanup_m instead of cleanup_ma
> > >>>> after pthread_sigmask().
> > >>>
> > >>> thanks for spotting this! Pushed.
> > >>>
> > >>> I was already seriously considering adding a second patch that changes
> > >>> the cleanup logic to use state flags instead of gotos, eg
> > >>>
> > >>>   bool cleanup_mutex = false;
> > >>>
> > >>>   ret = pthread_mutex_init(...);
> > >>>   if (ret != 0) {
> > >>>     goto cleanup;
> > >>>   }
> > >>>   cleanup_mutex = true; 
> > >>>
> > >>>   ...
> > >>>
> > >>> cleanup:
> > >>>   if (cleanup_mutex) {
> > >>>     ...cleanup mutex...
> > >>>   }
> > >>>
> > >>> Cheerio!
> > >>> -slow
> > >>
> > >> Seems like the thing we should do, considering the empirical evidence...
> > > 
> > > attached. Not sure if we really want this.
> > > 
> > > Cheerio!
> > > -slow
> > > 
> > 
> > I share the concern about the cost of the flags - here's a patch that
> > reduces the number of flags to 2. What do you think?
> 
> interesting. :) I'll give it a closer look tomorrow.

time warp...

lgtm, pushed.

> metze aborted the autobuild of the tdb version bump so we can push
> both patches together once we have a version we're happy with.

pushed alongside.

Cheerio!
-slow



More information about the samba-technical mailing list