cluster: RHEL54 - Bug in GFS locking code leads to dos

Bob Peterson rpeterso at fedoraproject.org
Thu Mar 11 17:50:09 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=565fc69b92c16e00385008e55339e0434e86edd6
Commit:        565fc69b92c16e00385008e55339e0434e86edd6
Parent:        a7cca219bb0d1c8551e3a90094c78c0fdec51fbd
Author:        Bob Peterson <rpeterso at redhat.com>
AuthorDate:    Thu Mar 11 11:35:01 2010 -0600
Committer:     Bob Peterson <rpeterso at redhat.com>
CommitterDate: Thu Mar 11 11:46:08 2010 -0600

Bug in GFS locking code leads to dos

This patch fixes the bug described in bug 570863.
Without the patch, a program may be written that uses
locking commands to crash the system.

rhbz#571297
---
 gfs-kernel/src/gfs/ops_file.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/gfs-kernel/src/gfs/ops_file.c b/gfs-kernel/src/gfs/ops_file.c
index bd68583..cbf9d2d 100644
--- a/gfs-kernel/src/gfs/ops_file.c
+++ b/gfs-kernel/src/gfs/ops_file.c
@@ -1652,7 +1652,8 @@ gfs_lock(struct file *file, int cmd, struct file_lock *fl)
 
 	if (!(fl->fl_flags & FL_POSIX))
 		return -ENOLCK;
-	if ((ip->i_di.di_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
+	if ((ip->i_di.di_mode & (S_ISGID | S_IXGRP)) == S_ISGID &&
+	    fl->fl_type != F_UNLCK)
 		return -ENOLCK;
 
 	if (cmd == F_CANCELLK) {


More information about the cluster-commits mailing list