From cd0b0fef57b581395df4ded08099e2fb651ec5fb Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Mon, 10 Apr 2017 16:30:47 -0600 Subject: [PATCH 1/2] osc/pt2pt: fix infinite frag allocation loop Signed-off-by: Nathan Hjelm (cherry picked from commit 12b52b2b2cad64f0d98861964286ceb25bdfbd44) Signed-off-by: Nathan Hjelm --- ompi/mca/osc/pt2pt/osc_pt2pt_frag.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt_frag.h b/ompi/mca/osc/pt2pt/osc_pt2pt_frag.h index f4e05a12ad8..a20b3618b86 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt_frag.h +++ b/ompi/mca/osc/pt2pt/osc_pt2pt_frag.h @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2012 Sandia National Laboratories. All rights reserved. - * Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights + * Copyright (c) 2014-2017 Los Alamos National Security, LLC. All rights * reserved. * $COPYRIGHT$ * @@ -172,6 +172,10 @@ static inline int ompi_osc_pt2pt_frag_alloc (ompi_osc_pt2pt_module_t *module, in { int ret; + if (request_len > mca_osc_pt2pt_component.buffer_size) { + return OMPI_ERR_OUT_OF_RESOURCE; + } + do { ret = ompi_osc_pt2pt_frag_alloc (module, target, request_len , buffer, ptr, long_send, buffered); if (OPAL_LIKELY(OMPI_SUCCESS == ret || OMPI_ERR_OUT_OF_RESOURCE != ret)) { From a8892533a6263ed452a1d41d4548e2e4948c19ae Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Thu, 23 Mar 2017 09:00:21 -0600 Subject: [PATCH 2/2] osc/pt2pt: fix typo Signed-off-by: Nathan Hjelm (cherry picked from commit c72fb30eb5f2588ceb7dfc7bb74f1b714f62099e) Signed-off-by: Nathan Hjelm --- ompi/mca/osc/pt2pt/osc_pt2pt_frag.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt_frag.h b/ompi/mca/osc/pt2pt/osc_pt2pt_frag.h index a20b3618b86..9325b448d75 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt_frag.h +++ b/ompi/mca/osc/pt2pt/osc_pt2pt_frag.h @@ -177,7 +177,7 @@ static inline int ompi_osc_pt2pt_frag_alloc (ompi_osc_pt2pt_module_t *module, in } do { - ret = ompi_osc_pt2pt_frag_alloc (module, target, request_len , buffer, ptr, long_send, buffered); + ret = _ompi_osc_pt2pt_frag_alloc (module, target, request_len , buffer, ptr, long_send, buffered); if (OPAL_LIKELY(OMPI_SUCCESS == ret || OMPI_ERR_OUT_OF_RESOURCE != ret)) { break; }