Commit 61baa87
committed
librbd: clear ctx before initiating close in Image::{aio_,}close()
Image::aio_close() must clear ctx before initiating close. Otherwise
the provided callback may see a non-NULL ctx and attempt to close the
image again from Image destructor, leading to an invalid memory access
as ImageCtx and ImageState are both freed immediately after the image
is closed (i.e. before AioCompletion is completed and the callback is
executed).
The same adjustment is made to Image::close() just for consistency.
Fixes: https://tracker.ceph.com/issues/69619
Signed-off-by: Ilya Dryomov <[email protected]>1 parent a02b9b4 commit 61baa87
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1704 | 1704 | | |
1705 | 1705 | | |
1706 | 1706 | | |
| 1707 | + | |
1707 | 1708 | | |
1708 | | - | |
1709 | 1709 | | |
1710 | 1710 | | |
1711 | 1711 | | |
| |||
1721 | 1721 | | |
1722 | 1722 | | |
1723 | 1723 | | |
| 1724 | + | |
1724 | 1725 | | |
1725 | 1726 | | |
1726 | | - | |
1727 | 1727 | | |
1728 | 1728 | | |
1729 | 1729 | | |
| |||
0 commit comments