Re: [PATCH V2] libceph: fix use after free

2018-11-27 Thread PanBian
On Tue, Nov 27, 2018 at 11:17:26AM +0100, Ilya Dryomov wrote: > On Tue, Nov 27, 2018 at 10:22 AM Pan Bian wrote: > > > > 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

Re: [PATCH V2] libceph: fix use after free

2018-11-27 Thread Ilya Dryomov
On Tue, Nov 27, 2018 at 10:22 AM Pan Bian wrote: > > 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 will > result in a use-after-free bug. T

[PATCH V2] libceph: fix use after free

2018-11-27 Thread Pan Bian
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 will result in a use-after-free bug. The patch moves the free operation after the call to __ceph_