Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > e92145e04b77d6f57a758422ce479a60 > files > 6

gfs-kmod-0.1.34-12.el5.src.rpm

commit e685b407d5fa266bc99563932b2336aff2489363
Author: Bob Peterson <rpeterso@redhat.com>
Date:   Thu Mar 11 11:35:01 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

diff --git a/gfs-kernel/src/gfs/ops_file.c b/gfs-kernel/src/gfs/ops_file.c
index 440fbf6..150f328 100644
--- a/gfs-kernel/src/gfs/ops_file.c
+++ b/gfs-kernel/src/gfs/ops_file.c
@@ -1653,7 +1653,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) {