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

Bob Peterson rpeterso at fedoraproject.org
Thu Mar 11 17:44:45 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=abf96e2fbe89852fa67e9c5120a0cbe4b9d8d090
Commit:        abf96e2fbe89852fa67e9c5120a0cbe4b9d8d090
Parent:        2d0323010f7110452625bc71c9898459a2ca7e85
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:41:09 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#571298
---
 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 4d263ee..46cfec2 100644
--- a/gfs-kernel/src/gfs/ops_file.c
+++ b/gfs-kernel/src/gfs/ops_file.c
@@ -1625,7 +1625,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 (sdp->sd_args.ar_localflocks) {


More information about the cluster-commits mailing list