]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: revoke rx_buffer on op_cancel
authorSage Weil <sage@redhat.com>
Mon, 8 Sep 2014 20:44:57 +0000 (13:44 -0700)
committerSage Weil <sage@redhat.com>
Tue, 9 Sep 2014 21:33:25 +0000 (14:33 -0700)
If we cancel a read, revoke the rx buffers to avoid a use-after-free and/or
other undefined badness by using user buffers that may no longer be
present.

Fixes: #9362
Backport: firefly, dumpling
Reported-by: Matthias Kiefer <matthias.kiefer@1und1.de>
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 2305b2897acba38384358c33ca3bbfcae6f1c74e)

(adjusted for op->con instead of s->con)

src/osdc/Objecter.cc

index dc46bb00aaa5d7dc58f9aa9619069551c71bc674..0a0f3cc2525f78b9ca38a772a96ba2ff9e6bb545 100644 (file)
@@ -1296,6 +1296,11 @@ int Objecter::op_cancel(tid_t tid, int r)
 
   ldout(cct, 10) << __func__ << " tid " << tid << dendl;
   Op *op = p->second;
+  if (op->con) {
+    ldout(cct, 20) << " revoking rx buffer for " << tid
+                  << " on " << op->con << dendl;
+    op->con->revoke_rx_buffer(tid);
+  }
   if (op->onack) {
     op->onack->complete(r);
     op->onack = NULL;