Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1729706
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3.16 083/233] libceph: NULL deref on crush_decode() error path |
| Date | 2017-09-10 01:10 +0200 |
| Message-ID | <unX2W-3Jz-15@gated-at.bofh.it> (permalink) |
| References | <unWqd-3ep-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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",
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[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
csiph-web