Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1729706 > unrolled thread

[PATCH 3.16 083/233] libceph: NULL deref on crush_decode() error path

Started byBen Hutchings <ben@decadent.org.uk>
First post2017-09-10 01:10 +0200
Last post2017-09-10 01:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3.16 083/233] libceph: NULL deref on crush_decode() error path Ben Hutchings <ben@decadent.org.uk> - 2017-09-10 01:10 +0200

#1729706 — [PATCH 3.16 083/233] libceph: NULL deref on crush_decode() error path

FromBen Hutchings <ben@decadent.org.uk>
Date2017-09-10 01:10 +0200
Subject[PATCH 3.16 083/233] libceph: NULL deref on crush_decode() error path
Message-ID<unX2W-3Jz-15@gated-at.bofh.it>
3.16.48-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Dan Carpenter <dan.carpenter@oracle.com>

commit 293dffaad8d500e1a5336eeb90d544cf40d4fbd8 upstream.

If there is not enough space then ceph_decode_32_safe() does a goto bad.
We need to return an error code in that situation.  The current code
returns ERR_PTR(0) which is NULL.  The callers are not expecting that
and it results in a NULL dereference.

Fixes: f24e9980eb86 ("ceph: OSD client")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/ceph/osdmap.c | 1 +
 1 file changed, 1 insertion(+)

--- a/net/ceph/osdmap.c
+++ b/net/ceph/osdmap.c
@@ -270,6 +270,7 @@ static struct crush_map *crush_decode(vo
 		u32 yes;
 		struct crush_rule *r;
 
+		err = -EINVAL;
 		ceph_decode_32_safe(p, end, yes, bad);
 		if (!yes) {
 			dout("crush_decode NO rule %d off %x %p to %p\n",

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web