]> git.baikalelectronics.ru Git - kernel.git/commit
libceph: NULL deref on crush_decode() error path
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 23 May 2017 14:25:10 +0000 (17:25 +0300)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 23 May 2017 18:32:32 +0000 (20:32 +0200)
commit6acd7e6b8bd21e4bb231ce6563270cb701439d26
tree1eb76ba55a52cc58f21125d01f9b33b6f220c0d5
parent82bf2be7616d2aa2dab78d78da1d6292cae86c00
libceph: NULL deref on crush_decode() error path

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: ce905a62b886 ("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>
net/ceph/osdmap.c