]> git.baikalelectronics.ru Git - kernel.git/commit
libceph: NULL deref on osdmap_apply_incremental() error path
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 13 Jul 2017 07:45:17 +0000 (10:45 +0300)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 17 Jul 2017 12:54:58 +0000 (14:54 +0200)
commitdd2c6be4c34fdc9796ff91f6cf64d4656c1b8a7c
treee35bf3150b2251ac2db8d16a50576ef975943e3a
parent0194f902093e49d49bc81a4ec3e19f4c4070bb42
libceph: NULL deref on osdmap_apply_incremental() error path

There are hidden gotos in the ceph_decode_* macros.  We need to set the
"err" variable on these error paths otherwise we end up returning
ERR_PTR(0) which is NULL.  It causes NULL dereferences in the callers.

Fixes: 8f858e82570e ("libceph: pg_upmap[_items] infrastructure")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
[idryomov@gmail.com: similar bug in osdmap_decode(), changelog tweak]
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
net/ceph/osdmap.c