diff options
| author | Ilya Dryomov <idryomov@gmail.com> | 2018-05-22 10:26:51 -0400 |
|---|---|---|
| committer | Ilya Dryomov <idryomov@gmail.com> | 2018-06-04 14:45:59 -0400 |
| commit | 6001567c14eb8e93f8bceb35fc02158a3e1f20f8 (patch) | |
| tree | f3eb8665a17131852e844453c281750cffcdc56c /net/ceph | |
| parent | 29e878201ee635940ba018bce51f4ee0f0e47a5b (diff) | |
libceph: avoid a use-after-free during map check
Sending map check after complete_request() was called is not only
useless, but can lead to a use-after-free as req->r_kref decrement in
__complete_request() races with map check code.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Diffstat (limited to 'net/ceph')
| -rw-r--r-- | net/ceph/osd_client.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 34b5334548c3..294320400c72 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
| @@ -2266,7 +2266,7 @@ again: | |||
| 2266 | complete_request(req, err); | 2266 | complete_request(req, err); |
| 2267 | mutex_unlock(&osd->lock); | 2267 | mutex_unlock(&osd->lock); |
| 2268 | 2268 | ||
| 2269 | if (ct_res == CALC_TARGET_POOL_DNE) | 2269 | if (!err && ct_res == CALC_TARGET_POOL_DNE) |
| 2270 | send_map_check(req); | 2270 | send_map_check(req); |
| 2271 | 2271 | ||
| 2272 | if (promoted) | 2272 | if (promoted) |
