Skip to content

Commit

Permalink
libceph: fix misjudgement of maximum monitor number
Browse files Browse the repository at this point in the history
num_mon should allow up to CEPH_MAX_MON in ceph_monmap_decode().

Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
  • Loading branch information
Chengguang Xu authored and Ilya Dryomov committed Apr 2, 2018
1 parent 11e1478 commit 7377324
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ceph/mon_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct ceph_monmap *ceph_monmap_decode(void *p, void *end)
num_mon = ceph_decode_32(&p);
ceph_decode_need(&p, end, num_mon*sizeof(m->mon_inst[0]), bad);

if (num_mon >= CEPH_MAX_MON)
if (num_mon > CEPH_MAX_MON)
goto bad;
m = kmalloc(sizeof(*m) + sizeof(m->mon_inst[0])*num_mon, GFP_NOFS);
if (m == NULL)
Expand Down

0 comments on commit 7377324

Please sign in to comment.