]> err.no Git - linux-2.6/commitdiff
[PATCH] cifs: fix rare oops in cifs_close
authorSteve French <smfrench@austin.rr.com>
Fri, 29 Apr 2005 05:41:05 +0000 (22:41 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 29 Apr 2005 05:41:05 +0000 (22:41 -0700)
Protect access to cifs file list in cifs_close path

Signed-off-by: Steve French (sfrench@us.ibm.com)
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/cifs/CHANGES
fs/cifs/file.c

index 43b3119a16edf5abae4106c36f685c6066163cb2..ce16b0ae772ef6db31cad1930a259236e1629448 100644 (file)
@@ -6,7 +6,8 @@ Add support for lsattr (getting ext2/ext3/reiserfs attr flags from the server)
 as new protocol extensions. Do not send Get/Set calls for POSIX ACLs
 unless server explicitly claims to support them in CIFS Unix extensions
 POSIX ACL capability bit. Fix packet signing when multiuser mounting with
-different users from the same client to the same server.
+different users from the same client to the same server. Fix oops in
+cifs_close.
 
 Version 1.31
 ------------
index dcab7cf1b53bf16de9c151bfaa651535b4e4f179..9c7755053099534e865fa3c179f525237fc9945d 100644 (file)
@@ -465,8 +465,10 @@ int cifs_close(struct inode *inode, struct file *file)
                                write_lock(&file->f_owner.lock);
                        }
                }
+               write_lock(&GlobalSMBSeslock);
                list_del(&pSMBFile->flist);
                list_del(&pSMBFile->tlist);
+               write_unlock(&GlobalSMBSeslock);
                write_unlock(&file->f_owner.lock);
                kfree(pSMBFile->search_resume_name);
                kfree(file->private_data);