From: Sage Weil Date: Thu, 15 Sep 2016 21:41:49 +0000 (-0400) Subject: os/bluestore: EINVAL bad clone_range args X-Git-Tag: v11.0.1~216^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5a7b00b138bca011896056159447bdec2966180c;p=ceph.git os/bluestore: EINVAL bad clone_range args Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index c9e513a7086..f7fd1624df4 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -8100,15 +8100,19 @@ int BlueStore::_clone_range(TransContext *txc, << newo->oid << " from 0x" << std::hex << srcoff << "~" << length << " to offset 0x" << dstoff << std::dec << dendl; int r = 0; - bufferlist bl; + + if (srcoff + length > oldo->onode.size) { + r = -EINVAL; + goto out; + } + newo->exists = true; _assign_nid(txc, newo); r = _do_read(c.get(), oldo, srcoff, length, bl, 0); if (r < 0) goto out; - r = _do_write(txc, c, newo, dstoff, bl.length(), bl, 0); if (r < 0) goto out;