From: ownedu Date: Fri, 29 Sep 2017 05:50:23 +0000 (+0800) Subject: Fix a potential coredump when handling tx_buffers under heacy RDMA X-Git-Tag: v13.0.1~738^2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=59c54caec072273403e5f1ccc331c8a61fb90b0b;p=ceph.git Fix a potential coredump when handling tx_buffers under heacy RDMA traffic, there are chances to access a current_chunk which can be beyond the range of pre-allocated Tx buffer pool thus causes a coredump. Signed-off-by: Yan Lei --- diff --git a/src/msg/async/rdma/RDMAConnectedSocketImpl.cc b/src/msg/async/rdma/RDMAConnectedSocketImpl.cc index 8f2ac4a59c1..32fadaed13f 100644 --- a/src/msg/async/rdma/RDMAConnectedSocketImpl.cc +++ b/src/msg/async/rdma/RDMAConnectedSocketImpl.cc @@ -467,9 +467,9 @@ ssize_t RDMAConnectedSocketImpl::submit(bool more) total_copied += r; bytes -= r; if (current_chunk->full()){ - current_chunk = tx_buffers[++chunk_idx]; - if (chunk_idx == tx_buffers.size()) + if (++chunk_idx == tx_buffers.size()) return total_copied; + current_chunk = tx_buffers[chunk_idx]; } } ++start;