[3.11.y.z extended stable] Patch "ceph: fix null pointer dereference" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Thu Jan 9 12:04:53 UTC 2014


This is a note to let you know that I have just added a patch titled

    ceph: fix null pointer dereference

to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.11.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 9d82a150dde742f724cf2b71c11b12f06907557d Mon Sep 17 00:00:00 2001
From: Nathaniel Yazdani <n1ght.4nd.d4y at gmail.com>
Date: Sun, 4 Aug 2013 21:04:30 -0700
Subject: ceph: fix null pointer dereference

commit c338c07c51e3106711fad5eb599e375eadb6855d upstream.

When register_session() is given an out-of-range argument for mds,
ceph_mdsmap_get_addr() will return a null pointer, which would be given to
ceph_con_open() & be dereferenced, causing a kernel oops. This fixes bug #4685
in the Ceph bug tracker <http://tracker.ceph.com/issues/4685>.

Signed-off-by: Nathaniel Yazdani <n1ght.4nd.d4y at gmail.com>
Reviewed-by: Sage Weil <sage at inktank.com>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 fs/ceph/mds_client.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 17b97ff..96d03db 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -414,6 +414,9 @@ static struct ceph_mds_session *register_session(struct ceph_mds_client *mdsc,
 {
 	struct ceph_mds_session *s;

+	if (mds >= mdsc->mdsmap->m_max_mds)
+		return ERR_PTR(-EINVAL);
+
 	s = kzalloc(sizeof(*s), GFP_NOFS);
 	if (!s)
 		return ERR_PTR(-ENOMEM);
--
1.8.3.2





More information about the kernel-team mailing list