All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH] liblogthread, fix fclose race
@ 2014-08-28 12:00 Christine Caulfield
  0 siblings, 0 replies; only message in thread
From: Christine Caulfield @ 2014-08-28 12:00 UTC (permalink / raw)
  To: cluster-devel.redhat.com

The mutex in liblogthread protects the list of messages to be printed, 
but not the FILE*. So the printing thread gets the mutex, takes the 
entries off the list and then releases it before doing the printing.

It's quite possible that the FILE* has been freed by the calling daemon 
in this gap, thus causing a daemon segfault when the message comes to be 
printed

The fclose/fopen code is already protected by the mutex so it seems to 
be a simple matter of moving the phthread_mutex_unlock() a little later 
in the print loop.

Signed-Off-By: Christine Caulfield <ccaulfie@redhat.com>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: logt_race_stable3.patch
Type: text/x-patch
Size: 569 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20140828/de0cdb6e/attachment.bin>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-08-28 12:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-28 12:00 [Cluster-devel] [PATCH] liblogthread, fix fclose race Christine Caulfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.