cluster: RHEL6 - rgmanager: Fix potential unlocked memory access

Ryan McCabe rmccabe at fedoraproject.org
Wed Jul 17 14:49:09 UTC 2013


Gitweb:        http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=ceb12b85b625d57d0d219e55e2e179192fee53d6
Commit:        ceb12b85b625d57d0d219e55e2e179192fee53d6
Parent:        ea7368961f57b06d7553977275beec3f261191a2
Author:        Ryan McCabe <rmccabe at redhat.com>
AuthorDate:    Tue Feb 26 10:57:47 2013 -0500
Committer:     Ryan McCabe <rmccabe at redhat.com>
CommitterDate: Wed Jul 17 10:49:05 2013 -0400

rgmanager: Fix potential unlocked memory access

Fix a potential unlocked access of the resource list.

Related: rhbz#983296

Signed-off-by: Ryan McCabe <rmccabe at redhat.com>
---
 rgmanager/src/daemons/groups.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/rgmanager/src/daemons/groups.c b/rgmanager/src/daemons/groups.c
index ee0fc81..e802c2f 100644
--- a/rgmanager/src/daemons/groups.c
+++ b/rgmanager/src/daemons/groups.c
@@ -1750,7 +1750,9 @@ init_resource_groups(int reconfigure, int do_init)
 
 		do_condstops();
 
+		pthread_rwlock_rdlock(&resource_lock);
 		copy_incarnations(&_resources, &reslist);
+		pthread_rwlock_unlock(&resource_lock);
 	}
 
 	/* Swap in the new configuration */


More information about the cluster-commits mailing list