This is a note to let you know that I've just added the patch titled

    cifs: check for private_data before trying to put it

to the 2.6.38-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     cifs-check-for-private_data-before-trying-to-put-it.patch
and it can be found in the queue-2.6.38 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 7797069305d13252fd66cf722aa8f2cbeb3c95cd Mon Sep 17 00:00:00 2001
From: Jeff Layton <[email protected]>
Date: Tue, 5 Apr 2011 16:23:47 -0700
Subject: cifs: check for private_data before trying to put it

From: Jeff Layton <[email protected]>

commit 7797069305d13252fd66cf722aa8f2cbeb3c95cd upstream.

cifs_close doesn't check that the filp->private_data is non-NULL before
trying to put it. That can cause an oops in certain error conditions
that can occur on open or lookup before the private_data is set.

Reported-by: Ben Greear <[email protected]>
Signed-off-by: Jeff Layton <[email protected]>
Signed-off-by: Steve French <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 fs/cifs/file.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -575,8 +575,10 @@ reopen_error_exit:
 
 int cifs_close(struct inode *inode, struct file *file)
 {
-       cifsFileInfo_put(file->private_data);
-       file->private_data = NULL;
+       if (file->private_data != NULL) {
+               cifsFileInfo_put(file->private_data);
+               file->private_data = NULL;
+       }
 
        /* return code from the ->release op is always ignored */
        return 0;


Patches currently in stable-queue which might be from [email protected] are

queue-2.6.38/cifs-set-ra_pages-in-backing_dev_info.patch
queue-2.6.38/cifs-wrap-received-signature-check-in-srv_mutex.patch
queue-2.6.38/cifs-always-do-is_path_accessible-check-in-cifs_mount.patch
queue-2.6.38/cifs-check-for-private_data-before-trying-to-put-it.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to