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

    libceph: avoid NULL kref_put when osd reset races with alloc_msg

to the 3.6-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:
     libceph-avoid-null-kref_put-when-osd-reset-races-with-alloc_msg.patch
and it can be found in the queue-3.6 subdirectory.

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


>From 9bd952615a42d7e2ce3fa2c632e808e804637a1a Mon Sep 17 00:00:00 2001
From: Sage Weil <[email protected]>
Date: Wed, 24 Oct 2012 16:12:58 -0700
Subject: libceph: avoid NULL kref_put when osd reset races with alloc_msg

From: Sage Weil <[email protected]>

commit 9bd952615a42d7e2ce3fa2c632e808e804637a1a upstream.

The ceph_on_in_msg_alloc() method drops con->mutex while it allocates a
message.  If that races with a timeout that resends a zillion messages and
resets the connection, and the ->alloc_msg() method returns a NULL message,
it will call ceph_msg_put(NULL) and BUG.

Fix by only calling put if msg is non-NULL.

Fixes http://tracker.newdream.net/issues/3142

Signed-off-by: Sage Weil <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 net/ceph/messenger.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2750,7 +2750,8 @@ static int ceph_con_in_msg_alloc(struct
                msg = con->ops->alloc_msg(con, hdr, skip);
                mutex_lock(&con->mutex);
                if (con->state != CON_STATE_OPEN) {
-                       ceph_msg_put(msg);
+                       if (msg)
+                               ceph_msg_put(msg);
                        return -EAGAIN;
                }
                con->in_msg = msg;


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

queue-3.6/libceph-avoid-null-kref_put-when-osd-reset-races-with-alloc_msg.patch
queue-3.6/libceph-check-for-invalid-mapping.patch
queue-3.6/ceph-avoid-32-bit-page-index-overflow.patch
queue-3.6/rbd-reset-backoff-if-unable-to-re-queue.patch
queue-3.6/ceph-fix-oops-when-handling-mdsmap-that-decreases-max_mds.patch
queue-3.6/ceph-fix-dentry-reference-leak-in-encode_fh.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to