The function ceph_monc_handle_map calls kfree(old) to free the old
monitor map, old points to monc->monmap. However, after that, it reads
monc->monmap->epoch and passes it to __ceph_monc_got_map. This result in
a use-after-free bug. The patch moves the free operation after the call
to __ceph_monc_got_map.
Fixes: 82dcabad750("libceph: revamp subs code, switch to SUBSCRIBE2
protocol")
Signed-off-by: Pan Bian <bianpan2016@xxxxxxx>[...]